Skip to content

Commit

Permalink
Revert "[LiveDebugValues] Introduce entry values of unmodified params"
Browse files Browse the repository at this point in the history
This reverts commit rG4cfceb910692 due to LLDB test failing.
  • Loading branch information
djtodoro committed Dec 3, 2019
1 parent e9c6842 commit 409350d
Show file tree
Hide file tree
Showing 8 changed files with 93 additions and 1,037 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
supported_platforms.extend(lldbplatformutil.getDarwinOSTriples())

lldbinline.MakeInlineTest(__file__, globals(),
[decorators.skipUnlessPlatform(supported_platforms),
[decorators.skipIf(bugnumber="llvm.org/pr44059"),
decorators.skipUnlessPlatform(supported_platforms),
decorators.skipIf(compiler="clang", compiler_version=['<', '10.0']),
decorators.skipUnlessArch('x86_64'),
decorators.skipUnlessHasCallSiteInfo,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,6 @@ template<typename T> __attribute__((noinline)) void use(T x) {
/* Clobbers */ : "rsi" \
);

// Destroy %rbx in the current frame.
#define DESTROY_RBX \
asm volatile ("xorq %%rbx, %%rbx" \
/* Outputs */ : \
/* Inputs */ : \
/* Clobbers */ : "rbx" \
);

struct S1 {
int field1 = 123;
int *field2 = &field1;
Expand All @@ -38,17 +30,10 @@ void func1(int &sink, int x) {
// Destroy 'x' in the current frame.
DESTROY_RSI;

// NOTE: Currently, we do not generate DW_OP_entry_value for the 'x',
// since it gets copied into a register that is not callee saved,
// and we can not guarantee that its value has not changed.
//% self.filecheck("image lookup -va $pc", "main.cpp", "-check-prefix=FUNC1-DESC")
// FUNC1-DESC: name = "x", type = "int", location = DW_OP_entry_value(DW_OP_reg4 RSI)

++sink;

// Destroy 'sink' in the current frame.
DESTROY_RBX;

//% self.filecheck("image lookup -va $pc", "main.cpp", "-check-prefix=FUNC1-DESC")
// FUNC1-DESC: name = "sink", type = "int &", location = DW_OP_entry_value(DW_OP_reg5 RDI)
}

__attribute__((noinline))
Expand All @@ -58,16 +43,10 @@ void func2(int &sink, int x) {
// Destroy 'x' in the current frame.
DESTROY_RSI;

//% self.filecheck("expr x", "main.cpp", "-check-prefix=FUNC2-EXPR-FAIL", expect_cmd_failure=True)
// FUNC2-EXPR-FAIL: couldn't get the value of variable x: variable not available
//% self.filecheck("expr x", "main.cpp", "-check-prefix=FUNC2-EXPR")
// FUNC2-EXPR: (int) ${{.*}} = 123

++sink;

// Destroy 'sink' in the current frame.
DESTROY_RBX;

//% self.filecheck("expr sink", "main.cpp", "-check-prefix=FUNC2-EXPR")
// FUNC2-EXPR: ${{.*}} = 2
}

__attribute__((noinline))
Expand All @@ -90,16 +69,10 @@ void func4_amb(int &sink, int x) {
// Destroy 'x' in the current frame.
DESTROY_RSI;

//% self.filecheck("expr x", "main.cpp", "-check-prefix=FUNC4-EXPR-FAIL", expect_cmd_failure=True)
// FUNC4-EXPR-FAIL: couldn't get the value of variable x: variable not available
//% self.filecheck("expr x", "main.cpp", "-check-prefix=FUNC4-EXPR", expect_cmd_failure=True)
// FUNC4-EXPR: couldn't get the value of variable x: Could not evaluate DW_OP_entry_value.

++sink;

// Destroy 'sink' in the current frame.
DESTROY_RBX;

//% self.filecheck("expr sink", "main.cpp", "-check-prefix=FUNC4-EXPR", expect_cmd_failure=True)
// FUNC4-EXPR: couldn't get the value of variable sink: Could not evaluate DW_OP_entry_value.
}

__attribute__((noinline))
Expand All @@ -125,16 +98,10 @@ void func7(int &sink, int x) {
// Destroy 'x' in the current frame.
DESTROY_RSI;

//% self.filecheck("expr x", "main.cpp", "-check-prefix=FUNC7-EXPR-FAIL", expect_cmd_failure=True)
// FUNC7-EXPR-FAIL: couldn't get the value of variable x: variable not available
//% self.filecheck("expr x", "main.cpp", "-check-prefix=FUNC7-EXPR")
// FUNC7-EXPR: (int) ${{.*}} = 123

++sink;

// Destroy 'sink' in the current frame.
DESTROY_RBX;

//% self.filecheck("expr sink", "main.cpp", "-check-prefix=FUNC7-EXPR")
// FUNC7-EXPR: ${{.*}} = 4
}

__attribute__((always_inline))
Expand Down Expand Up @@ -162,16 +129,10 @@ void func11_tailcalled(int &sink, int x) {
// Destroy 'x' in the current frame.
DESTROY_RSI;

//% self.filecheck("expr x", "main.cpp", "-check-prefix=FUNC11-EXPR-FAIL", expect_cmd_failure=True)
// FUNC11-EXPR-FAIL: couldn't get the value of variable x: variable not available
//% self.filecheck("expr x", "main.cpp", "-check-prefix=FUNC11-EXPR")
// FUNC11-EXPR: (int) ${{.*}} = 123

++sink;

// Destroy 'sink' in the current frame.
DESTROY_RBX;

//% self.filecheck("expr sink", "main.cpp", "-check-prefix=FUNC11-EXPR")
// FUNC11-EXPR: ${{.*}} = 5
}

__attribute__((noinline))
Expand All @@ -189,16 +150,10 @@ void func13(int &sink, int x) {
// Destroy 'x' in the current frame.
DESTROY_RSI;

//% self.filecheck("expr x", "main.cpp", "-check-prefix=FUNC13-EXPR-FAIL", expect_cmd_failure=True)
// FUNC13-EXPR-FAIL: couldn't get the value of variable x: variable not available

use(sink);
//% self.filecheck("expr x", "main.cpp", "-check-prefix=FUNC13-EXPR")
// FUNC13-EXPR: (int) ${{.*}} = 123

// Destroy 'sink' in the current frame.
DESTROY_RBX;

//% self.filecheck("expr sink", "main.cpp", "-check-prefix=FUNC13-EXPR")
// FUNC13-EXPR: ${{.*}} = 5
++sink;
}

__attribute__((noinline, disable_tail_calls))
Expand Down
Loading

0 comments on commit 409350d

Please sign in to comment.