summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2016-03-08 18:35:09 +0000
committerAdrian Prantl <aprantl@apple.com>2016-03-08 18:35:09 +0000
commit6aeba89e8986c0fd25acd727599656153dee904c (patch)
tree94f4145a7aac61bcdff592936935f2252690671a /lldb/packages/Python/lldbsuite/test
parent2a7062440380fb3e94d9dca5f0d8061982b58997 (diff)
downloadbcm5719-llvm-6aeba89e8986c0fd25acd727599656153dee904c.tar.gz
bcm5719-llvm-6aeba89e8986c0fd25acd727599656153dee904c.zip
Support floating point values in 128-bit SSE vector registers
The System-V x86_64 ABI requires floating point values to be passed in 128-but SSE vector registers (xmm0, ...). When printing such a variable this currently yields an <invalid load address>. This patch makes LLDB's DWARF expression evaluator accept 128-bit registers as scalars. It also relaxes the check that the size of the result of the DWARF expression be equal to the size of the variable to a greater-than. DWARF defers to the ABI how smaller values are being placed in a larger register. Implementation note: I found the code in Value::SetContext() that changes the m_value_type after the fact to be questionable. I added a sanity check that the Value's memory buffer has indeed been written to (this is necessary, because we may have a scalar value in a vector register), but really I feel like this is the wrong place to be setting it. Reviewed by Greg Clayton. http://reviews.llvm.org/D17897 rdar://problem/24944340 llvm-svn: 262947
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
-rw-r--r--lldb/packages/Python/lldbsuite/test/lang/c/register_variables/TestRegisterVariables.py20
-rw-r--r--lldb/packages/Python/lldbsuite/test/lang/c/register_variables/test.c8
2 files changed, 27 insertions, 1 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lang/c/register_variables/TestRegisterVariables.py b/lldb/packages/Python/lldbsuite/test/lang/c/register_variables/TestRegisterVariables.py
index 0cb99238621..8fae3c982b0 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/c/register_variables/TestRegisterVariables.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/c/register_variables/TestRegisterVariables.py
@@ -24,7 +24,7 @@ class RegisterVariableTestCase(TestBase):
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Break inside the main.
- lldbutil.run_break_set_by_source_regexp(self, "break", num_expected_locations=2)
+ lldbutil.run_break_set_by_source_regexp(self, "break", num_expected_locations=3)
####################
# First breakpoint
@@ -68,4 +68,22 @@ class RegisterVariableTestCase(TestBase):
self.expect("expr c", VARIABLES_DISPLAYED_CORRECTLY,
substrs = ['(int) $3 = 5'])
+ #####################
+ # Third breakpoint
+
+ self.runCmd("continue")
+
+ # The stop reason of the thread should be breakpoint.
+ self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
+ substrs = ['stopped',
+ 'stop reason = breakpoint'])
+
+ # The breakpoint should have a hit count of 1.
+ self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
+ substrs = [' resolved, hit count = 1'])
+
+ # Try some variables that should be visible
+ self.expect("expr f", VARIABLES_DISPLAYED_CORRECTLY,
+ substrs = ['(float) $4 = 3.1'])
+
self.runCmd("kill")
diff --git a/lldb/packages/Python/lldbsuite/test/lang/c/register_variables/test.c b/lldb/packages/Python/lldbsuite/test/lang/c/register_variables/test.c
index e467ac48f74..9acd3f3835b 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/c/register_variables/test.c
+++ b/lldb/packages/Python/lldbsuite/test/lang/c/register_variables/test.c
@@ -18,10 +18,18 @@ void f2(struct bar *b)
printf("%d\n", c); // set breakpoint here
}
+float f3() __attribute__ ((noinline));
+float f3() {
+ return 3.14f;
+}
+
int main()
{
struct bar myBar = { 3, 4 };
f1(2, &myBar);
f2(&myBar);
+
+ float f = f3();
+ printf("%f\n", f); // set breakpoint here
return 0;
}
OpenPOWER on IntegriCloud