OSDN Git Service

2002-07-18 Michal Ludvig <mludvig@suse.cz>
authormludvig <mludvig>
Thu, 18 Jul 2002 15:18:01 +0000 (15:18 +0000)
committermludvig <mludvig>
Thu, 18 Jul 2002 15:18:01 +0000 (15:18 +0000)
* 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.

gdb/ChangeLog
gdb/gdbserver/linux-low.c
gdb/gdbserver/linux-x86-64-low.c

index befe4f1..17aea0f 100644 (file)
@@ -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
index c272fed..7048daf 100644 (file)
@@ -1097,6 +1097,7 @@ regsets_store_inferior_registers ()
            }
        }
       regset ++;
+      free (buf);
     }
   return 0;
 }
index b03dcfa..4ee1ae4 100644 (file)
 #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)
 {