mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-03 18:13:01 +00:00
Avoid having holes in the VgdbShared struct.
These holes are not initialized, and writing these uninitialised bytes to the mapped file causes an error being reported when running Valgrind inside Valgrind. Having no holes avoid having this error. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12397
This commit is contained in:
parent
e9f922b442
commit
564e685793
@ -224,10 +224,11 @@ void remote_open (char *name)
|
||||
const HChar *user, *host;
|
||||
int save_fcntl_flags, len;
|
||||
VgdbShared vgdbinit =
|
||||
{0, 0, 0, (Addr) VG_(invoke_gdbserver),
|
||||
{0, 0, (Addr) VG_(invoke_gdbserver),
|
||||
(Addr) VG_(threads), sizeof(ThreadState),
|
||||
offsetof(ThreadState, status),
|
||||
offsetof(ThreadState, os_state) + offsetof(ThreadOSstate, lwpid)};
|
||||
offsetof(ThreadState, os_state) + offsetof(ThreadOSstate, lwpid),
|
||||
0};
|
||||
const int pid = VG_(getpid)();
|
||||
const int name_default = strcmp(name, VG_(vgdb_prefix_default)()) == 0;
|
||||
Addr addr_shared;
|
||||
|
||||
@ -143,10 +143,6 @@ extern void VG_(gdbserver_status_output)(void);
|
||||
|
||||
typedef
|
||||
struct {
|
||||
// PID of the vgdb that last connected to the Valgrind gdbserver.
|
||||
// It will be set by vgdb after connecting.
|
||||
int vgdb_pid;
|
||||
|
||||
// nr of bytes vgdb has written to valgrind
|
||||
volatile int written_by_vgdb;
|
||||
// nr of bytes seen by valgrind
|
||||
@ -161,13 +157,15 @@ typedef
|
||||
int sizeof_ThreadState;
|
||||
int offset_status;
|
||||
int offset_lwpid;
|
||||
|
||||
// PID of the vgdb that last connected to the Valgrind gdbserver.
|
||||
// It will be set by vgdb after connecting.
|
||||
int vgdb_pid;
|
||||
} VgdbShared32;
|
||||
|
||||
/* Same as VgdbShared32 but for 64 bits arch. */
|
||||
typedef
|
||||
struct {
|
||||
int vgdb_pid;
|
||||
|
||||
volatile int written_by_vgdb;
|
||||
volatile int seen_by_valgrind;
|
||||
|
||||
@ -177,6 +175,8 @@ typedef
|
||||
int sizeof_ThreadState;
|
||||
int offset_status;
|
||||
int offset_lwpid;
|
||||
|
||||
int vgdb_pid;
|
||||
} VgdbShared64;
|
||||
|
||||
// The below typedef makes the life of valgrind easier.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user