Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Regression on prelinked-sepdebug-shlibs
@ 2009-12-25 20:05 Jan Kratochvil
  2010-01-04  9:50 ` Tristan Gingold
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Jan Kratochvil @ 2009-12-25 20:05 UTC (permalink / raw)
  To: Tristan Gingold; +Cc: gdb-patches

Hi,

Re: [RFA] Make sym_read routines handle separate debug files
http://sourceware.org/ml/gdb-patches/2009-12/msg00117.html
http://sourceware.org/ml/gdb-cvs/2009-12/msg00042.html
ffb64a120e667bad7b2a79c5e617bdea7328f996
	* symfile.h (symbol_file_add_separate): New prototype.
	(find_separate_debug_file_by_buildid): Ditto.
	(find_separate_debug_file_by_debuglink): Ditto.
	* symfile.c (reread_separate_symbols): Remove.
	(find_separate_debug_file): Split into ...
	(find_separate_debug_file_by_buildid): ... this and ...
	(find_separate_debug_file_by_debuglink): ... this.
	(symbol_file_add_with_addrs_or_offsets): Do not save orig_addrs.
	Remove separate debug file handling.
	(symbol_file_add_separate): New function.
	(reread_symbols): Do not considere separate debug files, but free
	them while handling their parent.  Reindent.
	* coffread.c (coff_symfile_read): Handle separate object file.
	* elfread.c (elf_symfile_read): Ditto.

has caused a regression:
	echo 'void f (void) {}'|gcc -Wall -fPIC -shared -g -o a.so -x c -;objcopy --only-keep-debug a.so a.so.debug;objcopy --strip-debug --add-gnu-debuglink=a.so.debug a.so;prelink -NR a.so;echo 'extern void f (void);int main (void) { f (); return 0; }'|gcc -Wall -g -o a ./a.so -x c -;./gdb -nx -ex start -ex 'adv f' ./a
printing now:
	Cannot access memory at address 0x52c

prelink will set in-file addresses to some random value while in the .debug
file they remain zero-based.  In such case "section_offsets" below will remain
zero because the library will (probably) get loaded at the same address as the
file is prelinked at.  Still the .debug file must be relocated in such case.


symbol_file_add_separate calls there now:
	0, /* No addr table.  */
while it supplies:
	objfile->section_offsets, objfile->num_sections,

This cannot work as the binary file and its separate debug info file are two
different objfiles having different number and ordering of sections.
objfile-independent displacement format is that "addr table".

There was some description of these data structures in:
	[patch 05/15] PIE: Move some symfile code into subroutines
	http://sourceware.org/ml/gdb-patches/2009-11/msg00172.html
	[patch 06/15] PIE: Fix displacement of separate debug info files
	http://sourceware.org/ml/gdb-patches/2009-11/msg00173.html

(I see a big conflict now there for my unchecked-in PIE patch, oops.)

One should probably build temporary addr-table from objfile there.

I did not provide the testcase above as a GDB testcase as it is exactly one
case of the more general "break-interp.exp" test supporting shlibs by:
	[patch 10/15] PIE: testcase: Test also shared libraries
	http://sourceware.org/ml/gdb-patches/2009-11/msg00177.html


Regards,
Jan


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2010-01-07 14:37 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-25 20:05 Regression on prelinked-sepdebug-shlibs Jan Kratochvil
2010-01-04  9:50 ` Tristan Gingold
2010-01-04 10:24   ` Jan Kratochvil
2010-01-04 11:54     ` Tristan Gingold
2010-01-04 15:22 ` Tristan Gingold
2010-01-04 18:10   ` Jan Kratochvil
2010-01-05 11:02     ` Tristan Gingold
2010-01-05 16:15       ` Jan Kratochvil
2010-01-06 11:20         ` Tristan Gingold
2010-01-06 16:38 ` Tristan Gingold
2010-01-06 18:05   ` Jan Kratochvil
2010-01-06 19:16     ` Daniel Jacobowitz
2010-01-07 11:02       ` Tristan Gingold
2010-01-07 11:10         ` Jan Kratochvil
2010-01-07 11:18           ` Tristan Gingold
2010-01-07 13:42         ` Daniel Jacobowitz
2010-01-07 14:21           ` Tristan Gingold
2010-01-07 14:26             ` Daniel Jacobowitz
2010-01-07 14:37               ` Tristan Gingold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox