summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test
diff options
context:
space:
mode:
authorEwan Crawford <ewan@codeplay.com>2015-12-17 11:59:47 +0000
committerEwan Crawford <ewan@codeplay.com>2015-12-17 11:59:47 +0000
commit37395ad211e607d6f366cc98c8685aea812de8a7 (patch)
tree6b4ea32a0f6c30fac17e77b748a2027c9c1e2053 /lldb/packages/Python/lldbsuite/test
parent23f04fd469d7a05de41bdb66d0bd23d2d0dbca61 (diff)
downloadbcm5719-llvm-37395ad211e607d6f366cc98c8685aea812de8a7.tar.gz
bcm5719-llvm-37395ad211e607d6f366cc98c8685aea812de8a7.zip
Inspect DW_AT_const_value global static const variables
This patch adds support for printing global static const variables which are given a DW_AT_const_value DWARF tag by clang. Fix for bug https://llvm.org/bugs/show_bug.cgi?id=25653 Reviewers: clayborg, tberghammer Subscribers: emaste, lldb-commits Differential Revision: http://reviews.llvm.org/D15576 llvm-svn: 255887
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
-rw-r--r--lldb/packages/Python/lldbsuite/test/lang/c/global_variables/TestGlobalVariables.py1
-rw-r--r--lldb/packages/Python/lldbsuite/test/lang/c/global_variables/main.c3
2 files changed, 3 insertions, 1 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lang/c/global_variables/TestGlobalVariables.py b/lldb/packages/Python/lldbsuite/test/lang/c/global_variables/TestGlobalVariables.py
index a881117ed7a..46cf54397ac 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/c/global_variables/TestGlobalVariables.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/c/global_variables/TestGlobalVariables.py
@@ -52,6 +52,7 @@ class GlobalVariablesTestCase(TestBase):
# Check that GLOBAL scopes are indicated for the variables.
self.expect("frame variable --show-types --scope --show-globals --no-args", VARIABLES_DISPLAYED_CORRECTLY,
substrs = ['GLOBAL: (int) g_file_global_int = 42',
+ 'STATIC: (const int) g_file_static_int = 2',
'GLOBAL: (const char *) g_file_global_cstr',
'"g_file_global_cstr"',
'STATIC: (const char *) g_file_static_cstr',
diff --git a/lldb/packages/Python/lldbsuite/test/lang/c/global_variables/main.c b/lldb/packages/Python/lldbsuite/test/lang/c/global_variables/main.c
index d0ac6a9534f..499b2504774 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/c/global_variables/main.c
+++ b/lldb/packages/Python/lldbsuite/test/lang/c/global_variables/main.c
@@ -10,13 +10,14 @@
int g_common_1; // Not initialized on purpose to cause it to be undefined external in .o file
int g_file_global_int = 42;
+static const int g_file_static_int = 2;
const char *g_file_global_cstr = "g_file_global_cstr";
static const char *g_file_static_cstr = "g_file_static_cstr";
extern int g_a;
int main (int argc, char const *argv[])
{
- g_common_1 = g_file_global_int / 2;
+ g_common_1 = g_file_global_int / g_file_static_int;
static const char *g_func_static_cstr = "g_func_static_cstr";
printf ("%s %s\n", g_file_global_cstr, g_file_static_cstr);
return g_file_global_int + g_a + g_common_1; // Set break point at this line. //// break $source:$line; continue; var -global g_a -global g_global_int
OpenPOWER on IntegriCloud