Skip to content

Commit ecc6c42

Browse files
committed
[lldb/testsuite] Fix TestInlineStepping on arm64 with newer compilers
Summary: TestInlineStepping tests LLDB's ability to step in the presence of inline frames. The testcase source has a number of functions and some of them are marked `always_inline`. The test is built around the assumption that the inline function will be fully represented once inlined, but this is not true with the current arm64 code generation. For example: void caller() { always_inline_function(); // Step here } When stppeing into `caller()` above, you might immediatly end up in the inlines frame for `always_inline_function()`, because there might literally be no code associated with `caller()` itself. This patch hacks around the issue by adding an `asm volatile("nop")` on some lines with inlined calls where we expect to be able to step. Like so: void caller() { asm volatile("nop"); always_inline_function(); // Step here } This guarantees there is always going to be one instruction for this line in the caller. Reviewers: labath, jingham Subscribers: kristof.beyls, danielkiss, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D76406
1 parent e154cbb commit ecc6c42

File tree

1 file changed

+2
-2
lines changed
  • lldb/test/API/functionalities/inline-stepping

1 file changed

+2
-2
lines changed

lldb/test/API/functionalities/inline-stepping/calling.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ caller_trivial_1 ()
7575
void
7676
caller_trivial_2 ()
7777
{
78-
inline_trivial_1 (); // In caller_trivial_2.
78+
asm volatile ("nop"); inline_trivial_1 (); // In caller_trivial_2.
7979
inline_value += 1; // At increment in caller_trivial_2.
8080
}
8181

@@ -88,7 +88,7 @@ called_by_inline_trivial ()
8888
void
8989
inline_trivial_1 ()
9090
{
91-
inline_trivial_2(); // In inline_trivial_1.
91+
asm volatile ("nop"); inline_trivial_2(); // In inline_trivial_1.
9292
inline_value += 1; // At increment in inline_trivial_1.
9393
}
9494

0 commit comments

Comments
 (0)