> That's closer to the definitions used in the specification, so go > ahead. I used REG_UNSAVED since that's what GCC's unwinder uses, so > perhaps you could add a comment that says this? Ah! That also explains why GCC has problems. It's combined two different states :-/ I've added comments to that effect. >> - if it detects an unspecified CFI entry it complains >> It isn't perfect though - since it doesn't know the full range of valid >> debug info register numbers it can't check every entry. Instead it >> checks the range provided by CFI for unspecified holes and then >> complains about that. The reality is that GCC at least gets that bit >> right (but consistently forgets the SP). > > > Sorry, GCC gets what right? On the platforms I tested (amd64 & i386) all [0 .. max "column") were specified. The problems were with numbers outside of that range. I'll re-word the comment. > > Anyway, the full range of valid debug info registers, is defined by > the DWARF register mapping that some ABI's define (at least the x86-64 > ABI provides such a definition). GDB sort of has this information in > that we have the dwarf2_reg_to_regnum function in the architecture > vector. Yes. There isn't a way of iterating over it. Oh, and btw, it can also be sparse - I believe that the e500 (ppc variant) has has dwarf2 numbers >1000. Something to address in a later iteration. >> I'd like to commit the patch as is for the 6.0 branch. For the mainline >> though, I'd like to make the additional changes: >> >> - delete the SP_REGNUM hack from the REG_UNDEFINED rule (it's no longer >> needed, I think) > > > I guess that if the stack pointer is explicitly marked as being > "undefined", all will be lost on most architectures. Yes, bit of a loose-loose situtation. If it's really "undefined" GDB can't use "CFI" as that would mislead the user into thinking that a bogus backtrace is valid. >> - add a check/complaint for the SP v CFA problem. >> >> Anyway, the end result is that on x86-64 and i386 store.exp now passes. >> >> ok to commit? > > > Hmm, three "style" nits: > > - The uppercase MEMSET in the comment on `enum dwarf2_reg_rule' is > wrong. Uppercase is reserved for when we're talking about the value > of a symbol, not the symbol itself. So please convert this into > lowercase. > > - I find the name `cfinum' a bit cryptic. I understand that you want > to avoid `reg', how about calling it `column'? That's sort of CFI > speak for a register number. > > - Please remove the extra blank line before `case REG_SAME_VALUE:'. > > With those changes this is OK (or can't I approve changes to a file > I've written in the first place?). You can also leave it to me to > make those changes ;-). I think they are fixed. I've attached the diff I'll commit. Andrew