diff options
| author | Siva Chandra <sivachandra@google.com> | 2015-01-05 23:06:14 +0000 |
|---|---|---|
| committer | Siva Chandra <sivachandra@google.com> | 2015-01-05 23:06:14 +0000 |
| commit | 89ce955a32dc4d6bd68da2e32122d3eb3345a682 (patch) | |
| tree | ec5f7cdc83e48b275ec3aa353f547c8bb92d33b0 /lldb/test/lang/cpp/class_static/TestStaticVariables.py | |
| parent | d1d5cc27d68aa63afa9c964dd61cb6272eabe8b7 (diff) | |
| download | bcm5719-llvm-89ce955a32dc4d6bd68da2e32122d3eb3345a682.tar.gz bcm5719-llvm-89ce955a32dc4d6bd68da2e32122d3eb3345a682.zip | |
Make array symbol reading resilient to incomplete DWARF.
Summary:
GCC emits DW_TAG_subrange_type for static member arrays, but with no
attributes. This in turn results in wrong type/value of the array when
printing with 'target variable <array var name>'. This patch fixes this
so that the array value is printed in this format:
(<element type> []) <array var name> = {}
Earlier, the array was being interpreted to be of its element type.
Note: This does not fix anything to do with 'expr' or 'p' commands.
Those commands still error out complaining about incomplete types.
Test Plan: dotest.py -p TestStaticVariables
Reviewers: emaste, clayborg
Reviewed By: clayborg
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D6799
llvm-svn: 225219
Diffstat (limited to 'lldb/test/lang/cpp/class_static/TestStaticVariables.py')
| -rw-r--r-- | lldb/test/lang/cpp/class_static/TestStaticVariables.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lldb/test/lang/cpp/class_static/TestStaticVariables.py b/lldb/test/lang/cpp/class_static/TestStaticVariables.py index 6efd7b030dd..fad69a2d13c 100644 --- a/lldb/test/lang/cpp/class_static/TestStaticVariables.py +++ b/lldb/test/lang/cpp/class_static/TestStaticVariables.py @@ -20,8 +20,6 @@ class StaticVariableTestCase(TestBase): self.buildDsym() self.static_variable_commands() - @expectedFailureFreeBSD('llvm.org/pr15261', failing_compilers) # lldb on FreeBSD does not display the size of (class or file)static arrays - @expectedFailureLinux('llvm.org/pr15261', failing_compilers) # lldb on Linux does not display the size of (class or file)static arrays @dwarf_test def test_with_dwarf_and_run_command(self): """Test that file and class static variables display correctly.""" @@ -69,13 +67,13 @@ class StaticVariableTestCase(TestBase): # global variables are no longer displayed with the "frame variable" command. self.expect('target variable A::g_points', VARIABLES_DISPLAYED_CORRECTLY, - substrs = ['(PointType [2]) A::g_points']) + patterns=['\(PointType \[[1-9]*\]\) A::g_points = {.*}']) self.expect('target variable g_points', VARIABLES_DISPLAYED_CORRECTLY, substrs = ['(PointType [2]) g_points']) # On Mac OS X, gcc 4.2 emits the wrong debug info for A::g_points. # A::g_points is an array of two elements. - if sys.platform.startswith("darwin") and self.getCompiler() in ['clang', 'llvm-gcc']: + if sys.platform.startswith("darwin") or sys.platform.startswith("linux"): self.expect("target variable A::g_points[1].x", VARIABLES_DISPLAYED_CORRECTLY, startstr = "(int) A::g_points[1].x = 11") |

