[all-commits] [llvm/llvm-project] dbc34e: [LLDB] Discard register flags where the size doesn...

David Spickett via All-commits all-commits at lists.llvm.org
Thu Apr 20 01:37:03 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: dbc34e2bed10c18c78100a9e8517d9a0b2f6639d
      https://github.com/llvm/llvm-project/commit/dbc34e2bed10c18c78100a9e8517d9a0b2f6639d
  Author: David Spickett <david.spickett at linaro.org>
  Date:   2023-04-20 (Thu, 20 Apr 2023)

  Changed paths:
    M lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
    M lldb/test/API/functionalities/gdb_remote_client/TestXMLRegisterFlags.py

  Log Message:
  -----------
  [LLDB] Discard register flags where the size doesn't match the register

In the particular case I was looking at I autogenerated a 128 bit set
of flags that is only 64 bit. This doesn't crash lldb but it was certainly
not expected.

I suspect that we would have crashed if the top 64 bits weren't
marked as unused (or at least invoked some very undefined behaviour).

When this happens, log the details and ignore the flags. Like this:
```
Size of register flags TTBR0_EL1_flags (16 bytes) for register TTBR0_EL1 does not match the register size (8 bytes). Ignoring this set of flags.
```

Turns out a few of the tests relied on this bug so I have updated
them and added a specific test for this case.

Reviewed By: jasonmolenda

Differential Revision: https://reviews.llvm.org/D148715




More information about the All-commits mailing list