This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: Why does mips define elf_backend_sign_extend_vma to true?
On Wed, Aug 08, 2001 at 10:50:41AM -0400, Andrew Cagney wrote:
>
> There is an old saying K.I.S.S.
>
> GDB was, not so recently changed to apply the rule that the MIPS target,
> always, no matter what, sign extens 32 bit addresses.
>
> It had the pleasant side effect of fixing numerous bugs and flushing out
> too much bogus code. What your proposing is a step back into the dark
> ages of MIPS programming.
Please try
1. Find a decent compiler for Linux/mips.
2. Check out the Linux mips kernel from oss.sgi.com.
3. Compile the kernel with -g.
4. Compile Linux/mips gdb with 64bit BFD.
5. Do
# mipsel-linux-gdb vmlinux
...
(gdb) list printk
Then tell me why it looks ok to you. Mine looks like
(gdb) p printk
$1 = {int (char *)} 0x8011c530
(gdb) list printk
1874
1875 static void __exit packet_exit(void)
1876 {
1877 remove_proc_entry("net/packet", 0);
1878 unregister_netdevice_notifier(&packet_netdev_notifier);
1879 sock_unregister(PF_PACKET);
1880 return;
1881 }
1882
1883 static int __init packet_init(void)
The problem is the 64bit BFD does the sign extension to the section
addresses which have the bit 31 set. Gdb cannot find 0x8011c530 in
those ranges. You may say oh, let's fix gdb to do
(gdb) p printk
$1 = {int (char *)} 0xffffffff8011c530
I don't think it will be useful to me. I don't think I can set a break
pount at 0xffffffff8011c530. The sign extension here is only the
artifact of the 64bit BFD. My mips target is 32bit.
H.J.