[lldb-dev] Duplicate use of "sp" register name on x86 targets

Michał Górny via lldb-dev lldb-dev at lists.llvm.org
Wed Aug 25 12:13:56 PDT 2021


Hi,

While working on improving gdbserver compatibility, I've noticed that
"sp" is used twice:

1. as an alt_name for esp/rsp register (giving full 32/64-bit stack
pointer),

2. and as the name of sp pseudo-register (giving ESP/RSP truncated to 16
bits).

FWICS the current lookup logic (at least for LLGS targets) means that 1.
takes precedence, i.e. 'register read sp' and 'p $sp' will both resolve
to RSP.  The 16-bit SP is only visible via 'register read --all'.

However, I'm wondering whether this is actually desirable.
In particular, should 'sp' generic name take precedence over an actual
'sp' (pseudo-)register?

-- 
Best regards,
Michał Górny




More information about the lldb-dev mailing list