This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: dwarf2-frame.c question for maintainers
- From: "Martin M. Hunt" <hunt at redhat dot com>
- To: Andrew Cagney <cagney at gnu dot org>
- Cc: gdb at sources dot redhat dot com
- Date: Wed, 14 Jul 2004 10:47:46 -0700
- Subject: Re: dwarf2-frame.c question for maintainers
- Organization: Red Hat Inc.
- References: <1089749730.3026.18.camel@dragon> <40F56CCA.5080106@gnu.org>
On Wed, 2004-07-14 at 10:26, Andrew Cagney wrote:
> > I'm working on some dwarf2 fixes with kevinb. In
> > dwarf2_build_frame_info(), Kevin added
> > +unit.signed_addr_p = bfd_get_sign_extend_vma (unit.abfd);
> >
> > This is useful for fixing several bugs where addresses needed to be
> > sign-extended. However, I found that read_reg() also needs to
> > sign-extend its result. Passing a pointer to the CU all the way down to
> > read_reg doesn't seem practical.
> >
> > I don't have any understanding of the overall structure of this code or
> > where it is going. I can see several possibilities, including the
> > obvious one; using a global. So how do I solve this to get the patch
> > accepted?
>
> (The global is out :-)
>
> How come extract_typed_address, in read_reg, doesn't sign extend?
I should have explained that. It does. However extract_typed_address is
incorrect because it makes the invalid assumption that sizeof(address)
== sizeof(register). So that has to go and be replaced with something
like
extract_signed_integer (buf, register_size (current_gdbarch, regnum));
> The MIPS (I'm assuming this is for the MIPS) has the dogma that _all_
> addresses (a.k.a. CORE_ADDRs) are _always_ sign extended. If you see a
> non sign-extended address in the wild, try tracing it back to where it
> was created.
>
> Andrew
--
Martin M. Hunt <hunt@redhat.com>
Red Hat Inc.