Index: exec.c =================================================================== --- exec.c (revision 2200) +++ exec.c (working copy) @@ -579,6 +579,9 @@ section_table_xfer_memory_partial (gdb_b { if (section_name && strcmp (section_name, p->the_bfd_section->name) != 0) continue; /* not the section we need */ + /* core specific sections never satisfy, unless named. */ + if (section_name == NULL && strchr (p->the_bfd_section->name, '/')) + continue; if (memaddr >= p->addr) { if (memend <= p->endaddr) Index: corelow.c =================================================================== --- corelow.c (revision 2206) +++ corelow.c (working copy) @@ -627,14 +627,64 @@ core_xfer_partial (struct target_ops *op const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, LONGEST len) { + LONGEST r; switch (object) { case TARGET_OBJECT_MEMORY: - return section_table_xfer_memory_partial (readbuf, writebuf, - offset, len, - core_data->sections, - core_data->sections_end, - NULL); + r = section_table_xfer_memory_partial (readbuf, writebuf, + offset, len, + core_data->sections, + core_data->sections_end, + NULL); + if (r) + return r; + { + struct target_section *p; + ULONGEST memaddr = offset; + for (p = core_data->sections; p < core_data->sections_end; p++) + { + char *tid; + int thread_id; + ptid_t ptid; + + /* Weed out sections with addresses that don't include the + address we are looking for. */ + if (memaddr < p->addr) + continue; + if (memaddr > p->endaddr) + continue; + tid=strchr (p->the_bfd_section->name, '/'); + + /* Weed out sections that are not core specific. */ + if (tid == 0) + continue; + + /* Figure out the thread for the section, and see if that + thread is the current thread. */ + thread_id = atoi (tid+1); + + if (core_gdbarch + && gdbarch_core_reg_section_encodes_pid (core_gdbarch)) + { + uint32_t merged_pid = thread_id; + ptid = ptid_build (merged_pid & 0xffff, + merged_pid >> 16, 0); + } + else + ptid = ptid_build (ptid_get_pid (inferior_ptid), thread_id, 0); + + if (! ptid_equal (inferior_ptid, ptid)) + /* The current thread isn't the one encoded by the + section, skip it. */ + continue; + return section_table_xfer_memory_partial (readbuf, writebuf, + offset, len, + core_data->sections, + core_data->sections_end, + p->the_bfd_section->name); + } + } + return r; case TARGET_OBJECT_AUXV: if (readbuf)