gdb-971126 shared libraries is different -n linux

Marty Leisner leisner@sdsp.mc.xerox.com
Wed Dec 17 08:53:00 GMT 1997


gdb-971126 is working differently with shared libraries on linux than
gdbtk-970507.

Is there a better way to set a breakpoint in a shared library than:
	breaking at main
	setting breakpoints in shared library
	continuing

I never have been able to get the share command to do anything useful...
Is there a way to preload shared libaries?

I'm  debugging ld from gas-971213 on linux/libc1.

link-data contains:
	set args -m aixppc --noinhibit-exec  -Ttext 0x20003868 -Tdata 0x200038b0 -Tbss 0x200038d0 -N -o foo.so data.o --cref --entry=.foobar
	break main
	r
	#break _bfd_relocate_contents
	break xcofflink.c:6623
	c
For gdb971126, we can't run the second time:
: leisner@dw;gdb $(type -p ld)
GNU gdb 971126
Copyright 1997 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnulibc1"...
(gdb) source link-data
Breakpoint 1 at 0x80563eb: file ../../ld/ldmain.c, line 163.

Breakpoint 1, main (argc=16, argv=0xbfffeb90) at ../../ld/ldmain.c:163
163       long start_time = get_run_time ();
Breakpoint 2 at 0x40081f31: file ../../bfd/xcofflink.c, line 6623.

Breakpoint 2, _bfd_ppc_xcoff_relocate_section (output_bfd=0x8082450, 
    info=0x807d6c4, input_bfd=0x808d3f0, input_section=0x808eb70, 
    contents=0x809b078 "\223áÿü\224!ÿà|?\013x\201\"8µ\200i", relocs=0x808f790, 
    syms=0x809ab20, sections=0x808eaa4) at ../../bfd/xcofflink.c:6623
6623                if (! ((*info->callbacks->reloc_overflow)
(gdb) c
Continuing.
data.o: In function `foobar':
data.c:6: relocation truncated to fit: 0x03 an_int

Cross Reference Table

Symbol                                            File
foobar                                            data.o
foobar                                            data.o

Program exited normally.
(gdb) r
Starting program: /usr/gnu/binutils-debug/bin/ld -m aixppc --noinhibit-exec  -Ttext 0x20003868 -Tdata 0x200038b0 -Tbss 0x200038d0 -N -o foo.so data.o --cref --entry=.foobar
Cannot insert breakpoint 2:
Cannot access memory at address 0x40081f31.
(gdb) quit


For gdb 970507:
: leisner@dw;gdbtk -nw $(type -p ld)
GNU gdb 970507
Copyright 1997 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i586-pc-linux-gnu"...
(gdb) source link-data
Breakpoint 1 at 0x80563eb: file ../../ld/ldmain.c, line 163.

Breakpoint 1, main (argc=16, argv=0xbfffeb80) at ../../ld/ldmain.c:163
163       long start_time = get_run_time ();
Breakpoint 2 at 0x40081f31: file ../../bfd/xcofflink.c, line 6623.

Breakpoint 2, _bfd_ppc_xcoff_relocate_section (output_bfd=0x8082450, 
    info=0x807d6c4, input_bfd=0x808d3f0, input_section=0x808eb70, 
    contents=0x809b078 "\223áÿü\224!ÿà|?\013x\201\"8µ\200i", relocs=0x808f790, 
    syms=0x809ab20, sections=0x808eaa4) at ../../bfd/xcofflink.c:6623
6623                if (! ((*info->callbacks->reloc_overflow)
(gdb) c
Continuing.
data.o: In function `foobar':
data.c:6: relocation truncated to fit: 0x03 an_int

Cross Reference Table

Symbol                                            File
foobar                                            data.o
foobar                                            data.o

Program exited normally.
(gdb) r
Starting program: /usr/gnu/binutils-debug/bin/ld -m aixppc --noinhibit-exec  -Ttext 0x20003868 -Tdata 0x200038b0 -Tbss 0x200038d0 -N -o foo.so data.o --cref --entry=.foobar
Cannot insert breakpoint 2:
Temporarily disabling shared library breakpoints:
2 

Breakpoint 1, main (argc=16, argv=0xbfffeb80) at ../../ld/ldmain.c:163
163       long start_time = get_run_time ();
(gdb) c
Continuing.

Breakpoint 2, _bfd_ppc_xcoff_relocate_section (output_bfd=0x8082450, 
    info=0x807d6c4, input_bfd=0x808d3f0, input_section=0x808eb70, 
    contents=0x809b078 "\223áÿü\224!ÿà|?\013x\201\"8µ\200i", relocs=0x808f790, 
    syms=0x809ab20, sections=0x808eaa4) at ../../bfd/xcofflink.c:6623
6623                if (! ((*info->callbacks->reloc_overflow)
(gdb) quit





marty		leisner@sdsp.mc.xerox.com   
Don't  confuse education with schooling.
	Milton Friedman to Yogi Berra



More information about the Gdb mailing list