This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Are ppc*_elf_write_core_note Os-specific?


I was recently testing 'gcore' of a threaded program under gdb on FreeBSD
and received warnings about a mismatched ".reg" section for each LWP when
gdb examined the generated core file.  After some debugging I determined
that gcore in gdb is generating a different-sized NT_PRSTATUS note for
each thread due to calling ppc64_elf_write_core() instead of using the
default logic for NT_PRSTATUS of dumping the platform's prstatus_t type.

The code for ppc64_elf_write_core_note() seems to be OS-specific (for
Linux?).  It assumes that the gregs passed in are a specific size via magic
numbers passed to memcpy(), etc.  On FreeBSD this means the memcpy() is
actually a buffer overrun though gdb ignores whatever garbage is copied out
to the core when it is later read.

For FreeBSD (and possibly other systems), I think it would be ideal if
ppc*_elf_write_core_note were not defined if the current versions are
indeed OS specific.

-- 
John Baldwin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]