Re: [PATCH 3/3] GDB: New target s12z

Tom Tromey
2018-08-28T15:35:41Z

>>>>> "Simon" == Simon Marchi <simark@simark.ca> writes:

Simon> The usual thing to do (I looked at a few other arches) is to use the same value as the
Simon> canonical frame address as defined by DWARF (Section 6.4 in DWARF5.pdf), which is the
Simon> value of the stack pointer just before that frame was created.

Simon> This is of course not mandatory, but I suppose that adhering to this de facto rule could
Simon> make things clearer.

ISTR there was one obscure case where it was necessary -- I think some
architectures have a special epilogue unwinder, and it was important
that this unwinder agree with the DWARF unwinder about the CFA in some
case. This was many years ago so as you can tell I don't really recall
the details.

Anyway, I think using the current frame's SP will fail if the function
uses alloca -- the frame id will change across a step. The CFA is
usually used in order to make the frame id invariant. There may be a
comment in one of the frame*.h files explaining this.

Tom