[Lldb-commits] [PATCH] D62931: [lldb-server] Add setting to force 'g' packet use

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 18 05:25:36 PDT 2019


labath added a comment.

Yeah, that is a problem, though it's not really caused by you, and I am not sure even if your planned changed makes it worse (it looks like it *might* do that, but I'd have to dig deeper to tell for sure). If you found this issue by running the test suite, then I guess it does.

The problem here is that there is a lot of confusion in the code about what is the "offset" field in the register info struct supposed to mean. Somewhere it is used to specify the offset in the operating system register context struct (`struct user` on linux), and elsewhere for the position in the gdb register packet string. In an ideal world, the same number could be used for both things, but unfortunately ymm registers use this weird discontiguous layout, which is not expressible in the RegisterInfo struct. If you want to fix that, I think the only reasonable way to do that would be to change the RegisterInfo offset for BND registers to mean the gdb-remote offset, and then change any code which uses it for the OS context offset to do something else (the only place doing something like that should be RegisterContextLinux_x86_64.cpp).

(As a side note, the register infos in lldb badly need some TLC. I am preparing a patch which should make things slightly better, though it will not help with this issue in any way.)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62931/new/

https://reviews.llvm.org/D62931





More information about the lldb-commits mailing list