Re: [RFC] DW_CFA_restore handling causes memory fault

Frederic RISS
2005-11-18T15:08:35Z

On Fri, 2005-11-18 at 14:45 +0100, Mark Kettenis wrote:
> > X-From_: gdb-patches-return-41536-m.m.kettenis=alumnus.utwente.nl@sourceware.org Fri Nov 18 13:38:27 2005
> > From: Frederic RISS <frederic.riss@st.com>
> > Date: Fri, 18 Nov 2005 13:33:03 +0100
> >
> > On Fri, 2005-11-18 at 00:35 -0800, Jim Blandy wrote:
> > > Yes! But --- I apologize for not noticing this from the beginning ---
> > > as I see your comment, it occurs to me that probably a call to
> > > 'complaint' would be better than just a comment. Mark or Daniel can
> > > string me up if they feel this will yield another 'incomplete CFI
> > > data; unspecified blah blah blah' annoyance, but I think it's probably
> > > the right thing.
>
> On the highest tree! Seriously though, if it turns out to be a major
> annoyance, we can always do something about it later. So this is fine
> to me ;-).

Anyway, complaints are turned off by default, so I don't see how that
could be a major annoyance to the lambda user.

> > OK, third try attached. I mimiced the formatting of other complaints of
> > the file. I didn't put the complaint in the 'else' clause, but added a
> > check after the whole 'if', because an allocated register state isn't
> > necessarily set to a correct value.
>
> That could possibly lead to two complaints about the same
> "unspecified" register, but let's see what happens with this patch.

Yes, the patch will produce a complaint in the DW_CFA_restore handling;
and as a consequence of having an UNSPECIFIED register, the complaint in
dwarf2_frame_cache will also trigger.

> > Just a question: why are the i18n'ified strings formatted this way ?
>
> Formatted in what way? Starting in column 0? Well, that's because
> it's easier to see whether the string will be longer than 80
> characters, which your string will be once the %s is filled in.

Thanks for the explanation.

> So
> could you split the string over two lines? You're going to have to do
> that anyway, because I'm going to ask you to make a little change: can
> you also print the register number for the register that the complaint
> is about?

Initialy, I didn't put the register number because I felt there was an
issue with the line going over 80 chars :-) Didn't think about the %s
expansion, though... So what do you prefer to describe the register :
its dwarf number, its gdb regnum or its name ?

Cheers,
Fred.