Re: add-symbol-file question

Michael Snyder
2007-11-20T12:19:51Z

On Mon, 2007-11-19 at 16:50 -0800, vb wrote:
> Greetings,
>
> I am trying to debug very early stages of bringing up a ppc82xx
> kernel. (it's not relevant. but just in case: I'm using a bdi2000)
>
> For some reason gdb fails to read the symbol table such that the text
> segment is placed at 0:
>
> vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
> (gdb) show version
> GNU gdb 6.5
> Copyright (C) 2006 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 "--host=i686-pc-linux-gnu
> --target=powerpc-8540-linux-gnu".
> (gdb) sym
> Discard symbol table? (y or n) y
> No symbol file now.
> (gdb) add-symbol-file ../build/linux-2.6-lb4-powerpc/vmlinux 0x40000000
> add symbol table from file "../build/linux-2.6-lb4-powerpc/vmlinux" at
> .text_addr = 0x40000000
> (y or n) y
> Reading symbols from
> /local/vb/projects/vanilla-wt/build/linux-2.6-lb4-powerpc/vmlinux...done.
> (gdb) p __start
> $7 = {<text variable, no debug info>} 0x4000000c <__start>
> (gdb) sym
> Discard symbol table? (y or n) y
> No symbol file now.
> (gdb) add-symbol-file ../build/linux-2.6-lb4-powerpc/vmlinux 0x00000000
> add symbol table from file "../build/linux-2.6-lb4-powerpc/vmlinux" at
> .text_addr = 0x0
> (y or n) y
> Reading symbols from
> /local/vb/projects/vanilla-wt/build/linux-2.6-lb4-powerpc/vmlinux...done.
> (gdb) p __start
> $8 = {<text variable, no debug info>} 0x8000000c <__start>
> (gdb)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
>
> I tried loading it at different offsets, anything else but 0 works
> just fine, anyone knows what's wrong?!

Interesting -- it appears to be setting the MSB.

Some sort of problem with sign bits, I expect...