In a new Range class was introduced to simplify and the Disassembler API
and reduce duplication. It unintentionally broke the
SBFrame::Disassemble functionality because it unconditionally converts
the number of instructions to a Range{Limit::Instructions,
num_instructions}. This is subtly different from the previous behavior,
where now we're passing a Range and assume it's valid in the callee, the
original code would propagate num_instructions and the callee would
compare the value and decided between disassembling instructions or
bytes.
Unfortunately the existing tests was not particularly strict:
disassembly = frame.Disassemble()
self.assertNotEqual(len(disassembly), 0, "Disassembly was empty.")
This would pass because without this patch we'd disassemble zero
instructions, resulting in an error:
(lldb) script print(lldb.frame.Disassemble())
error: error reading data from section __text
Differential revision: https://reviews.llvm.org/D89925
21 lines
294 B
C++
21 lines
294 B
C++
int
|
|
sum (int a, int b)
|
|
{
|
|
int result = a + b; // Set a breakpoint here
|
|
asm("nop");
|
|
return result;
|
|
}
|
|
|
|
int
|
|
main(int argc, char const *argv[])
|
|
{
|
|
|
|
int array[3];
|
|
|
|
array[0] = sum (1238, 78392);
|
|
array[1] = sum (379265, 23674);
|
|
array[2] = sum (872934, 234);
|
|
|
|
return 0;
|
|
}
|