Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michal Ludvig <mludvig@suse.cz>
To: Daniel Jacobowitz <drow@mvista.com>
Cc: GDB Patches <gdb-patches@sources.redhat.com>
Subject: [RFA] gdbserver bits
Date: Thu, 18 Jul 2002 08:08:00 -0000	[thread overview]
Message-ID: <3D36D7E7.5080607@suse.cz> (raw)

[-- Attachment #1: Type: text/plain, Size: 344 bytes --]

Hi,
fifth patch today ;-)
This one adds CS and SS registers to regmap on x86-64 so that they are 
stored and properly restored.
Also it adds a forgotten free() to prevent memory leakage in 
regsets_store_inferior_registers().

Can I commit it?

Michal Ludvig
-- 
* SuSE CR, s.r.o     * mludvig@suse.cz
* +420 2 9654 5373   * http://www.suse.cz

[-- Attachment #2: gdbserver-cs-2.diff --]
[-- Type: text/plain, Size: 1559 bytes --]

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.

Index: linux-low.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/linux-low.c,v
retrieving revision 1.17
diff -u -p -r1.17 linux-low.c
--- linux-low.c	11 Jun 2002 17:32:39 -0000	1.17
+++ linux-low.c	18 Jul 2002 14:46:53 -0000
@@ -1097,6 +1097,7 @@ regsets_store_inferior_registers ()
 	    }
 	}
       regset ++;
+      free (buf);
     }
   return 0;
 }
Index: linux-x86-64-low.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/linux-x86-64-low.c,v
retrieving revision 1.6
diff -u -p -r1.6 linux-x86-64-low.c
--- linux-x86-64-low.c	4 Jul 2002 06:00:49 -0000	1.6
+++ linux-x86-64-low.c	18 Jul 2002 14:46:53 -0000
@@ -28,16 +28,16 @@
 #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)

             reply	other threads:[~2002-07-18 15:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-18  8:08 Michal Ludvig [this message]
2002-07-18  8:33 ` Daniel Jacobowitz
2002-07-18  8:35   ` Michal Ludvig
2002-07-18  9:24     ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3D36D7E7.5080607@suse.cz \
    --to=mludvig@suse.cz \
    --cc=drow@mvista.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox