diff options
author | Michal Ludvig <mludvig@suse.cz> | 2002-07-18 15:18:02 +0000 |
---|---|---|
committer | Michal Ludvig <mludvig@suse.cz> | 2002-07-18 15:18:02 +0000 |
commit | 09ec9b38d64692a0dafd73936365f15a8d4ab383 (patch) | |
tree | d100808e25f8ca3a78fce25c61997022bbec726e | |
parent | 4894ac5dcfd7c4e1f7bb594c6883480d448077f9 (diff) | |
download | gdb-09ec9b38d64692a0dafd73936365f15a8d4ab383.zip gdb-09ec9b38d64692a0dafd73936365f15a8d4ab383.tar.gz gdb-09ec9b38d64692a0dafd73936365f15a8d4ab383.tar.bz2 |
2002-07-18 Michal Ludvig <mludvig@suse.cz>
* linux-low.c (regsets_store_inferior_registers): Add free()
at the end of a loop to prevent memory leak.
* linux-x86-64-low.c (x86_64_regmap): Add CS, SS registers.
(X86_64_NUM_GREGS): Count it from the size of x86_64_regmap.
-rw-r--r-- | gdb/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/gdbserver/linux-low.c | 1 | ||||
-rw-r--r-- | gdb/gdbserver/linux-x86-64-low.c | 8 |
3 files changed, 9 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index befe4f1..17aea0f 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,9 @@ 2002-07-18 Michal Ludvig <mludvig@suse.cz> + * linux-low.c (regsets_store_inferior_registers): Add free() + at the end of a loop to prevent memory leak. + * linux-x86-64-low.c (x86_64_regmap): Add CS, SS registers. + (X86_64_NUM_GREGS): Count it from the size of x86_64_regmap. * config/sparc/tm-sp64linux.h: Make the rest of #endif line a comment. * Makefile.in (x86-64-linux-nat.o): Remove dependency on i387-tdep.h diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c index c272fed..7048daf 100644 --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c @@ -1097,6 +1097,7 @@ regsets_store_inferior_registers () } } regset ++; + free (buf); } return 0; } diff --git a/gdb/gdbserver/linux-x86-64-low.c b/gdb/gdbserver/linux-x86-64-low.c index b03dcfa..4ee1ae4 100644 --- a/gdb/gdbserver/linux-x86-64-low.c +++ b/gdb/gdbserver/linux-x86-64-low.c @@ -28,17 +28,17 @@ #include <sys/procfs.h> #include <sys/ptrace.h> -#define X86_64_NUM_GREGS 22 - -static int x86_64_regmap[X86_64_NUM_GREGS] = { +static int x86_64_regmap[] = { RAX * 8, RBX * 8, RCX * 8, RDX * 8, RSI * 8, RDI * 8, RBP * 8, RSP * 8, R8 * 8, R9 * 8, R10 * 8, R11 * 8, R12 * 8, R13 * 8, R14 * 8, R15 * 8, - RIP * 8, EFLAGS * 8, + RIP * 8, EFLAGS * 8, CS * 8, SS * 8, DS * 8, ES * 8, FS * 8, GS * 8 }; +#define X86_64_NUM_GREGS (sizeof(x86_64_regmap)/sizeof(int)) + static void x86_64_fill_gregset (void *buf) { |