This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Identifying bottom-of-stack


> The problem is that a zero frame pointer is an insufficient condition
> to determine the bottom of the stack.  With code generated with
> -fno-frame-pointer, the register that was traditionally used for the
> frame pointer can be used for other purposes, and may very well
> contain zero.

Of course, but if there is no CFI then there is nothing better to do than
assume the frame pointer is a frame pointer and try to use it, no?

> There is.  On amd64 -fno-frame-pointer is the default.

I know that.

> So this effort of not generating CFI and clearing the framepointer is
> pointless.

Clearing the frame pointer is not pointless since the ABI document suggests
doing exactly that.  Avoiding generating CFI is not pointless since it is
better than generating CFI that is incorrect.

Anyway, I didn't ask if these things were pointless, I asked if they were
sufficient.  If gdb doesn't consider a zero frame pointer register in a
frame with no CFI sufficient indication of being the outermost frame, then
that answers the question.  You don't need to justify the choice of gdb's
semantics on this to me, just clarify them to me.

[Andrew says:]
> >    > - GLIBC marking those outermost frames with CFI indicating that both the 
> >    > CFA and the RA are "unknown"?
> 
> s/unknown/undefined/

Perhaps this addresses Mark's request for precision in terminology, but it
doesn't clarify anything for me.  Does this "undefined" mean the
"undefined" used in the DWARF spec?  Does DW_CFA_def_cfa with some register +
DW_CFA_undefined on that register in fact yield this?  Is that the only way
to produce it?  Is it the optimal way?

These are the questions I meant to imply when I asked,
"What would such CFI look like exactly?" 

If you want me to do it, step one is always to specify it completely.


Thanks,
Roland


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]