From: Nicholas N. <nj...@ca...> - 2003-04-22 08:28:48
|
On Mon, 21 Apr 2003, Matthew Emmerton wrote: > There has been increasing interest in using Valgrind on the FreeBSD platform > > 1) Introduce a mapping layer for syscall #defines. > > For example, on Linux we'd have something like this: > > vg_syscall.h: > #define VKI_SC_exit __NR_exit > #define VKI_SC_getpid __NR_getpid > > And on FreeBSD, we'd have something like this: > > #define VKI_SC_exit SYS_exit > #define VKI_SC_getpid SYS_getpid Do the *BSD and Linux system calls match as easily as this? Ie. none of the "equivalent" ones have different arguments or similar? > 2) Introduce a mapping layer for pthread structures > > For example, on Linux: > > #define VKI_PTHREAD_OWNER __m_owner > #define VKI_PTHREAD_COUNT __m_count > #define VKI_PTHREAD_KIND __m_kind > > And on FreeBSD: > > #define VKI_PTHREAD_OWNER m_owner > #define VKI_PTHREAD_COUNT m_data.m_count > #define VKI_PTHREAD_KIND m_type Similarly, is there a nice one-to-one mapping between the relevant structures, such that this simple approach will work? Have you tried implementing these layers? It's a nice, simple proposal you've given, I'd like to know whether it suffices in practice :) Eg. I imagine many of the syscalls, particularly the common ones, overlap in *BSD and Linux, but what about the less common ones? Also, you say you have 1.9.5 working with only limited functionality... what are the other stumbling blocks (you mentioned LDTs)? Thanks. N |