core local memory support for core files

Message ID 116F7B9E-DA01-4A71-8CCC-6EB3A4BCF246@comcast.net
State New, archived
Headers

Commit Message

Mike Stump Oct. 7, 2016, 1:49 a.m. UTC
  This patch adds core local memory for core files.

It follows the /%d convention that is used by .reg for multi-core support.  Personally, I'm using .sdata/%d, but, since we only look for /%d, one is free to use .data/%d, .sdata/%d and so on.

Ok?

If people like it, can someone apply it for me, my gdb tree is just read-only.

$  mach-objdump -a -x /tmp/dump 

/tmp/dump:     file format mach-core
/tmp/dump
architecture: mach, flags 0x00000000:

start address 0x0000000000000000

Sections:
Idx Name          Size      VMA               LMA               File off  Algn
  0 .reg/25449    0
                  CONTENTS
  1 .sdata/25449  0
                  CONTENTS, ALLOC, LOAD
  2 .reg/485223   0
                  CONTENTS
  3 .sdata/485223 0
                  CONTENTS, ALLOC, LOAD
SYMBOL TABLE:
no symbols




2016-10-06  Mike Stump  <mikestump@comcast.net>

	* exec.c (section_table_xfer_memory_partial): Add core local memory.
  

Patch

diff --git a/gdb/exec.c b/gdb/exec.c
index d858e99..42e02f3 100644
--- a/gdb/exec.c
+++ b/gdb/exec.c
@@ -848,6 +848,10 @@  section_table_xfer_memory_partial (gdb_byte *readbuf, const gdb_byte *writebuf,
 
       if (section_name && strcmp (section_name, asect->name) != 0)
 	continue;		/* not the section we need.  */
+      if (strchr (asect->name, '/')
+	  && atoi (strchr (asect->name, '/') + 1) != inferior_ptid.lwp)
+	/* These aren't the driods you're looking for.... */
+	continue;
       if (memaddr >= p->addr)
         {
 	  if (memend <= p->endaddr)