* Elf debugging
@ 2009-06-01 12:24 maybedoo
2009-06-01 19:37 ` Michael Snyder
0 siblings, 1 reply; 8+ messages in thread
From: maybedoo @ 2009-06-01 12:24 UTC (permalink / raw)
To: gdb
Hi,
I want to debug an elf binary. Compiling with the debugging symbols works
fine, but when I'm connected with gdb, after loading it, it can't find my
source files. I've set the path to the src with "directory" but the same.
How can I find out what files are loaded and how can I load my file I need
for a breakpoint?
Regards,
May
--
View this message in context: http://www.nabble.com/Elf-debugging-tp23814190p23814190.html
Sent from the Sourceware - gdb list mailing list archive at Nabble.com.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Elf debugging
2009-06-01 12:24 Elf debugging maybedoo
@ 2009-06-01 19:37 ` Michael Snyder
2009-06-02 17:15 ` maybedoo
0 siblings, 1 reply; 8+ messages in thread
From: Michael Snyder @ 2009-06-01 19:37 UTC (permalink / raw)
To: maybedoo; +Cc: gdb
maybedoo wrote:
> Hi,
>
> I want to debug an elf binary. Compiling with the debugging symbols works
> fine, but when I'm connected with gdb, after loading it, it can't find my
> source files. I've set the path to the src with "directory" but the same.
> How can I find out what files are loaded and how can I load my file I need
> for a breakpoint?
It should work. What compiler are you using?
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Elf debugging
2009-06-01 19:37 ` Michael Snyder
@ 2009-06-02 17:15 ` maybedoo
2009-06-02 19:23 ` Paul Pluzhnikov
0 siblings, 1 reply; 8+ messages in thread
From: maybedoo @ 2009-06-02 17:15 UTC (permalink / raw)
To: gdb
I'm using GCC 4, that's why I'm wondering that it isn't working.
Michael Snyder-6 wrote:
>
> maybedoo wrote:
>> Hi,
>>
>> I want to debug an elf binary. Compiling with the debugging symbols works
>> fine, but when I'm connected with gdb, after loading it, it can't find my
>> source files. I've set the path to the src with "directory" but the same.
>> How can I find out what files are loaded and how can I load my file I
>> need
>> for a breakpoint?
>
> It should work. What compiler are you using?
>
>
>
>
--
View this message in context: http://www.nabble.com/Elf-debugging-tp23814190p23836680.html
Sent from the Sourceware - gdb list mailing list archive at Nabble.com.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Elf debugging
2009-06-02 17:15 ` maybedoo
@ 2009-06-02 19:23 ` Paul Pluzhnikov
2009-06-03 11:31 ` maybedoo
0 siblings, 1 reply; 8+ messages in thread
From: Paul Pluzhnikov @ 2009-06-02 19:23 UTC (permalink / raw)
To: maybedoo; +Cc: gdb
On Tue, Jun 2, 2009 at 10:15 AM, maybedoo <maybedoo@gmx.de> wrote:
>
> I'm using GCC 4, that's why I'm wondering that it isn't working.
You have supplied so little relevant info, it's a wonder anyone responded
to you at all.
What are your host and target? What does 'gcc --version' say?
What command line did you use to compile and link your executable?
What does 'readelf -w exename' say?
What commands did you execute to debug it?
What version of GDB did use? How was that GDB built?
Please provide log of your entire GDB interaction, and someone may be able
to help you.
Cheers,
--
Paul Pluzhnikov
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Elf debugging
2009-06-02 19:23 ` Paul Pluzhnikov
@ 2009-06-03 11:31 ` maybedoo
2009-06-03 22:07 ` Paul Pluzhnikov
0 siblings, 1 reply; 8+ messages in thread
From: maybedoo @ 2009-06-03 11:31 UTC (permalink / raw)
To: gdb
Hi, I'm sorry this is the first time I'm posting here.
Host is a Linux Debian Lenny System and target also the same machine.
- gcc version: gcc (Debian 4.3.2-1.1) 4.3.2
- gdb version: GNU gdb 6.8-debian
The gdb is the preinstalled on the system.
To compile the elf I've used make with the following command:
makedefine CFLAGS := $(CPU_OPT) $(DISTRO_CFLAGS) $(CPPFLAGS) -O2 -g
-nostdinc -nostdlib -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs
-Werror-implicit-function-declaration -Wstrict-aliasing -Wshadow -fno-common
-ffreestanding -fno-builtin -fomit-frame-pointer
Here is the log how I connected to the elf:
(gdb) file
/home/sphinx/coreboot/coreboot-v2/targets/emulation/qemu-x86/qemu-x86/normal/coreboot_ram
Reading symbols from
/home/sphinx/coreboot/coreboot-v2/targets/emulation/qemu-x86/qemu-x86/normal/coreboot_ram...done.
(gdb) target remote localhost:1234
Remote debugging using localhost:1234
0x0000fff0 in pci_conf1_read_config32 (pbus=0x0, bus=0, devfn=0, where=0)
at /home/sphinx/coreboot/coreboot-v2/src/arch/i386/include/arch/io.h:58
58 __asm__ __volatile__ ("outl %0, %w1" : : "a" (value), "Nd"
(port));
(gdb) search elfboot
Expression not found
(gdb) break elfboot.c:20
No source file named elfboot.c.
Make breakpoint pending on future shared library load? (y or [n]) n
I've attached the readelf log, hopefully it says something to you.
Thanks for your help Paul.
Regards,
May
http://www.nabble.com/file/p23849811/readelf.txt readelf.txt
--
View this message in context: http://www.nabble.com/Elf-debugging-tp23814190p23849811.html
Sent from the Sourceware - gdb list mailing list archive at Nabble.com.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Elf debugging
2009-06-03 11:31 ` maybedoo
@ 2009-06-03 22:07 ` Paul Pluzhnikov
2009-06-04 13:42 ` maybedoo
0 siblings, 1 reply; 8+ messages in thread
From: Paul Pluzhnikov @ 2009-06-03 22:07 UTC (permalink / raw)
To: maybedoo; +Cc: gdb
On Wed, Jun 3, 2009 at 4:31 AM, maybedoo <maybedoo@gmx.de> wrote:
> (gdb) break elfboot.c:20
> No source file named elfboot.c.
Are you sure this isn't a "pilot error"?
I see that you have selfboot.c, but no elfboot.c.
Here are the files which have debug info (and which you shouldn't have
problems setting breakpoints in):
$ grep 'DW_AT_name.*\.c' readelf.txt | sed -e 's/.*: //' -e 's:.*//::'
src/southbridge/intel/i82371eb/i82371eb_smbus.c
src/console/uart8250_console.c
src/southbridge/intel/i82371eb/i82371eb.c
src/southbridge/intel/i82371eb/i82371eb_usb.c
src/southbridge/intel/i82371eb/i82371eb_reset.c
src/southbridge/intel/i82371eb/i82371eb_isa.c
src/southbridge/intel/i82371eb/i82371eb_ide.c
src/mainboard/emulation/qemu-x86/mainboard.c
src/arch/i386/lib/exception.c
src/devices/root_device.c
src/lib/uart8250.c
src/console/printk.c
src/pc80/mc146818rtc.c
src/boot/hardwaremain.c
src/devices/pci_device.c
src/lib/version.c
src/devices/cardbus_device.c
src/pc80/keyboard.c
src/devices/pciexp_device.c
src/devices/pci_ops.c
src/console/console.c
src/devices/hypertransport.c
src/devices/device.c
src/lib/malloc.c
src/devices/device_util.c
src/devices/../../util/x86emu/x86.c
src/pc80/isa-dma.c
src/lib/memmove.c
src/lib/memcpy.c
src/lib/memset.c
src/console/vtxprintf.c
static.c
src/arch/i386/boot/tables.c
src/boot/selfboot.c
src/devices/pci_rom.c
src/arch/i386/boot/coreboot_table.c
src/devices/pcix_device.c
src/cpu/emulation/qemu-x86/northbridge.c
src/mainboard/emulation/qemu-x86/irq_tables.c
src/devices/../../util/x86emu/x86_interrupts.c
src/arch/i386/boot/boot.c
src/lib/delay.c
src/arch/i386/lib/pci_ops_auto.c
src/console/vsprintf.c
src/arch/i386/lib/pci_ops_conf2.c
src/lib/cbfs.c
option_table.c
src/lib/compute_ip_checksum.c
src/lib/fallback_boot.c
src/arch/i386/boot/pirq_routing.c
src/arch/i386/boot/multiboot.c
src/lib/lzma.c
src/arch/i386/lib/pci_ops_conf1.c
Cheers,
--
Paul Pluzhnikov
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Elf debugging
2009-06-03 22:07 ` Paul Pluzhnikov
@ 2009-06-04 13:42 ` maybedoo
2009-06-04 14:12 ` maybedoo
0 siblings, 1 reply; 8+ messages in thread
From: maybedoo @ 2009-06-04 13:42 UTC (permalink / raw)
To: gdb
Hmm it's strange that i've no debug information in elfboot.c?
Here is the ls from the src directory:
may@debian:~/coreboot/coreboot-v2/src/boot$ ls
Config.lb elfboot.c filo.c hardwaremain.c selfboot.c
Problem is that I need elfboot.c for a breakpoint.
Thanks for your help Paul with readelf. Didn't know that and how to use it.
Regards,
May
Paul Pluzhnikov-4 wrote:
>
> On Wed, Jun 3, 2009 at 4:31 AM, maybedoo <maybedoo@gmx.de> wrote:
>
>> (gdb) break elfboot.c:20
>> No source file named elfboot.c.
>
> Are you sure this isn't a "pilot error"?
> I see that you have selfboot.c, but no elfboot.c.
>
> Here are the files which have debug info (and which you shouldn't have
> problems setting breakpoints in):
>
> $ grep 'DW_AT_name.*\.c' readelf.txt | sed -e 's/.*: //' -e 's:.*//::'
>
> src/southbridge/intel/i82371eb/i82371eb_smbus.c
> src/console/uart8250_console.c
> src/southbridge/intel/i82371eb/i82371eb.c
> src/southbridge/intel/i82371eb/i82371eb_usb.c
> src/southbridge/intel/i82371eb/i82371eb_reset.c
> src/southbridge/intel/i82371eb/i82371eb_isa.c
> src/southbridge/intel/i82371eb/i82371eb_ide.c
> src/mainboard/emulation/qemu-x86/mainboard.c
> src/arch/i386/lib/exception.c
> src/devices/root_device.c
> src/lib/uart8250.c
> src/console/printk.c
> src/pc80/mc146818rtc.c
> src/boot/hardwaremain.c
> src/devices/pci_device.c
> src/lib/version.c
> src/devices/cardbus_device.c
> src/pc80/keyboard.c
> src/devices/pciexp_device.c
> src/devices/pci_ops.c
> src/console/console.c
> src/devices/hypertransport.c
> src/devices/device.c
> src/lib/malloc.c
> src/devices/device_util.c
> src/devices/../../util/x86emu/x86.c
> src/pc80/isa-dma.c
> src/lib/memmove.c
> src/lib/memcpy.c
> src/lib/memset.c
> src/console/vtxprintf.c
> static.c
> src/arch/i386/boot/tables.c
> src/boot/selfboot.c
> src/devices/pci_rom.c
> src/arch/i386/boot/coreboot_table.c
> src/devices/pcix_device.c
> src/cpu/emulation/qemu-x86/northbridge.c
> src/mainboard/emulation/qemu-x86/irq_tables.c
> src/devices/../../util/x86emu/x86_interrupts.c
> src/arch/i386/boot/boot.c
> src/lib/delay.c
> src/arch/i386/lib/pci_ops_auto.c
> src/console/vsprintf.c
> src/arch/i386/lib/pci_ops_conf2.c
> src/lib/cbfs.c
> option_table.c
> src/lib/compute_ip_checksum.c
> src/lib/fallback_boot.c
> src/arch/i386/boot/pirq_routing.c
> src/arch/i386/boot/multiboot.c
> src/lib/lzma.c
> src/arch/i386/lib/pci_ops_conf1.c
>
> Cheers,
> --
> Paul Pluzhnikov
>
>
--
View this message in context: http://www.nabble.com/Elf-debugging-tp23814190p23870188.html
Sent from the Sourceware - gdb list mailing list archive at Nabble.com.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Elf debugging
2009-06-04 13:42 ` maybedoo
@ 2009-06-04 14:12 ` maybedoo
0 siblings, 0 replies; 8+ messages in thread
From: maybedoo @ 2009-06-04 14:12 UTC (permalink / raw)
To: gdb
OK I found it. It was a pilot error :(. In the config file is a construction
whether the CB File System should be loaded or not. If yes selfboot.c is
needed, else elfboot.c
Thanks again for all your help and time you spent Paul.
--
View this message in context: http://www.nabble.com/Elf-debugging-tp23814190p23870777.html
Sent from the Sourceware - gdb list mailing list archive at Nabble.com.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2009-06-04 14:12 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-01 12:24 Elf debugging maybedoo
2009-06-01 19:37 ` Michael Snyder
2009-06-02 17:15 ` maybedoo
2009-06-02 19:23 ` Paul Pluzhnikov
2009-06-03 11:31 ` maybedoo
2009-06-03 22:07 ` Paul Pluzhnikov
2009-06-04 13:42 ` maybedoo
2009-06-04 14:12 ` maybedoo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox