[Lldb-commits] [lldb] [lldb] Fix printing of unsigned enum bitfields when they contain the max value (PR #96202)

Michael Buch via lldb-commits lldb-commits at lists.llvm.org
Sun Jul 7 16:33:09 PDT 2024


Michael137 wrote:

FYI, the new test seems to be failing on the matrix LLDB bot that's testing DWARFv2:
```
======================================================================
FAIL: test_bitfield_enums_dsym (TestBitfieldEnums.TestBitfieldEnum)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake-matrix/llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 1756, in test_method
    return attrvalue(self)
  File "/Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake-matrix/llvm-project/lldb/test/API/commands/expression/bitfield_enums/TestBitfieldEnums.py", line 20, in test_bitfield_enums
    self.expect_expr(
  File "/Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake-matrix/llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 2512, in expect_expr
    value_check.check_value(self, eval_result, str(eval_result))
  File "/Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake-matrix/llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 326, in check_value
    self.check_value_children(test_base, val, error_msg)
  File "/Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake-matrix/llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 349, in check_value_children
    expected_child.check_value(test_base, actual_child, child_error)
  File "/Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake-matrix/llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 311, in check_value
    test_base.assertEqual(self.expect_value, val.GetValue(), this_error_msg)
AssertionError: 'max' != '-1'
- max
+ -1
 : Checking child with index 5:
(BitfieldStruct) $0 = {
  signed_min = min
  signed_other = -1
  signed_max = max
  unsigned_min = min
  unsigned_other = 1
  unsigned_max = -1
}
Checking SBValue: (UnsignedEnum:2) unsigned_max = -1
```
https://green.lab.llvm.org/job/llvm.org/view/LLDB/job/lldb-cmake-matrix/459/execution/node/59/log/?consoleFull

(both the dSYM and non-dSYM variants of the test are failing)

AFAICT, this seems to just be an existing bug in the DWARFv2 support that this test uncovered.

With my system LLDB (compiling the test with `-gdwarf-2`):
```
(lldb) v bfs
(BitfieldStruct) bfs = {
  signed_min = min
  signed_other = -1
  signed_max = max
  unsigned_min = min
  unsigned_other = 1
  unsigned_max = -1
}
```

https://github.com/llvm/llvm-project/pull/96202


More information about the lldb-commits mailing list