From mboxrd@z Thu Jan 1 00:00:00 1970 From: "H . J . Lu" To: Andrew Cagney , "Maciej W. Rozycki" , Richard Henderson , David B Anderson , gdb@sourceware.cygnus.com, binutils@sourceware.cygnus.com Subject: Re: Why does mips define elf_backend_sign_extend_vma to true? Date: Wed, 08 Aug 2001 10:02:00 -0000 Message-id: <20010808100228.A29503@lucon.org> References: <20010807232102.A19636@lucon.org> <20010808072922.C26704@lucon.org> <3B7151C1.4030203@cygnus.com> <20010808080306.C26983@lucon.org> <3B71582D.4050003@cygnus.com> <20010808090249.A28467@lucon.org> <20010808095401.B23955@nevyn.them.org> X-SW-Source: 2001-08/msg00074.html On Wed, Aug 08, 2001 at 09:54:01AM -0700, Daniel Jacobowitz wrote: > On Wed, Aug 08, 2001 at 09:02:49AM -0700, H . J . Lu wrote: > > > > I am willing to buy it. The immediate problem is in > > > > struct obj_section * > > find_pc_sect_section (CORE_ADDR pc, struct sec *section) > > { > > struct obj_section *s; > > struct objfile *objfile; > > > > ALL_OBJSECTIONS (objfile, s) > > if ((section == 0 || section == s->the_bfd_section) && > > s->addr <= pc && pc < s->endaddr) > > return (s); > > > > return (NULL); > > } > > > > s->addr and s->endaddr came from BFD with sign extension. But `pc' is > > not, which has the bit 31 set. All of them have the type of CORE_ADDR. > > Any suggestions? I am not sure if it is the only problem in gdb. > > PC should be already be sign extended at this point... in my tests, it > is. The gdb I checked out from the 5.1 branch yesterday doesn't do it. BTW, what (gdb) print printk # gdb yourgdb ..... (top-gdb) print sizeof (CORE_ADDR) say? H.J. H.J.