IBM S/390 prologue analysis revisited
Andrew Cagney
ac131313@redhat.com
Tue Jul 1 12:28:00 GMT 2003
> You mean: [just for the record]: new prologue analyzer for S/390
> http://sources.redhat.com/ml/gdb-patches/2003-04/msg00352.html
One PS,
Since this was posted (but you'd declined to commit) I added
trad-frame.[hc]. This provides functionality that overlaps what is
found in the s390 patch (it's slightly more compact).
> /* A traditional saved regs table, indexed by REGNUM, encoding where
> the value of REGNUM for the previous frame can be found in this
> frame.
>
> The table is initialized with an identity encoding (ADDR == -1,
> REALREG == REGNUM) indicating that the value of REGNUM in the
> previous frame can be found in register REGNUM (== REALREG) in this
> frame.
>
> The initial encoding can then be changed:
>
> Modify ADDR (REALREG >= 0, ADDR != -1) to indicate that the value
> of register REGNUM in the previous frame can be found in memory at
> ADDR in this frame (addr_p, !realreg_p, !value_p).
>
> Modify REALREG (REALREG >= 0, ADDR == -1) to indicate that the
> value of register REGNUM in the previous frame is found in register
> REALREG in this frame (!addr_p, realreg_p, !value_p).
>
> Call trad_frame_register_value (REALREG == -1) to indicate that the
> value of register REGNUM in the previous frame is found in ADDR
> (!addr_p, !realreg_p, value_p). */
Editor note: It's missing the undefined state. I'll add it.
> struct trad_frame_saved_reg
> {
> LONGEST addr; /* A CORE_ADDR fits in a longest. */
> int realreg;
> };
>
Vs:
> ! struct prologue_value {
> !
> ! /* What sort of value is this? This determines the interpretation
> ! of subsequent fields. */
> ! enum {
> !
> ! /* We don't know anything about the value. This is also used for
> ! values we could have kept track of, when doing so would have
> ! been too complex and we don't want to bother. The bottom of
> ! our lattice. */
> ! pv_unknown,
> !
> ! /* A known constant. K is its value. */
> ! pv_constant,
> !
> ! /* The value that register REG originally had *UPON ENTRY TO THE
> ! FUNCTION*, plus K. If K is zero, this means, obviously, just
> ! the value REG had upon entry to the function. REG is a GDB
> ! register number. Before we start interpreting, we initialize
> ! every register R to { pv_register, R, 0 }. */
> ! pv_register,
> !
> ! } kind;
> !
> ! /* The meanings of the following fields depend on 'kind'; see the
> ! comments for the specific 'kind' values. */
> ! int reg;
> ! CORE_ADDR k;
> ! };
Given I'm, in the background, converting the old unwinders to the
trad-frame framework (I've an i386 patch in my sandbox), it would
probably be a good idea to merge the two.
(note that I need to commit the above revised version to trunk and branch)
enjoy,
Andrew
More information about the Gdb
mailing list