aboutsummaryrefslogtreecommitdiff
path: root/packages/Python/lldbsuite/test/functionalities/data-formatter
diff options
context:
space:
mode:
Diffstat (limited to 'packages/Python/lldbsuite/test/functionalities/data-formatter')
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/boolreference/TestFormattersBoolRefPtr.py40
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/compactvectors/TestCompactVectors.py38
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py341
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py298
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py274
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-disabling/TestDataFormatterDisabling.py48
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-enum-format/TestDataFormatterEnumFormat.py34
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-globals/TestDataFormatterGlobals.py32
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-named-summaries/TestDataFormatterNamedSummaries.py117
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py373
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/main.m2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsindexpath/Makefile9
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsindexpath/TestDataFormatterNSIndexPath.py115
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsindexpath/main.m31
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py91
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-proper-plurals/TestFormattersOneIsSingular.py36
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-ptr-to-array/TestPtrToArrayFormatting.py18
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py189
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/fooSynthProvider.py49
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/ftsp.py58
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-script/TestDataFormatterScript.py128
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py227
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-smart-array/TestDataFormatterSmartArray.py496
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/TestLibCxxAtomic.py38
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/function/Makefile5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/function/TestLibCxxFunction.py56
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/function/main.cpp25
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py29
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py47
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/main.cpp14
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py210
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py44
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py334
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py332
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py98
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py9
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py76
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py27
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py49
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py170
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py49
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py202
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py370
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py39
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py40
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/tuple/Makefile8
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/tuple/TestDataFormatterStdTuple.py49
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/tuple/main.cpp9
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/Makefile8
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/TestDataFormatterStdUniquePtr.py61
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/main.cpp22
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py49
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py189
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py199
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/TestDataFormatterSynthType.py14
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/myIntSynthProvider.py42
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthval/TestDataFormatterSynthVal.py63
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthval/main.cpp12
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthval/myIntSynthProvider.py42
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/dump_dynamic/TestDumpDynamic.py5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/format-propagation/TestFormatPropagation.py32
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/frameformat_smallstruct/TestFrameFormatSmallStruct.py14
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/hexcaps/TestDataFormatterHexCaps.py47
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/language_category_updates/TestDataFormatterLanguageCategoryUpdates.py59
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/nsarraysynth/TestNSArraySynthetic.py80
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/nsdictionarysynth/TestNSDictionarySynthetic.py96
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/nssetsynth/TestNSSetSynthetic.py76
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/ostypeformatting/TestFormattersOsType.py14
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/parray/TestPrintArray.py104
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/poarray/TestPrintObjectArray.py74
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/ptr_ref_typedef/TestPtrRef2Typedef.py28
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/pyobjsynthprovider/Makefile5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/pyobjsynthprovider/TestPyObjSynthProvider.py73
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/pyobjsynthprovider/main.cpp20
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/pyobjsynthprovider/provider.py16
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/refpointer-recursion/TestDataFormatterRefPtrRecursion.py20
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/setvaluefromcstring/TestSetValueFromCString.py4
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/stringprinter/TestStringPrinter.py5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/summary-string-onfail/Test-rdar-9974002.py106
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py40
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/fooSynthProvider.py24
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/synthupdate/TestSyntheticFilterRecompute.py36
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_arg/TestTypeSummaryListArg.py36
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_script/TestTypeSummaryListScript.py24
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_script/tslsformatters.py4
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/typedef_array/TestTypedefArray.py5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/user-format-vs-summary/TestUserFormatVsSummary.py39
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/var-in-aggregate-misuse/TestVarInAggregateMisuse.py50
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/varscript_formatting/TestDataFormatterVarScriptFormatting.py25
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/varscript_formatting/helperfunc.py5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py64
91 files changed, 4479 insertions, 2825 deletions
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/boolreference/TestFormattersBoolRefPtr.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/boolreference/TestFormattersBoolRefPtr.py
index fb3511ebd91d..0459058f3ae9 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/boolreference/TestFormattersBoolRefPtr.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/boolreference/TestFormattersBoolRefPtr.py
@@ -5,14 +5,15 @@ Test lldb data formatter subsystem.
from __future__ import print_function
-
import datetime
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+
class DataFormatterBoolRefPtr(TestBase):
mydir = TestBase.compute_mydir(__file__)
@@ -33,14 +34,15 @@ class DataFormatterBoolRefPtr(TestBase):
"""Test the formatters we use for BOOL& and BOOL* in Objective-C."""
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_file_and_line (self, "main.mm", self.line, num_expected_locations=1, loc_exact=True)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.mm", self.line, num_expected_locations=1, loc_exact=True)
self.runCmd("run", RUN_SUCCEEDED)
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
@@ -52,28 +54,28 @@ class DataFormatterBoolRefPtr(TestBase):
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
+ isiOS = (lldbplatformutil.getPlatform() == 'ios')
+
# Now check that we use the right summary for BOOL&
self.expect('frame variable yes_ref',
- substrs = ['YES'])
+ substrs=['YES'])
self.expect('frame variable no_ref',
- substrs = ['NO'])
- self.expect('frame variable unset_ref',
- substrs = ['12'])
-
+ substrs=['NO'])
+ if not(isiOS):
+ self.expect('frame variable unset_ref', substrs=['12'])
# Now check that we use the right summary for BOOL*
self.expect('frame variable yes_ptr',
- substrs = ['YES'])
+ substrs=['YES'])
self.expect('frame variable no_ptr',
- substrs = ['NO'])
- self.expect('frame variable unset_ptr',
- substrs = ['12'])
-
+ substrs=['NO'])
+ if not(isiOS):
+ self.expect('frame variable unset_ptr', substrs=['12'])
# Now check that we use the right summary for BOOL
self.expect('frame variable yes',
- substrs = ['YES'])
+ substrs=['YES'])
self.expect('frame variable no',
- substrs = ['NO'])
- self.expect('frame variable unset',
- substrs = ['12'])
+ substrs=['NO'])
+ if not(isiOS):
+ self.expect('frame variable unset', substrs=['12'])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/compactvectors/TestCompactVectors.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/compactvectors/TestCompactVectors.py
index 914c5260ac24..9b430c726e12 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/compactvectors/TestCompactVectors.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/compactvectors/TestCompactVectors.py
@@ -5,13 +5,14 @@ Test lldb data formatter subsystem.
from __future__ import print_function
-
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+
class CompactVectorsFormattingTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@@ -28,14 +29,15 @@ class CompactVectorsFormattingTestCase(TestBase):
self.build()
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
self.runCmd("run", RUN_SUCCEEDED)
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
@@ -45,15 +47,17 @@ class CompactVectorsFormattingTestCase(TestBase):
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
- self.expect('frame variable',
- substrs = ['(vFloat) valueFL = (1.25, 0, 0.25, 0)',
- '(int16_t [8]) valueI16 = (1, 0, 4, 0, 0, 1, 0, 4)',
- '(int32_t [4]) valueI32 = (1, 0, 4, 0)',
- '(vDouble) valueDL = (1.25, 2.25)',
- '(vUInt8) valueU8 = (0x01, 0x00, 0x04, 0x00, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00)',
- '(vUInt16) valueU16 = (1, 0, 4, 0, 0, 1, 0, 4)',
- '(vUInt32) valueU32 = (1, 2, 3, 4)',
- "(vSInt8) valueS8 = (1, 0, 4, 0, 0, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0)",
- '(vSInt16) valueS16 = (1, 0, 4, 0, 0, 1, 0, 4)',
- '(vSInt32) valueS32 = (4, 3, 2, 1)',
- '(vBool32) valueBool32 = (0, 1, 0, 1)'])
+ self.expect(
+ 'frame variable',
+ substrs=[
+ '(vFloat) valueFL = (1.25, 0, 0.25, 0)',
+ '(int16_t [8]) valueI16 = (1, 0, 4, 0, 0, 1, 0, 4)',
+ '(int32_t [4]) valueI32 = (1, 0, 4, 0)',
+ '(vDouble) valueDL = (1.25, 2.25)',
+ '(vUInt8) valueU8 = (0x01, 0x00, 0x04, 0x00, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00)',
+ '(vUInt16) valueU16 = (1, 0, 4, 0, 0, 1, 0, 4)',
+ '(vUInt32) valueU32 = (1, 2, 3, 4)',
+ "(vSInt8) valueS8 = (1, 0, 4, 0, 0, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0)",
+ '(vSInt16) valueS16 = (1, 0, 4, 0, 0, 1, 0, 4)',
+ '(vSInt32) valueS32 = (4, 3, 2, 1)',
+ '(vBool32) valueBool32 = (0, 1, 0, 1)'])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py
index 8166d1540ca3..050f5236445b 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py
@@ -5,12 +5,13 @@ Test lldb data formatter subsystem.
from __future__ import print_function
-
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.lldbtest import *
import lldbsuite.test.lldbutil as lldbutil
+
class AdvDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@@ -26,103 +27,116 @@ class AdvDataFormatterTestCase(TestBase):
self.build()
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
self.runCmd("run", RUN_SUCCEEDED)
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
def cleanup():
self.runCmd('type format clear', check=False)
self.runCmd('type summary clear', check=False)
- self.runCmd("settings set target.max-children-count 256", check=False)
-
+ self.runCmd(
+ "settings set target.max-children-count 256",
+ check=False)
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
self.runCmd("type summary add --summary-string \"pippo\" \"i_am_cool\"")
- self.runCmd("type summary add --summary-string \"pluto\" -x \"i_am_cool[a-z]*\"")
+ self.runCmd(
+ "type summary add --summary-string \"pluto\" -x \"i_am_cool[a-z]*\"")
self.expect("frame variable cool_boy",
- substrs = ['pippo'])
+ substrs=['pippo'])
self.expect("frame variable cooler_boy",
- substrs = ['pluto'])
+ substrs=['pluto'])
self.runCmd("type summary delete i_am_cool")
-
+
self.expect("frame variable cool_boy",
- substrs = ['pluto'])
+ substrs=['pluto'])
self.runCmd("type summary clear")
-
- self.runCmd("type summary add --summary-string \"${var[]}\" -x \"int \\[[0-9]\\]")
+
+ self.runCmd(
+ "type summary add --summary-string \"${var[]}\" -x \"int \\[[0-9]\\]")
self.expect("frame variable int_array",
- substrs = ['1,2,3,4,5'])
+ substrs=['1,2,3,4,5'])
# this will fail if we don't do [] as regex correctly
- self.runCmd('type summary add --summary-string "${var[].integer}" "i_am_cool[]')
-
+ self.runCmd(
+ 'type summary add --summary-string "${var[].integer}" "i_am_cool[]')
+
self.expect("frame variable cool_array",
- substrs = ['1,1,1,1,6'])
+ substrs=['1,1,1,1,6'])
self.runCmd("type summary clear")
-
- self.runCmd("type summary add --summary-string \"${var[1-0]%x}\" \"int\"")
-
+
+ self.runCmd(
+ "type summary add --summary-string \"${var[1-0]%x}\" \"int\"")
+
self.expect("frame variable iAmInt",
- substrs = ['01'])
-
- self.runCmd("type summary add --summary-string \"${var[0-1]%x}\" \"int\"")
-
+ substrs=['01'])
+
+ self.runCmd(
+ "type summary add --summary-string \"${var[0-1]%x}\" \"int\"")
+
self.expect("frame variable iAmInt",
- substrs = ['01'])
+ substrs=['01'])
self.runCmd("type summary clear")
self.runCmd("type summary add --summary-string \"${var[0-1]%x}\" int")
- self.runCmd("type summary add --summary-string \"${var[0-31]%x}\" float")
-
+ self.runCmd(
+ "type summary add --summary-string \"${var[0-31]%x}\" float")
+
self.expect("frame variable *pointer",
- substrs = ['0x',
- '2'])
+ substrs=['0x',
+ '2'])
- # check fix for <rdar://problem/11338654> LLDB crashes when using a "type summary" that uses bitfields with no format
+ # check fix for <rdar://problem/11338654> LLDB crashes when using a
+ # "type summary" that uses bitfields with no format
self.runCmd("type summary add --summary-string \"${var[0-1]}\" int")
self.expect("frame variable iAmInt",
- substrs = ['9 1'])
+ substrs=['9 1'])
self.expect("frame variable cool_array[3].floating",
- substrs = ['0x'])
-
- self.runCmd("type summary add --summary-string \"low bits are ${*var[0-1]} tgt is ${*var}\" \"int *\"")
+ substrs=['0x'])
+
+ self.runCmd(
+ "type summary add --summary-string \"low bits are ${*var[0-1]} tgt is ${*var}\" \"int *\"")
self.expect("frame variable pointer",
- substrs = ['low bits are',
- 'tgt is 6'])
+ substrs=['low bits are',
+ 'tgt is 6'])
- self.expect("frame variable int_array --summary-string \"${*var[0-1]}\"",
- substrs = ['3'])
+ self.expect(
+ "frame variable int_array --summary-string \"${*var[0-1]}\"",
+ substrs=['3'])
self.runCmd("type summary clear")
-
- self.runCmd('type summary add --summary-string \"${var[0-1]}\" -x \"int \[[0-9]\]\"')
+
+ self.runCmd(
+ 'type summary add --summary-string \"${var[0-1]}\" -x \"int \[[0-9]\]\"')
self.expect("frame variable int_array",
- substrs = ['1,2'])
+ substrs=['1,2'])
- self.runCmd('type summary add --summary-string \"${var[0-1]}\" "int []"')
+ self.runCmd(
+ 'type summary add --summary-string \"${var[0-1]}\" "int []"')
self.expect("frame variable int_array",
- substrs = ['1,2'])
+ substrs=['1,2'])
self.runCmd("type summary clear")
@@ -130,156 +144,179 @@ class AdvDataFormatterTestCase(TestBase):
self.runCmd("type summary add -c i_am_cool")
self.expect("frame variable cool_array",
- substrs = ['[0]',
- '[1]',
- '[2]',
- '[3]',
- '[4]',
- 'integer',
- 'character',
- 'floating'])
-
- self.runCmd("type summary add --summary-string \"int = ${*var.int_pointer}, float = ${*var.float_pointer}\" IWrapPointers")
+ substrs=['[0]',
+ '[1]',
+ '[2]',
+ '[3]',
+ '[4]',
+ 'integer',
+ 'character',
+ 'floating'])
+
+ self.runCmd(
+ "type summary add --summary-string \"int = ${*var.int_pointer}, float = ${*var.float_pointer}\" IWrapPointers")
self.expect("frame variable wrapper",
- substrs = ['int = 4',
- 'float = 1.1'])
+ substrs=['int = 4',
+ 'float = 1.1'])
+
+ self.runCmd(
+ "type summary add --summary-string \"low bits = ${*var.int_pointer[2]}\" IWrapPointers -p")
- self.runCmd("type summary add --summary-string \"low bits = ${*var.int_pointer[2]}\" IWrapPointers -p")
-
self.expect("frame variable wrapper",
- substrs = ['low bits = 1'])
-
+ substrs=['low bits = 1'])
+
self.expect("frame variable *wrap_pointer",
- substrs = ['low bits = 1'])
+ substrs=['low bits = 1'])
self.runCmd("type summary clear")
- self.expect("frame variable int_array --summary-string \"${var[0][0-2]%hex}\"",
- substrs = ['0x',
- '7'])
+ self.expect(
+ "frame variable int_array --summary-string \"${var[0][0-2]%hex}\"",
+ substrs=[
+ '0x',
+ '7'])
self.runCmd("type summary clear")
- self.runCmd("type summary add --summary-string \"${*var[].x[0-3]%hex} is a bitfield on a set of integers\" -x \"SimpleWithPointers \[[0-9]\]\"")
+ self.runCmd(
+ "type summary add --summary-string \"${*var[].x[0-3]%hex} is a bitfield on a set of integers\" -x \"SimpleWithPointers \[[0-9]\]\"")
- self.expect("frame variable couple --summary-string \"${*var.sp.x[0-2]} are low bits of integer ${*var.sp.x}. If I pretend it is an array I get ${var.sp.x[0-5]}\"",
- substrs = ['1 are low bits of integer 9.',
- 'If I pretend it is an array I get [9,'])
+ self.expect(
+ "frame variable couple --summary-string \"${*var.sp.x[0-2]} are low bits of integer ${*var.sp.x}. If I pretend it is an array I get ${var.sp.x[0-5]}\"",
+ substrs=[
+ '1 are low bits of integer 9.',
+ 'If I pretend it is an array I get [9,'])
# if the summary has an error, we still display the value
- self.expect("frame variable couple --summary-string \"${*var.sp.foo[0-2]\"",
- substrs = ['(Couple) couple = {','x = 0x','y = 0x','z = 0x','s = 0x'])
-
-
- self.runCmd("type summary add --summary-string \"${*var.sp.x[0-2]} are low bits of integer ${*var.sp.x}. If I pretend it is an array I get ${var.sp.x[0-5]}\" Couple")
+ self.expect(
+ "frame variable couple --summary-string \"${*var.sp.foo[0-2]\"",
+ substrs=[
+ '(Couple) couple = {',
+ 'x = 0x',
+ 'y = 0x',
+ 'z = 0x',
+ 's = 0x'])
+
+ self.runCmd(
+ "type summary add --summary-string \"${*var.sp.x[0-2]} are low bits of integer ${*var.sp.x}. If I pretend it is an array I get ${var.sp.x[0-5]}\" Couple")
self.expect("frame variable sparray",
- substrs = ['[0x0000000f,0x0000000c,0x00000009]'])
-
- # check that we can format a variable in a summary even if a format is defined for its datatype
+ substrs=['[0x0000000f,0x0000000c,0x00000009]'])
+
+ # check that we can format a variable in a summary even if a format is
+ # defined for its datatype
self.runCmd("type format add -f hex int")
- self.runCmd("type summary add --summary-string \"x=${var.x%d}\" Simple")
+ self.runCmd(
+ "type summary add --summary-string \"x=${var.x%d}\" Simple")
self.expect("frame variable a_simple_object",
- substrs = ['x=3'])
+ substrs=['x=3'])
self.expect("frame variable a_simple_object", matching=False,
- substrs = ['0x0'])
+ substrs=['0x0'])
# now check that the default is applied if we do not hand out a format
self.runCmd("type summary add --summary-string \"x=${var.x}\" Simple")
self.expect("frame variable a_simple_object", matching=False,
- substrs = ['x=3'])
+ substrs=['x=3'])
self.expect("frame variable a_simple_object", matching=True,
- substrs = ['x=0x00000003'])
+ substrs=['x=0x00000003'])
# check that we can correctly cap the number of children shown
self.runCmd("settings set target.max-children-count 5")
self.expect('frame variable a_long_guy', matching=True,
- substrs = ['a_1',
- 'b_1',
- 'c_1',
- 'd_1',
- 'e_1',
- '...'])
+ substrs=['a_1',
+ 'b_1',
+ 'c_1',
+ 'd_1',
+ 'e_1',
+ '...'])
# check that no further stuff is printed (not ALL values are checked!)
self.expect('frame variable a_long_guy', matching=False,
- substrs = ['f_1',
- 'g_1',
- 'h_1',
- 'i_1',
- 'j_1',
- 'q_1',
- 'a_2',
- 'f_2',
- 't_2',
- 'w_2'])
+ substrs=['f_1',
+ 'g_1',
+ 'h_1',
+ 'i_1',
+ 'j_1',
+ 'q_1',
+ 'a_2',
+ 'f_2',
+ 't_2',
+ 'w_2'])
self.runCmd("settings set target.max-children-count 1")
self.expect('frame variable a_long_guy', matching=True,
- substrs = ['a_1',
- '...'])
+ substrs=['a_1',
+ '...'])
self.expect('frame variable a_long_guy', matching=False,
- substrs = ['b_1',
- 'c_1',
- 'd_1',
- 'e_1'])
+ substrs=['b_1',
+ 'c_1',
+ 'd_1',
+ 'e_1'])
self.expect('frame variable a_long_guy', matching=False,
- substrs = ['f_1',
- 'g_1',
- 'h_1',
- 'i_1',
- 'j_1',
- 'q_1',
- 'a_2',
- 'f_2',
- 't_2',
- 'w_2'])
+ substrs=['f_1',
+ 'g_1',
+ 'h_1',
+ 'i_1',
+ 'j_1',
+ 'q_1',
+ 'a_2',
+ 'f_2',
+ 't_2',
+ 'w_2'])
self.runCmd("settings set target.max-children-count 30")
self.expect('frame variable a_long_guy', matching=True,
- substrs = ['a_1',
- 'b_1',
- 'c_1',
- 'd_1',
- 'e_1',
- 'z_1',
- 'a_2',
- 'b_2',
- 'c_2',
- 'd_2',
- '...'])
+ substrs=['a_1',
+ 'b_1',
+ 'c_1',
+ 'd_1',
+ 'e_1',
+ 'z_1',
+ 'a_2',
+ 'b_2',
+ 'c_2',
+ 'd_2',
+ '...'])
self.expect('frame variable a_long_guy', matching=False,
- substrs = ['e_2',
- 'n_2',
- 'r_2',
- 'i_2',
- 'k_2',
- 'o_2'])
-
- # override the cap
- self.expect('frame variable a_long_guy --show-all-children', matching=True,
- substrs = ['a_1',
- 'b_1',
- 'c_1',
- 'd_1',
- 'e_1',
- 'z_1',
- 'a_2',
- 'b_2',
- 'c_2',
- 'd_2'])
- self.expect('frame variable a_long_guy --show-all-children', matching=True,
- substrs = ['e_2',
- 'n_2',
- 'r_2',
- 'i_2',
- 'k_2',
- 'o_2'])
- self.expect('frame variable a_long_guy --show-all-children', matching=False,
- substrs = ['...'])
+ substrs=['e_2',
+ 'n_2',
+ 'r_2',
+ 'i_2',
+ 'k_2',
+ 'o_2'])
+
+ # override the cap
+ self.expect(
+ 'frame variable a_long_guy --show-all-children',
+ matching=True,
+ substrs=[
+ 'a_1',
+ 'b_1',
+ 'c_1',
+ 'd_1',
+ 'e_1',
+ 'z_1',
+ 'a_2',
+ 'b_2',
+ 'c_2',
+ 'd_2'])
+ self.expect(
+ 'frame variable a_long_guy --show-all-children',
+ matching=True,
+ substrs=[
+ 'e_2',
+ 'n_2',
+ 'r_2',
+ 'i_2',
+ 'k_2',
+ 'o_2'])
+ self.expect(
+ 'frame variable a_long_guy --show-all-children',
+ matching=False,
+ substrs=['...'])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py
index f8209f03d0c2..2d01eb79e188 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py
@@ -5,13 +5,14 @@ Test lldb data formatter subsystem.
from __future__ import print_function
-
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+
class CategoriesDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@@ -27,14 +28,15 @@ class CategoriesDataFormatterTestCase(TestBase):
self.build()
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
self.runCmd("run", RUN_SUCCEEDED)
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case (most of these categories do not
@@ -46,286 +48,312 @@ class CategoriesDataFormatterTestCase(TestBase):
self.runCmd('type category delete Category2', check=False)
self.runCmd('type category delete NewCategory', check=False)
self.runCmd("type category delete CircleCategory", check=False)
- self.runCmd("type category delete RectangleStarCategory", check=False)
+ self.runCmd(
+ "type category delete RectangleStarCategory",
+ check=False)
self.runCmd("type category delete BaseCategory", check=False)
-
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
# Add a summary to a new category and check that it works
- self.runCmd("type summary add Rectangle --summary-string \"ARectangle\" -w NewCategory")
+ self.runCmd(
+ "type summary add Rectangle --summary-string \"ARectangle\" -w NewCategory")
self.expect("frame variable r1 r2 r3", matching=False,
- substrs = ['r1 = ARectangle',
- 'r2 = ARectangle',
- 'r3 = ARectangle'])
-
+ substrs=['r1 = ARectangle',
+ 'r2 = ARectangle',
+ 'r3 = ARectangle'])
+
self.runCmd("type category enable NewCategory")
self.expect("frame variable r1 r2 r3", matching=True,
- substrs = ['r1 = ARectangle',
- 'r2 = ARectangle',
- 'r3 = ARectangle'])
-
+ substrs=['r1 = ARectangle',
+ 'r2 = ARectangle',
+ 'r3 = ARectangle'])
+
# Disable the category and check that the old stuff is there
self.runCmd("type category disable NewCategory")
self.expect("frame variable r1 r2 r3",
- substrs = ['r1 = {',
- 'r2 = {',
- 'r3 = {'])
+ substrs=['r1 = {',
+ 'r2 = {',
+ 'r3 = {'])
# Re-enable the category and check that it works
self.runCmd("type category enable NewCategory")
self.expect("frame variable r1 r2 r3",
- substrs = ['r1 = ARectangle',
- 'r2 = ARectangle',
- 'r3 = ARectangle'])
+ substrs=['r1 = ARectangle',
+ 'r2 = ARectangle',
+ 'r3 = ARectangle'])
# Delete the category and the old stuff should be there
self.runCmd("type category delete NewCategory")
self.expect("frame variable r1 r2 r3",
- substrs = ['r1 = {',
- 'r2 = {',
- 'r3 = {'])
-
- # Add summaries to two different categories and check that we can switch
- self.runCmd("type summary add --summary-string \"Width = ${var.w}, Height = ${var.h}\" Rectangle -w Category1")
+ substrs=['r1 = {',
+ 'r2 = {',
+ 'r3 = {'])
+
+ # Add summaries to two different categories and check that we can
+ # switch
+ self.runCmd(
+ "type summary add --summary-string \"Width = ${var.w}, Height = ${var.h}\" Rectangle -w Category1")
self.runCmd("type summary add --python-script \"return 'Area = ' + str( int(valobj.GetChildMemberWithName('w').GetValue()) * int(valobj.GetChildMemberWithName('h').GetValue()) );\" Rectangle -w Category2")
# check that enable A B is the same as enable B enable A
self.runCmd("type category enable Category1 Category2")
-
+
self.expect("frame variable r1 r2 r3",
- substrs = ['r1 = Width = ',
- 'r2 = Width = ',
- 'r3 = Width = '])
+ substrs=['r1 = Width = ',
+ 'r2 = Width = ',
+ 'r3 = Width = '])
self.runCmd("type category disable Category1")
self.expect("frame variable r1 r2 r3",
- substrs = ['r1 = Area = ',
- 'r2 = Area = ',
- 'r3 = Area = '])
+ substrs=['r1 = Area = ',
+ 'r2 = Area = ',
+ 'r3 = Area = '])
# switch again
self.runCmd("type category enable Category1")
self.expect("frame variable r1 r2 r3",
- substrs = ['r1 = Width = ',
- 'r2 = Width = ',
- 'r3 = Width = '])
+ substrs=['r1 = Width = ',
+ 'r2 = Width = ',
+ 'r3 = Width = '])
# Re-enable the category and show that the preference is persisted
self.runCmd("type category disable Category2")
self.runCmd("type category enable Category2")
-
+
self.expect("frame variable r1 r2 r3",
- substrs = ['r1 = Area = ',
- 'r2 = Area = ',
- 'r3 = Area = '])
+ substrs=['r1 = Area = ',
+ 'r2 = Area = ',
+ 'r3 = Area = '])
# Now delete the favorite summary
self.runCmd("type summary delete Rectangle -w Category2")
self.expect("frame variable r1 r2 r3",
- substrs = ['r1 = Width = ',
- 'r2 = Width = ',
- 'r3 = Width = '])
+ substrs=['r1 = Width = ',
+ 'r2 = Width = ',
+ 'r3 = Width = '])
# Delete the summary from the default category (that does not have it)
self.runCmd("type summary delete Rectangle", check=False)
self.expect("frame variable r1 r2 r3",
- substrs = ['r1 = Width = ',
- 'r2 = Width = ',
- 'r3 = Width = '])
+ substrs=['r1 = Width = ',
+ 'r2 = Width = ',
+ 'r3 = Width = '])
# Now add another summary to another category and switch back and forth
self.runCmd("type category delete Category1 Category2")
- self.runCmd("type summary add Rectangle -w Category1 --summary-string \"Category1\"")
- self.runCmd("type summary add Rectangle -w Category2 --summary-string \"Category2\"")
+ self.runCmd(
+ "type summary add Rectangle -w Category1 --summary-string \"Category1\"")
+ self.runCmd(
+ "type summary add Rectangle -w Category2 --summary-string \"Category2\"")
self.runCmd("type category enable Category2")
self.runCmd("type category enable Category1")
-
+
self.runCmd("type summary list -w Category1")
- self.expect("type summary list -w NoSuchCategoryHere", substrs=['no matching results found'])
-
+ self.expect("type summary list -w NoSuchCategoryHere",
+ substrs=['no matching results found'])
+
self.expect("frame variable r1 r2 r3",
- substrs = ['r1 = Category1',
- 'r2 = Category1',
- 'r3 = Category1'])
+ substrs=['r1 = Category1',
+ 'r2 = Category1',
+ 'r3 = Category1'])
self.runCmd("type category disable Category1")
self.expect("frame variable r1 r2 r3",
- substrs = ['r1 = Category2',
- 'r2 = Category2',
- 'r3 = Category2'])
+ substrs=['r1 = Category2',
+ 'r2 = Category2',
+ 'r3 = Category2'])
# Check that re-enabling an enabled category works
self.runCmd("type category enable Category1")
self.expect("frame variable r1 r2 r3",
- substrs = ['r1 = Category1',
- 'r2 = Category1',
- 'r3 = Category1'])
+ substrs=['r1 = Category1',
+ 'r2 = Category1',
+ 'r3 = Category1'])
self.runCmd("type category delete Category1")
self.runCmd("type category delete Category2")
self.expect("frame variable r1 r2 r3",
- substrs = ['r1 = {',
- 'r2 = {',
- 'r3 = {'])
-
- # Check that multiple summaries can go into one category
- self.runCmd("type summary add -w Category1 --summary-string \"Width = ${var.w}, Height = ${var.h}\" Rectangle")
- self.runCmd("type summary add -w Category1 --summary-string \"Radius = ${var.r}\" Circle")
-
+ substrs=['r1 = {',
+ 'r2 = {',
+ 'r3 = {'])
+
+ # Check that multiple summaries can go into one category
+ self.runCmd(
+ "type summary add -w Category1 --summary-string \"Width = ${var.w}, Height = ${var.h}\" Rectangle")
+ self.runCmd(
+ "type summary add -w Category1 --summary-string \"Radius = ${var.r}\" Circle")
+
self.runCmd("type category enable Category1")
self.expect("frame variable r1 r2 r3",
- substrs = ['r1 = Width = ',
- 'r2 = Width = ',
- 'r3 = Width = '])
+ substrs=['r1 = Width = ',
+ 'r2 = Width = ',
+ 'r3 = Width = '])
self.expect("frame variable c1 c2 c3",
- substrs = ['c1 = Radius = ',
- 'c2 = Radius = ',
- 'c3 = Radius = '])
+ substrs=['c1 = Radius = ',
+ 'c2 = Radius = ',
+ 'c3 = Radius = '])
self.runCmd("type summary delete Circle -w Category1")
-
+
self.expect("frame variable c1 c2 c3",
- substrs = ['c1 = {',
- 'c2 = {',
- 'c3 = {'])
+ substrs=['c1 = {',
+ 'c2 = {',
+ 'c3 = {'])
# Add a regex based summary to a category
- self.runCmd("type summary add -w Category1 --summary-string \"Radius = ${var.r}\" -x Circle")
+ self.runCmd(
+ "type summary add -w Category1 --summary-string \"Radius = ${var.r}\" -x Circle")
self.expect("frame variable r1 r2 r3",
- substrs = ['r1 = Width = ',
- 'r2 = Width = ',
- 'r3 = Width = '])
+ substrs=['r1 = Width = ',
+ 'r2 = Width = ',
+ 'r3 = Width = '])
self.expect("frame variable c1 c2 c3",
- substrs = ['c1 = Radius = ',
- 'c2 = Radius = ',
- 'c3 = Radius = '])
+ substrs=['c1 = Radius = ',
+ 'c2 = Radius = ',
+ 'c3 = Radius = '])
# Delete it
self.runCmd("type summary delete Circle -w Category1")
self.expect("frame variable c1 c2 c3",
- substrs = ['c1 = {',
- 'c2 = {',
- 'c3 = {'])
-
- # Change a summary inside a category and check that the change is reflected
- self.runCmd("type summary add Circle -w Category1 --summary-string \"summary1\"")
+ substrs=['c1 = {',
+ 'c2 = {',
+ 'c3 = {'])
+
+ # Change a summary inside a category and check that the change is
+ # reflected
+ self.runCmd(
+ "type summary add Circle -w Category1 --summary-string \"summary1\"")
self.expect("frame variable c1 c2 c3",
- substrs = ['c1 = summary1',
- 'c2 = summary1',
- 'c3 = summary1'])
+ substrs=['c1 = summary1',
+ 'c2 = summary1',
+ 'c3 = summary1'])
+
+ self.runCmd(
+ "type summary add Circle -w Category1 --summary-string \"summary2\"")
- self.runCmd("type summary add Circle -w Category1 --summary-string \"summary2\"")
-
self.expect("frame variable c1 c2 c3",
- substrs = ['c1 = summary2',
- 'c2 = summary2',
- 'c3 = summary2'])
+ substrs=['c1 = summary2',
+ 'c2 = summary2',
+ 'c3 = summary2'])
# Check that our order of priority works. Start by clearing categories
self.runCmd("type category delete Category1")
- self.runCmd("type summary add Shape -w BaseCategory --summary-string \"AShape\"")
+ self.runCmd(
+ "type summary add Shape -w BaseCategory --summary-string \"AShape\"")
self.runCmd("type category enable BaseCategory")
self.expect("print (Shape*)&c1",
- substrs = ['AShape'])
+ substrs=['AShape'])
self.expect("print (Shape*)&r1",
- substrs = ['AShape'])
+ substrs=['AShape'])
self.expect("print (Shape*)c_ptr",
- substrs = ['AShape'])
+ substrs=['AShape'])
self.expect("print (Shape*)r_ptr",
- substrs = ['AShape'])
+ substrs=['AShape'])
- self.runCmd("type summary add Circle -w CircleCategory --summary-string \"ACircle\"")
- self.runCmd("type summary add Rectangle -w RectangleCategory --summary-string \"ARectangle\"")
+ self.runCmd(
+ "type summary add Circle -w CircleCategory --summary-string \"ACircle\"")
+ self.runCmd(
+ "type summary add Rectangle -w RectangleCategory --summary-string \"ARectangle\"")
self.runCmd("type category enable CircleCategory")
self.expect("frame variable c1",
- substrs = ['ACircle'])
+ substrs=['ACircle'])
self.expect("frame variable c_ptr",
- substrs = ['ACircle'])
+ substrs=['ACircle'])
- self.runCmd("type summary add \"Rectangle *\" -w RectangleStarCategory --summary-string \"ARectangleStar\"")
+ self.runCmd(
+ "type summary add \"Rectangle *\" -w RectangleStarCategory --summary-string \"ARectangleStar\"")
self.runCmd("type category enable RectangleStarCategory")
self.expect("frame variable c1 r1 c_ptr r_ptr",
- substrs = ['ACircle',
- 'ARectangleStar'])
+ substrs=['ACircle',
+ 'ARectangleStar'])
self.runCmd("type category enable RectangleCategory")
self.expect("frame variable c1 r1 c_ptr r_ptr",
- substrs = ['ACircle',
- 'ACircle',
- 'ARectangle'])
+ substrs=['ACircle',
+ 'ACircle',
+ 'ARectangle'])
# Check that abruptly deleting an enabled category does not crash us
self.runCmd("type category delete RectangleCategory")
self.expect("frame variable c1 r1 c_ptr r_ptr",
- substrs = ['ACircle',
- '(Rectangle) r1 = ', 'w = 5', 'h = 6',
- 'ACircle',
- 'ARectangleStar'])
-
+ substrs=['ACircle',
+ '(Rectangle) r1 = ', 'w = 5', 'h = 6',
+ 'ACircle',
+ 'ARectangleStar'])
+
# check that list commands work
self.expect("type category list",
- substrs = ['RectangleStarCategory (enabled)'])
+ substrs=['RectangleStarCategory (enabled)'])
self.expect("type summary list",
- substrs = ['ARectangleStar'])
+ substrs=['ARectangleStar'])
# Disable a category and check that it fallsback
self.runCmd("type category disable CircleCategory")
-
+
# check that list commands work
self.expect("type category list",
- substrs = ['CircleCategory (disabled'])
+ substrs=['CircleCategory (disabled'])
self.expect("frame variable c1 r_ptr",
- substrs = ['AShape',
- 'ARectangleStar'])
+ substrs=['AShape',
+ 'ARectangleStar'])
# check that filters work into categories
- self.runCmd("type filter add Rectangle --child w --category RectangleCategory")
+ self.runCmd(
+ "type filter add Rectangle --child w --category RectangleCategory")
self.runCmd("type category enable RectangleCategory")
- self.runCmd("type summary add Rectangle --category RectangleCategory --summary-string \" \" -e")
+ self.runCmd(
+ "type summary add Rectangle --category RectangleCategory --summary-string \" \" -e")
self.expect('frame variable r2',
- substrs = ['w = 9'])
+ substrs=['w = 9'])
self.runCmd("type summary add Rectangle --summary-string \" \" -e")
self.expect('frame variable r2', matching=False,
- substrs = ['h = 16'])
+ substrs=['h = 16'])
# Now delete all categories
- self.runCmd("type category delete CircleCategory RectangleStarCategory BaseCategory RectangleCategory")
+ self.runCmd(
+ "type category delete CircleCategory RectangleStarCategory BaseCategory RectangleCategory")
# check that a deleted category with filter does not blow us up
self.expect('frame variable r2',
- substrs = ['w = 9',
- 'h = 16'])
+ substrs=['w = 9',
+ 'h = 16'])
# and also validate that one can print formatters for a language
- self.expect('type summary list -l c++', substrs=['vector', 'map', 'list', 'string'])
+ self.expect(
+ 'type summary list -l c++',
+ substrs=[
+ 'vector',
+ 'map',
+ 'list',
+ 'string'])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py
index 99443a04f672..0518a75051bb 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py
@@ -5,13 +5,14 @@ Test lldb data formatter subsystem.
from __future__ import print_function
-
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+
class CppDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@@ -22,24 +23,27 @@ class CppDataFormatterTestCase(TestBase):
# Find the line number to break at.
self.line = line_number('main.cpp', '// Set break point at this line.')
- @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24462: Data formatters have problems on Windows")
+ @expectedFailureAll(
+ oslist=["windows"],
+ bugnumber="llvm.org/pr24462: Data formatters have problems on Windows")
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
self.runCmd("run", RUN_SUCCEEDED)
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
self.expect("frame variable",
- substrs = ['(Speed) SPILookHex = 5.55' # Speed by default is 5.55.
- ]);
+ substrs=['(Speed) SPILookHex = 5.55' # Speed by default is 5.55.
+ ])
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
@@ -57,210 +61,238 @@ class CppDataFormatterTestCase(TestBase):
# The type format list should show our custom formats.
self.expect("type format list",
- substrs = ['RealNumber',
- 'Speed',
- 'BitField',
- 'Type1',
- 'Type2'])
+ substrs=['RealNumber',
+ 'Speed',
+ 'BitField',
+ 'Type1',
+ 'Type2'])
self.expect("frame variable",
- patterns = ['\(Speed\) SPILookHex = 0x[0-9a-f]+' # Speed should look hex-ish now.
- ]);
-
+ patterns=['\(Speed\) SPILookHex = 0x[0-9a-f]+' # Speed should look hex-ish now.
+ ])
+
# gcc4.2 on Mac OS X skips typedef chains in the DWARF output
- if self.getCompiler() in ['clang', 'llvm-gcc']:
+ if self.getCompiler() in ['clang', 'llvm-gcc']:
self.expect("frame variable",
- patterns = ['\(SignalMask\) SMILookHex = 0x[0-9a-f]+' # SignalMask should look hex-ish now.
- ]);
+ patterns=['\(SignalMask\) SMILookHex = 0x[0-9a-f]+' # SignalMask should look hex-ish now.
+ ])
self.expect("frame variable", matching=False,
- patterns = ['\(Type4\) T4ILookChar = 0x[0-9a-f]+' # Type4 should NOT look hex-ish now.
- ]);
-
+ patterns=['\(Type4\) T4ILookChar = 0x[0-9a-f]+' # Type4 should NOT look hex-ish now.
+ ])
+
# Now let's delete the 'Speed' custom format.
self.runCmd("type format delete Speed")
# The type format list should not show 'Speed' at this point.
self.expect("type format list", matching=False,
- substrs = ['Speed'])
+ substrs=['Speed'])
# Delete type format for 'Speed', we should expect an error message.
self.expect("type format delete Speed", error=True,
- substrs = ['no custom formatter for Speed'])
-
- self.runCmd("type summary add --summary-string \"arr = ${var%s}\" -x \"char \\[[0-9]+\\]\" -v")
-
+ substrs=['no custom formatter for Speed'])
+
+ self.runCmd(
+ "type summary add --summary-string \"arr = ${var%s}\" -x \"char \\[[0-9]+\\]\" -v")
+
self.expect("frame variable strarr",
- substrs = ['arr = "Hello world!"'])
-
+ substrs=['arr = "Hello world!"'])
+
self.runCmd("type summary clear")
-
- self.runCmd("type summary add --summary-string \"ptr = ${var%s}\" \"char *\" -v")
-
+
+ self.runCmd(
+ "type summary add --summary-string \"ptr = ${var%s}\" \"char *\" -v")
+
self.expect("frame variable strptr",
- substrs = ['ptr = "Hello world!"'])
-
- self.runCmd("type summary add --summary-string \"arr = ${var%s}\" -x \"char \\[[0-9]+\\]\" -v")
-
+ substrs=['ptr = "Hello world!"'])
+
+ self.runCmd(
+ "type summary add --summary-string \"arr = ${var%s}\" -x \"char \\[[0-9]+\\]\" -v")
+
self.expect("frame variable strarr",
- substrs = ['arr = "Hello world!'])
+ substrs=['arr = "Hello world!'])
- # check that rdar://problem/10011145 (Standard summary format for char[] doesn't work as the result of "expr".) is solved
+ # check that rdar://problem/10011145 (Standard summary format for
+ # char[] doesn't work as the result of "expr".) is solved
self.expect("p strarr",
- substrs = ['arr = "Hello world!'])
+ substrs=['arr = "Hello world!'])
self.expect("frame variable strptr",
- substrs = ['ptr = "Hello world!"'])
+ substrs=['ptr = "Hello world!"'])
self.expect("p strptr",
- substrs = ['ptr = "Hello world!"'])
+ substrs=['ptr = "Hello world!"'])
- self.expect("p (char*)\"1234567890123456789012345678901234567890123456789012345678901234ABC\"",
- substrs = ['(char *) $', ' = ptr = ', ' "1234567890123456789012345678901234567890123456789012345678901234ABC"'])
+ self.expect(
+ "p (char*)\"1234567890123456789012345678901234567890123456789012345678901234ABC\"",
+ substrs=[
+ '(char *) $',
+ ' = ptr = ',
+ ' "1234567890123456789012345678901234567890123456789012345678901234ABC"'])
self.runCmd("type summary add -c Point")
-
+
self.expect("frame variable iAmSomewhere",
- substrs = ['x = 4',
- 'y = 6'])
-
+ substrs=['x = 4',
+ 'y = 6'])
+
self.expect("type summary list",
- substrs = ['Point',
- 'one-line'])
+ substrs=['Point',
+ 'one-line'])
self.runCmd("type summary add --summary-string \"y=${var.y%x}\" Point")
self.expect("frame variable iAmSomewhere",
- substrs = ['y=0x'])
-
- self.runCmd("type summary add --summary-string \"y=${var.y},x=${var.x}\" Point")
-
+ substrs=['y=0x'])
+
+ self.runCmd(
+ "type summary add --summary-string \"y=${var.y},x=${var.x}\" Point")
+
self.expect("frame variable iAmSomewhere",
- substrs = ['y=6',
- 'x=4'])
+ substrs=['y=6',
+ 'x=4'])
self.runCmd("type summary add --summary-string \"hello\" Point -e")
self.expect("type summary list",
- substrs = ['Point',
- 'show children'])
-
+ substrs=['Point',
+ 'show children'])
+
self.expect("frame variable iAmSomewhere",
- substrs = ['hello',
- 'x = 4',
- '}'])
+ substrs=['hello',
+ 'x = 4',
+ '}'])
- self.runCmd("type summary add --summary-string \"Sign: ${var[31]%B} Exponent: ${var[23-30]%x} Mantissa: ${var[0-22]%u}\" ShowMyGuts")
+ self.runCmd(
+ "type summary add --summary-string \"Sign: ${var[31]%B} Exponent: ${var[23-30]%x} Mantissa: ${var[0-22]%u}\" ShowMyGuts")
self.expect("frame variable cool_pointer->floating",
- substrs = ['Sign: true',
- 'Exponent: 0x',
- '80'])
+ substrs=['Sign: true',
+ 'Exponent: 0x',
+ '80'])
self.runCmd("type summary add --summary-string \"a test\" i_am_cool")
self.expect("frame variable cool_pointer",
- substrs = ['a test'])
+ substrs=['a test'])
+
+ self.runCmd(
+ "type summary add --summary-string \"a test\" i_am_cool --skip-pointers")
- self.runCmd("type summary add --summary-string \"a test\" i_am_cool --skip-pointers")
-
self.expect("frame variable cool_pointer",
- substrs = ['a test'],
- matching = False)
+ substrs=['a test'],
+ matching=False)
- self.runCmd("type summary add --summary-string \"${var[1-3]}\" \"int [5]\"")
+ self.runCmd(
+ "type summary add --summary-string \"${var[1-3]}\" \"int [5]\"")
self.expect("frame variable int_array",
- substrs = ['2',
- '3',
- '4'])
+ substrs=['2',
+ '3',
+ '4'])
self.runCmd("type summary clear")
- self.runCmd("type summary add --summary-string \"${var[0-2].integer}\" \"i_am_cool *\"")
- self.runCmd("type summary add --summary-string \"${var[2-4].integer}\" \"i_am_cool [5]\"")
+ self.runCmd(
+ "type summary add --summary-string \"${var[0-2].integer}\" \"i_am_cool *\"")
+ self.runCmd(
+ "type summary add --summary-string \"${var[2-4].integer}\" \"i_am_cool [5]\"")
self.expect("frame variable cool_array",
- substrs = ['1,1,6'])
+ substrs=['1,1,6'])
self.expect("frame variable cool_pointer",
- substrs = ['3,0,0'])
+ substrs=['3,0,0'])
# test special symbols for formatting variables into summaries
- self.runCmd("type summary add --summary-string \"cool object @ ${var%L}\" i_am_cool")
+ self.runCmd(
+ "type summary add --summary-string \"cool object @ ${var%L}\" i_am_cool")
self.runCmd("type summary delete \"i_am_cool [5]\"")
-
+
# this test might fail if the compiler tries to store
# these values into registers.. hopefully this is not
# going to be the case
self.expect("frame variable cool_array",
- substrs = ['[0] = cool object @ 0x',
- '[1] = cool object @ 0x',
- '[2] = cool object @ 0x',
- '[3] = cool object @ 0x',
- '[4] = cool object @ 0x'])
-
- # test getting similar output by exploiting ${var} = 'type @ location' for aggregates
+ substrs=['[0] = cool object @ 0x',
+ '[1] = cool object @ 0x',
+ '[2] = cool object @ 0x',
+ '[3] = cool object @ 0x',
+ '[4] = cool object @ 0x'])
+
+ # test getting similar output by exploiting ${var} = 'type @ location'
+ # for aggregates
self.runCmd("type summary add --summary-string \"${var}\" i_am_cool")
-
+
# this test might fail if the compiler tries to store
# these values into registers.. hopefully this is not
# going to be the case
self.expect("frame variable cool_array",
- substrs = ['[0] = i_am_cool @ 0x',
- '[1] = i_am_cool @ 0x',
- '[2] = i_am_cool @ 0x',
- '[3] = i_am_cool @ 0x',
- '[4] = i_am_cool @ 0x'])
-
-
- # test getting same output by exploiting %T and %L together for aggregates
- self.runCmd("type summary add --summary-string \"${var%T} @ ${var%L}\" i_am_cool")
-
+ substrs=['[0] = i_am_cool @ 0x',
+ '[1] = i_am_cool @ 0x',
+ '[2] = i_am_cool @ 0x',
+ '[3] = i_am_cool @ 0x',
+ '[4] = i_am_cool @ 0x'])
+
+ # test getting same output by exploiting %T and %L together for
+ # aggregates
+ self.runCmd(
+ "type summary add --summary-string \"${var%T} @ ${var%L}\" i_am_cool")
+
# this test might fail if the compiler tries to store
# these values into registers.. hopefully this is not
# going to be the case
self.expect("frame variable cool_array",
- substrs = ['[0] = i_am_cool @ 0x',
- '[1] = i_am_cool @ 0x',
- '[2] = i_am_cool @ 0x',
- '[3] = i_am_cool @ 0x',
- '[4] = i_am_cool @ 0x'])
-
+ substrs=['[0] = i_am_cool @ 0x',
+ '[1] = i_am_cool @ 0x',
+ '[2] = i_am_cool @ 0x',
+ '[3] = i_am_cool @ 0x',
+ '[4] = i_am_cool @ 0x'])
+
self.runCmd("type summary add --summary-string \"goofy\" i_am_cool")
- self.runCmd("type summary add --summary-string \"${var.second_cool%S}\" i_am_cooler")
+ self.runCmd(
+ "type summary add --summary-string \"${var.second_cool%S}\" i_am_cooler")
self.expect("frame variable the_coolest_guy",
- substrs = ['(i_am_cooler) the_coolest_guy = goofy'])
+ substrs=['(i_am_cooler) the_coolest_guy = goofy'])
# check that unwanted type specifiers are removed
self.runCmd("type summary delete i_am_cool")
- self.runCmd("type summary add --summary-string \"goofy\" \"class i_am_cool\"")
+ self.runCmd(
+ "type summary add --summary-string \"goofy\" \"class i_am_cool\"")
self.expect("frame variable the_coolest_guy",
- substrs = ['(i_am_cooler) the_coolest_guy = goofy'])
+ substrs=['(i_am_cooler) the_coolest_guy = goofy'])
self.runCmd("type summary delete i_am_cool")
- self.runCmd("type summary add --summary-string \"goofy\" \"enum i_am_cool\"")
+ self.runCmd(
+ "type summary add --summary-string \"goofy\" \"enum i_am_cool\"")
self.expect("frame variable the_coolest_guy",
- substrs = ['(i_am_cooler) the_coolest_guy = goofy'])
+ substrs=['(i_am_cooler) the_coolest_guy = goofy'])
self.runCmd("type summary delete i_am_cool")
- self.runCmd("type summary add --summary-string \"goofy\" \"struct i_am_cool\"")
+ self.runCmd(
+ "type summary add --summary-string \"goofy\" \"struct i_am_cool\"")
self.expect("frame variable the_coolest_guy",
- substrs = ['(i_am_cooler) the_coolest_guy = goofy'])
+ substrs=['(i_am_cooler) the_coolest_guy = goofy'])
# many spaces, but we still do the right thing
self.runCmd("type summary delete i_am_cool")
- self.runCmd("type summary add --summary-string \"goofy\" \"union i_am_cool\"")
+ self.runCmd(
+ "type summary add --summary-string \"goofy\" \"union i_am_cool\"")
self.expect("frame variable the_coolest_guy",
- substrs = ['(i_am_cooler) the_coolest_guy = goofy'])
+ substrs=['(i_am_cooler) the_coolest_guy = goofy'])
# but that not *every* specifier is removed
self.runCmd("type summary delete i_am_cool")
- self.runCmd("type summary add --summary-string \"goofy\" \"wrong i_am_cool\"")
+ self.runCmd(
+ "type summary add --summary-string \"goofy\" \"wrong i_am_cool\"")
self.expect("frame variable the_coolest_guy", matching=False,
- substrs = ['(i_am_cooler) the_coolest_guy = goofy'])
-
- # check that formats are not sticking since that is the behavior we want
- self.expect("frame variable iAmInt --format hex", substrs = ['(int) iAmInt = 0x00000001'])
- self.expect("frame variable iAmInt", matching=False, substrs = ['(int) iAmInt = 0x00000001'])
- self.expect("frame variable iAmInt", substrs = ['(int) iAmInt = 1'])
+ substrs=['(i_am_cooler) the_coolest_guy = goofy'])
+
+ # check that formats are not sticking since that is the behavior we
+ # want
+ self.expect("frame variable iAmInt --format hex",
+ substrs=['(int) iAmInt = 0x00000001'])
+ self.expect(
+ "frame variable iAmInt",
+ matching=False,
+ substrs=['(int) iAmInt = 0x00000001'])
+ self.expect("frame variable iAmInt", substrs=['(int) iAmInt = 1'])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-disabling/TestDataFormatterDisabling.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-disabling/TestDataFormatterDisabling.py
index 2c2e08431175..e192943f381e 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-disabling/TestDataFormatterDisabling.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-disabling/TestDataFormatterDisabling.py
@@ -5,13 +5,14 @@ Test lldb data formatter subsystem.
from __future__ import print_function
-
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+
class DataFormatterDisablingTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@@ -22,62 +23,69 @@ class DataFormatterDisablingTestCase(TestBase):
# Find the line number to break at.
self.line = line_number('main.cpp', '// Set break point at this line.')
- @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24462, Data formatters have problems on Windows")
+ @expectedFailureAll(
+ oslist=["windows"],
+ bugnumber="llvm.org/pr24462, Data formatters have problems on Windows")
def test_with_run_command(self):
"""Check that we can properly disable all data formatter categories."""
self.build()
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
self.runCmd("run", RUN_SUCCEEDED)
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
def cleanup():
- self.runCmd('type category enable *', check=False)
+ self.runCmd('type category enable *', check=False)
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
#self.runCmd('type category enable system VectorTypes libcxx gnu-libstdc++ CoreGraphics CoreServices AppKit CoreFoundation objc default', check=False)
- self.expect('type category list', substrs = ['system','enabled',])
+ self.expect('type category list', substrs=['system', 'enabled', ])
self.expect("frame variable numbers",
- substrs = ['[0] = 1', '[3] = 1234'])
+ substrs=['[0] = 1', '[3] = 1234'])
- self.expect('frame variable string1', substrs = ['hello world'])
+ self.expect('frame variable string1', substrs=['hello world'])
# now disable them all and check that nothing is formatted
self.runCmd('type category disable *')
self.expect("frame variable numbers", matching=False,
- substrs = ['[0] = 1', '[3] = 1234'])
+ substrs=['[0] = 1', '[3] = 1234'])
+
+ self.expect(
+ 'frame variable string1',
+ matching=False,
+ substrs=['hello world'])
- self.expect('frame variable string1', matching=False, substrs = ['hello world'])
+ self.expect('type summary list', substrs=[
+ 'Category: system (disabled)'])
- self.expect('type summary list', substrs=['Category: system (disabled)'])
+ self.expect('type category list', substrs=['system', 'disabled', ])
- self.expect('type category list', substrs = ['system','disabled',])
-
# now enable and check that we are back to normal
self.runCmd("type category enable *")
- self.expect('type category list', substrs = ['system','enabled'])
+ self.expect('type category list', substrs=['system', 'enabled'])
self.expect("frame variable numbers",
- substrs = ['[0] = 1', '[3] = 1234'])
+ substrs=['[0] = 1', '[3] = 1234'])
- self.expect('frame variable string1', substrs = ['hello world'])
+ self.expect('frame variable string1', substrs=['hello world'])
- self.expect('type category list', substrs = ['system','enabled'])
+ self.expect('type category list', substrs=['system', 'enabled'])
# last check - our cleanup will re-enable everything
self.runCmd('type category disable *')
- self.expect('type category list', substrs = ['system','disabled'])
+ self.expect('type category list', substrs=['system', 'disabled'])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-enum-format/TestDataFormatterEnumFormat.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-enum-format/TestDataFormatterEnumFormat.py
index 1659ade74a06..710cfa8fe12c 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-enum-format/TestDataFormatterEnumFormat.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-enum-format/TestDataFormatterEnumFormat.py
@@ -5,12 +5,13 @@ Test lldb data formatter subsystem.
from __future__ import print_function
-
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.lldbtest import *
import lldbsuite.test.lldbutil as lldbutil
+
class EnumFormatTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@@ -26,21 +27,22 @@ class EnumFormatTestCase(TestBase):
self.build()
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
self.runCmd("run", RUN_SUCCEEDED)
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
self.expect("frame variable",
- substrs = ['(Foo) f = Case45',
- '(int) x = 1',
- '(int) y = 45',
- '(int) z = 43'
- ]);
+ substrs=['(Foo) f = Case45',
+ '(int) x = 1',
+ '(int) y = 45',
+ '(int) z = 43'
+ ])
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
@@ -55,11 +57,11 @@ class EnumFormatTestCase(TestBase):
# The type format list should show our custom formats.
self.expect("type format list -w default",
- substrs = ['int: as type Foo'])
+ substrs=['int: as type Foo'])
self.expect("frame variable",
- substrs = ['(Foo) f = Case45',
- '(int) x = Case1',
- '(int) y = Case45',
- '(int) z = 43'
- ]);
+ substrs=['(Foo) f = Case45',
+ '(int) x = Case1',
+ '(int) y = Case45',
+ '(int) z = 43'
+ ])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-globals/TestDataFormatterGlobals.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-globals/TestDataFormatterGlobals.py
index df3bef091c89..d3d93dabc7fb 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-globals/TestDataFormatterGlobals.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-globals/TestDataFormatterGlobals.py
@@ -5,12 +5,13 @@ Test lldb data formatter subsystem.
from __future__ import print_function
-
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.lldbtest import *
import lldbsuite.test.lldbutil as lldbutil
+
class GlobalsDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@@ -26,7 +27,8 @@ class GlobalsDataFormatterTestCase(TestBase):
self.build()
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
@@ -41,27 +43,29 @@ class GlobalsDataFormatterTestCase(TestBase):
# Simply check we can get at global variables
self.expect("target variable g_point",
- substrs = ['JustATest'])
+ substrs=['JustATest'])
self.expect("target variable g_point_pointer",
- substrs = ['(Point *) g_point_pointer ='])
+ substrs=['(Point *) g_point_pointer ='])
# Print some information about the variables
# (we ignore the actual values)
- self.runCmd("type summary add --summary-string \"(x=${var.x},y=${var.y})\" Point")
+ self.runCmd(
+ "type summary add --summary-string \"(x=${var.x},y=${var.y})\" Point")
self.expect("target variable g_point",
- substrs = ['x=',
- 'y='])
-
+ substrs=['x=',
+ 'y='])
+
self.expect("target variable g_point_pointer",
- substrs = ['(Point *) g_point_pointer ='])
+ substrs=['(Point *) g_point_pointer ='])
# Test Python code on resulting SBValue
- self.runCmd("type summary add --python-script \"return 'x=' + str(valobj.GetChildMemberWithName('x').GetValue());\" Point")
+ self.runCmd(
+ "type summary add --python-script \"return 'x=' + str(valobj.GetChildMemberWithName('x').GetValue());\" Point")
self.expect("target variable g_point",
- substrs = ['x='])
-
+ substrs=['x='])
+
self.expect("target variable g_point_pointer",
- substrs = ['(Point *) g_point_pointer ='])
+ substrs=['(Point *) g_point_pointer ='])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-named-summaries/TestDataFormatterNamedSummaries.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-named-summaries/TestDataFormatterNamedSummaries.py
index e9ac79ad08e2..f4f0a4859896 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-named-summaries/TestDataFormatterNamedSummaries.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-named-summaries/TestDataFormatterNamedSummaries.py
@@ -5,12 +5,13 @@ Test lldb data formatter subsystem.
from __future__ import print_function
-
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.lldbtest import *
import lldbsuite.test.lldbutil as lldbutil
+
class NamedSummariesDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@@ -26,15 +27,16 @@ class NamedSummariesDataFormatterTestCase(TestBase):
self.build()
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
self.runCmd("run", RUN_SUCCEEDED)
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
-
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
+
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
def cleanup():
@@ -44,81 +46,88 @@ class NamedSummariesDataFormatterTestCase(TestBase):
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
- self.runCmd("type summary add --summary-string \"AllUseIt: x=${var.x} {y=${var.y}} {z=${var.z}}\" --name AllUseIt")
- self.runCmd("type summary add --summary-string \"First: x=${var.x} y=${var.y} dummy=${var.dummy}\" First")
- self.runCmd("type summary add --summary-string \"Second: x=${var.x} y=${var.y%hex}\" Second")
- self.runCmd("type summary add --summary-string \"Third: x=${var.x} z=${var.z}\" Third")
-
+ self.runCmd(
+ "type summary add --summary-string \"AllUseIt: x=${var.x} {y=${var.y}} {z=${var.z}}\" --name AllUseIt")
+ self.runCmd(
+ "type summary add --summary-string \"First: x=${var.x} y=${var.y} dummy=${var.dummy}\" First")
+ self.runCmd(
+ "type summary add --summary-string \"Second: x=${var.x} y=${var.y%hex}\" Second")
+ self.runCmd(
+ "type summary add --summary-string \"Third: x=${var.x} z=${var.z}\" Third")
+
self.expect('type summary list', substrs=['AllUseIt'])
-
+
self.expect("frame variable first",
- substrs = ['First: x=12'])
+ substrs=['First: x=12'])
self.expect("frame variable first --summary AllUseIt",
- substrs = ['AllUseIt: x=12'])
-
+ substrs=['AllUseIt: x=12'])
+
# We *DO NOT* remember the summary choice anymore
self.expect("frame variable first", matching=False,
- substrs = ['AllUseIt: x=12'])
+ substrs=['AllUseIt: x=12'])
self.expect("frame variable first",
- substrs = ['First: x=12'])
+ substrs=['First: x=12'])
+
+ self.runCmd("thread step-over") # 2
- self.runCmd("thread step-over") # 2
-
self.expect("frame variable first",
- substrs = ['First: x=12'])
-
+ substrs=['First: x=12'])
+
self.expect("frame variable first --summary AllUseIt",
- substrs = ['AllUseIt: x=12',
- 'y=34'])
+ substrs=['AllUseIt: x=12',
+ 'y=34'])
self.expect("frame variable second --summary AllUseIt",
- substrs = ['AllUseIt: x=65',
- 'y=43.25'])
+ substrs=['AllUseIt: x=65',
+ 'y=43.25'])
self.expect("frame variable third --summary AllUseIt",
- substrs = ['AllUseIt: x=96',
- 'z=',
- 'E'])
+ substrs=['AllUseIt: x=96',
+ 'z=',
+ 'E'])
+
+ self.runCmd("thread step-over") # 3
- self.runCmd("thread step-over") # 3
-
self.expect("frame variable second",
- substrs = ['Second: x=65',
- 'y=0x'])
-
+ substrs=['Second: x=65',
+ 'y=0x'])
+
# <rdar://problem/11576143> decided that invalid summaries will raise an error
# instead of just defaulting to the base summary
- self.expect("frame variable second --summary NoSuchSummary",error=True,
- substrs = ['must specify a valid named summary'])
-
+ self.expect(
+ "frame variable second --summary NoSuchSummary",
+ error=True,
+ substrs=['must specify a valid named summary'])
+
self.runCmd("thread step-over")
-
- self.runCmd("type summary add --summary-string \"FirstAndFriends: x=${var.x} {y=${var.y}} {z=${var.z}}\" First --name FirstAndFriends")
-
+
+ self.runCmd(
+ "type summary add --summary-string \"FirstAndFriends: x=${var.x} {y=${var.y}} {z=${var.z}}\" First --name FirstAndFriends")
+
self.expect("frame variable first",
- substrs = ['FirstAndFriends: x=12',
- 'y=34'])
+ substrs=['FirstAndFriends: x=12',
+ 'y=34'])
self.runCmd("type summary delete First")
-
+
self.expect("frame variable first --summary FirstAndFriends",
- substrs = ['FirstAndFriends: x=12',
- 'y=34'])
-
+ substrs=['FirstAndFriends: x=12',
+ 'y=34'])
+
self.expect("frame variable first", matching=True,
- substrs = ['x = 12',
- 'y = 34'])
-
+ substrs=['x = 12',
+ 'y = 34'])
+
self.runCmd("type summary delete FirstAndFriends")
self.expect("type summary delete NoSuchSummary", error=True)
self.runCmd("type summary delete AllUseIt")
-
+
self.expect("frame variable first", matching=False,
- substrs = ['FirstAndFriends'])
+ substrs=['FirstAndFriends'])
- self.runCmd("thread step-over") # 4
+ self.runCmd("thread step-over") # 4
- self.expect("frame variable first",matching=False,
- substrs = ['FirstAndFriends: x=12',
- 'y=34'])
+ self.expect("frame variable first", matching=False,
+ substrs=['FirstAndFriends: x=12',
+ 'y=34'])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py
index d7d4118d1d6a..d0a1728b87e6 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py
@@ -6,14 +6,15 @@ Test lldb data formatter subsystem.
from __future__ import print_function
-
import datetime
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+
class ObjCDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@@ -24,7 +25,7 @@ class ObjCDataFormatterTestCase(TestBase):
self.build()
self.plain_data_formatter_commands()
- def appkit_tester_impl(self,commands):
+ def appkit_tester_impl(self, commands):
self.build()
self.appkit_common_data_formatters_command()
commands()
@@ -49,25 +50,21 @@ class ObjCDataFormatterTestCase(TestBase):
"""Test formatters for NSURL."""
self.appkit_tester_impl(self.nsurl_data_formatter_commands)
-
@skipUnlessDarwin
def test_nserror_with_run_command(self):
"""Test formatters for NSError."""
self.appkit_tester_impl(self.nserror_data_formatter_commands)
-
@skipUnlessDarwin
def test_nsbundle_with_run_command(self):
"""Test formatters for NSBundle."""
self.appkit_tester_impl(self.nsbundle_data_formatter_commands)
-
@skipUnlessDarwin
def test_nsexception_with_run_command(self):
"""Test formatters for NSException."""
self.appkit_tester_impl(self.nsexception_data_formatter_commands)
-
@skipUnlessDarwin
def test_nsdate_with_run_command(self):
"""Test formatters for NSDate."""
@@ -101,14 +98,15 @@ class ObjCDataFormatterTestCase(TestBase):
"""Test basic ObjC formatting behavior."""
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_file_and_line (self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
self.runCmd("run", RUN_SUCCEEDED)
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
@@ -123,57 +121,58 @@ class ObjCDataFormatterTestCase(TestBase):
self.runCmd("type summary add --summary-string \"${var%@}\" MyClass")
self.expect("frame variable object2",
- substrs = ['MyOtherClass']);
-
+ substrs=['MyOtherClass'])
+
self.expect("frame variable *object2",
- substrs = ['MyOtherClass']);
+ substrs=['MyOtherClass'])
# Now let's delete the 'MyClass' custom summary.
self.runCmd("type summary delete MyClass")
# The type format list should not show 'MyClass' at this point.
self.expect("type summary list", matching=False,
- substrs = ['MyClass'])
+ substrs=['MyClass'])
self.runCmd("type summary add --summary-string \"a test\" MyClass")
-
+
self.expect("frame variable *object2",
- substrs = ['*object2 =',
- 'MyClass = a test',
- 'backup = ']);
-
+ substrs=['*object2 =',
+ 'MyClass = a test',
+ 'backup = '])
+
self.expect("frame variable object2", matching=False,
- substrs = ['a test']);
-
+ substrs=['a test'])
+
self.expect("frame variable object",
- substrs = ['a test']);
-
+ substrs=['a test'])
+
self.expect("frame variable *object",
- substrs = ['a test']);
+ substrs=['a test'])
self.expect('frame variable myclass',
- substrs = ['(Class) myclass = NSValue'])
+ substrs=['(Class) myclass = NSValue'])
self.expect('frame variable myclass2',
- substrs = ['(Class) myclass2 = ','NS','String'])
+ substrs=['(Class) myclass2 = ', 'NS', 'String'])
self.expect('frame variable myclass3',
- substrs = ['(Class) myclass3 = Molecule'])
+ substrs=['(Class) myclass3 = Molecule'])
self.expect('frame variable myclass4',
- substrs = ['(Class) myclass4 = NSMutableArray'])
+ substrs=['(Class) myclass4 = NSMutableArray'])
self.expect('frame variable myclass5',
- substrs = ['(Class) myclass5 = nil'])
+ substrs=['(Class) myclass5 = nil'])
def appkit_common_data_formatters_command(self):
"""Test formatters for AppKit classes."""
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_file_and_line (self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
self.runCmd("run", RUN_SUCCEEDED)
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
@@ -184,132 +183,183 @@ class ObjCDataFormatterTestCase(TestBase):
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
-
+
def nsnumber_data_formatter_commands(self):
# Now enable AppKit and check we are displaying Cocoa classes correctly
self.expect('frame variable num1 num2 num3 num4 num5 num6 num7 num9',
- substrs = ['(NSNumber *) num1 = ',' (int)5',
- '(NSNumber *) num2 = ',' (float)3.1',
- '(NSNumber *) num3 = ',' (double)3.14',
- '(NSNumber *) num4 = ',' (long)-2',
- '(NSNumber *) num5 = ',' (char)65',
- '(NSNumber *) num6 = ',' (long)255',
- '(NSNumber *) num7 = ','2000000',
- '(NSNumber *) num9 = ',' (short)-31616'])
+ substrs=['(NSNumber *) num1 = ', ' (int)5',
+ '(NSNumber *) num2 = ', ' (float)3.1',
+ '(NSNumber *) num3 = ', ' (double)3.14',
+ '(NSNumber *) num4 = ', ' (long)-2',
+ '(NSNumber *) num5 = ', ' (char)65',
+ '(NSNumber *) num6 = ', ' (long)255',
+ '(NSNumber *) num7 = ', '2000000',
+ '(NSNumber *) num9 = ', ' (short)-31616'])
self.expect('frame variable num_at1 num_at2 num_at3 num_at4',
- substrs = ['(NSNumber *) num_at1 = ',' (int)12',
- '(NSNumber *) num_at2 = ',' (int)-12',
- '(NSNumber *) num_at3 = ',' (double)12.5',
- '(NSNumber *) num_at4 = ',' (double)-12.5'])
+ substrs=['(NSNumber *) num_at1 = ', ' (int)12',
+ '(NSNumber *) num_at2 = ', ' (int)-12',
+ '(NSNumber *) num_at3 = ', ' (double)12.5',
+ '(NSNumber *) num_at4 = ', ' (double)-12.5'])
def nscontainers_data_formatter_commands(self):
- self.expect('frame variable newArray newDictionary newMutableDictionary cfarray_ref mutable_array_ref',
- substrs = ['(NSArray *) newArray = ','@"50 elements"',
- '(NSDictionary *) newDictionary = ',' 12 key/value pairs',
- '(NSDictionary *) newMutableDictionary = ',' 21 key/value pairs',
- '(CFArrayRef) cfarray_ref = ','@"3 elements"',
- '(CFMutableArrayRef) mutable_array_ref = ','@"11 elements"'])
+ self.expect(
+ 'frame variable newArray newDictionary newMutableDictionary cfarray_ref mutable_array_ref',
+ substrs=[
+ '(NSArray *) newArray = ',
+ '@"50 elements"',
+ '(NSDictionary *) newDictionary = ',
+ ' 12 key/value pairs',
+ '(NSDictionary *) newMutableDictionary = ',
+ ' 21 key/value pairs',
+ '(CFArrayRef) cfarray_ref = ',
+ '@"3 elements"',
+ '(CFMutableArrayRef) mutable_array_ref = ',
+ '@"11 elements"'])
self.expect('frame variable iset1 iset2 imset',
- substrs = ['4 indexes','512 indexes','10 indexes'])
+ substrs=['4 indexes', '512 indexes', '10 indexes'])
- self.expect('frame variable binheap_ref',
- substrs = ['(CFBinaryHeapRef) binheap_ref = ','@"21 items"'])
+ self.expect(
+ 'frame variable binheap_ref',
+ substrs=[
+ '(CFBinaryHeapRef) binheap_ref = ',
+ '@"21 items"'])
- self.expect('expression -d run -- [NSArray new]', substrs=['@"0 elements"'])
+ self.expect(
+ 'expression -d run -- (NSArray*)[NSArray new]',
+ substrs=['@"0 elements"'])
def nsdata_data_formatter_commands(self):
- self.expect('frame variable immutableData mutableData data_ref mutable_data_ref mutable_string_ref',
- substrs = ['(NSData *) immutableData = ',' 4 bytes',
- '(NSData *) mutableData = ',' 14 bytes',
- '(CFDataRef) data_ref = ','@"5 bytes"',
- '(CFMutableDataRef) mutable_data_ref = ','@"5 bytes"',
- '(CFMutableStringRef) mutable_string_ref = ',' @"Wish ya knew"'])
+ self.expect(
+ 'frame variable immutableData mutableData data_ref mutable_data_ref mutable_string_ref',
+ substrs=[
+ '(NSData *) immutableData = ',
+ ' 4 bytes',
+ '(NSData *) mutableData = ',
+ ' 14 bytes',
+ '(CFDataRef) data_ref = ',
+ '@"5 bytes"',
+ '(CFMutableDataRef) mutable_data_ref = ',
+ '@"5 bytes"',
+ '(CFMutableStringRef) mutable_string_ref = ',
+ ' @"Wish ya knew"'])
def nsurl_data_formatter_commands(self):
- self.expect('frame variable cfurl_ref cfchildurl_ref cfgchildurl_ref',
- substrs = ['(CFURLRef) cfurl_ref = ','@"http://www.foo.bar',
- 'cfchildurl_ref = ','@"page.html -- http://www.foo.bar',
- '(CFURLRef) cfgchildurl_ref = ','@"?whatever -- http://www.foo.bar/page.html"'])
-
- self.expect('frame variable nsurl nsurl2 nsurl3',
- substrs = ['(NSURL *) nsurl = ','@"http://www.foo.bar',
- '(NSURL *) nsurl2 =','@"page.html -- http://www.foo.bar',
- '(NSURL *) nsurl3 = ','@"?whatever -- http://www.foo.bar/page.html"'])
+ self.expect(
+ 'frame variable cfurl_ref cfchildurl_ref cfgchildurl_ref',
+ substrs=[
+ '(CFURLRef) cfurl_ref = ',
+ '@"http://www.foo.bar',
+ 'cfchildurl_ref = ',
+ '@"page.html -- http://www.foo.bar',
+ '(CFURLRef) cfgchildurl_ref = ',
+ '@"?whatever -- http://www.foo.bar/page.html"'])
+
+ self.expect(
+ 'frame variable nsurl nsurl2 nsurl3',
+ substrs=[
+ '(NSURL *) nsurl = ',
+ '@"http://www.foo.bar',
+ '(NSURL *) nsurl2 =',
+ '@"page.html -- http://www.foo.bar',
+ '(NSURL *) nsurl3 = ',
+ '@"?whatever -- http://www.foo.bar/page.html"'])
def nserror_data_formatter_commands(self):
self.expect('frame variable nserror',
- substrs = ['domain: @"Foobar" - code: 12'])
+ substrs=['domain: @"Foobar" - code: 12'])
self.expect('frame variable nserrorptr',
- substrs = ['domain: @"Foobar" - code: 12'])
+ substrs=['domain: @"Foobar" - code: 12'])
self.expect('frame variable nserror->_userInfo',
- substrs = ['2 key/value pairs'])
+ substrs=['2 key/value pairs'])
- self.expect('frame variable nserror->_userInfo --ptr-depth 1 -d run-target',
- substrs = ['@"a"','@"b"',"1","2"])
+ self.expect(
+ 'frame variable nserror->_userInfo --ptr-depth 1 -d run-target',
+ substrs=[
+ '@"a"',
+ '@"b"',
+ "1",
+ "2"])
def nsbundle_data_formatter_commands(self):
- self.expect('frame variable bundle_string bundle_url main_bundle',
- substrs = ['(NSBundle *) bundle_string = ',' @"/System/Library/Frameworks/Accelerate.framework"',
- '(NSBundle *) bundle_url = ',' @"/System/Library/Frameworks/Cocoa.framework"',
- '(NSBundle *) main_bundle = ','data-formatter-objc'])
+ self.expect(
+ 'frame variable bundle_string bundle_url main_bundle',
+ substrs=[
+ '(NSBundle *) bundle_string = ',
+ ' @"/System/Library/Frameworks/Accelerate.framework"',
+ '(NSBundle *) bundle_url = ',
+ ' @"/System/Library/Frameworks/Foundation.framework"',
+ '(NSBundle *) main_bundle = ',
+ 'data-formatter-objc'])
def nsexception_data_formatter_commands(self):
- self.expect('frame variable except0 except1 except2 except3',
- substrs = ['(NSException *) except0 = ','name: @"TheGuyWhoHasNoName" - reason: @"cuz it\'s funny"',
- '(NSException *) except1 = ','name: @"TheGuyWhoHasNoName~1" - reason: @"cuz it\'s funny"',
- '(NSException *) except2 = ','name: @"TheGuyWhoHasNoName`2" - reason: @"cuz it\'s funny"',
- '(NSException *) except3 = ','name: @"TheGuyWhoHasNoName/3" - reason: @"cuz it\'s funny"'])
+ self.expect(
+ 'frame variable except0 except1 except2 except3',
+ substrs=[
+ '(NSException *) except0 = ',
+ 'name: @"TheGuyWhoHasNoName" - reason: @"cuz it\'s funny"',
+ '(NSException *) except1 = ',
+ 'name: @"TheGuyWhoHasNoName~1" - reason: @"cuz it\'s funny"',
+ '(NSException *) except2 = ',
+ 'name: @"TheGuyWhoHasNoName`2" - reason: @"cuz it\'s funny"',
+ '(NSException *) except3 = ',
+ 'name: @"TheGuyWhoHasNoName/3" - reason: @"cuz it\'s funny"'])
def nsdate_data_formatter_commands(self):
- self.expect('frame variable date1 date2',
- patterns = ['(1985-04-10|1985-04-11)','(2011-01-01|2010-12-31)'])
+ self.expect(
+ 'frame variable date1 date2',
+ patterns=[
+ '(1985-04-10|1985-04-11)',
+ '(2011-01-01|2010-12-31)'])
# this test might fail if we hit the breakpoint late on December 31st of some given year
# and midnight comes between hitting the breakpoint and running this line of code
# hopefully the output will be revealing enough in that case :-)
now_year = '%s-' % str(datetime.datetime.now().year)
- self.expect('frame variable date3', substrs = [now_year])
- self.expect('frame variable date4', substrs = ['1970'])
- self.expect('frame variable date5', substrs = [now_year])
+ self.expect('frame variable date3', substrs=[now_year])
+ self.expect('frame variable date4', substrs=['1970'])
+ self.expect('frame variable date5', substrs=[now_year])
self.expect('frame variable date1_abs date2_abs',
- substrs = ['1985-04','2011-01'])
+ substrs=['1985-04', '2011-01'])
- self.expect('frame variable date3_abs', substrs = [now_year])
- self.expect('frame variable date4_abs', substrs = ['1970'])
- self.expect('frame variable date5_abs', substrs = [now_year])
+ self.expect('frame variable date3_abs', substrs=[now_year])
+ self.expect('frame variable date4_abs', substrs=['1970'])
+ self.expect('frame variable date5_abs', substrs=[now_year])
self.expect('frame variable cupertino home europe',
- substrs = ['@"America/Los_Angeles"',
- '@"Europe/Rome"',
- '@"Europe/Paris"'])
+ substrs=['@"America/Los_Angeles"',
+ '@"Europe/Rome"',
+ '@"Europe/Paris"'])
self.expect('frame variable cupertino_ns home_ns europe_ns',
- substrs = ['@"America/Los_Angeles"',
- '@"Europe/Rome"',
- '@"Europe/Paris"'])
-
- self.expect('frame variable mut_bv',
- substrs = ['(CFMutableBitVectorRef) mut_bv = ', '1110 0110 1011 0000 1101 1010 1000 1111 0011 0101 1101 0001 00'])
+ substrs=['@"America/Los_Angeles"',
+ '@"Europe/Rome"',
+ '@"Europe/Paris"'])
+ self.expect(
+ 'frame variable mut_bv',
+ substrs=[
+ '(CFMutableBitVectorRef) mut_bv = ',
+ '1110 0110 1011 0000 1101 1010 1000 1111 0011 0101 1101 0001 00'])
def expr_objc_data_formatter_commands(self):
"""Test common cases of expression parser <--> formatters interaction."""
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_file_and_line (self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
self.runCmd("run", RUN_SUCCEEDED)
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
@@ -323,36 +373,41 @@ class ObjCDataFormatterTestCase(TestBase):
# check that the formatters are able to deal safely and correctly
# with ValueObjects that the expression parser returns
- self.expect('expression ((id)@"Hello for long enough to avoid short string types")', matching=False,
- substrs = ['Hello for long enough to avoid short string types'])
+ self.expect(
+ 'expression ((id)@"Hello for long enough to avoid short string types")',
+ matching=False,
+ substrs=['Hello for long enough to avoid short string types'])
- self.expect('expression -d run -- ((id)@"Hello for long enough to avoid short string types")',
- substrs = ['Hello for long enough to avoid short string types'])
+ self.expect(
+ 'expression -d run -- ((id)@"Hello for long enough to avoid short string types")',
+ substrs=['Hello for long enough to avoid short string types'])
self.expect('expr -d run -- label1',
- substrs = ['Process Name'])
-
- self.expect('expr -d run -- @"Hello for long enough to avoid short string types"',
- substrs = ['Hello for long enough to avoid short string types'])
+ substrs=['Process Name'])
- self.expect('expr -d run --object-description -- @"Hello for long enough to avoid short string types"',
- substrs = ['Hello for long enough to avoid short string types'])
- self.expect('expr -d run --object-description -- @"Hello"', matching=False,
- substrs = ['@"Hello" Hello'])
+ self.expect(
+ 'expr -d run -- @"Hello for long enough to avoid short string types"',
+ substrs=['Hello for long enough to avoid short string types'])
+ self.expect(
+ 'expr -d run --object-description -- @"Hello for long enough to avoid short string types"',
+ substrs=['Hello for long enough to avoid short string types'])
+ self.expect('expr -d run --object-description -- @"Hello"',
+ matching=False, substrs=['@"Hello" Hello'])
def cf_data_formatter_commands(self):
"""Test formatters for Core OSX frameworks."""
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_file_and_line (self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
self.runCmd("run", RUN_SUCCEEDED)
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
@@ -361,50 +416,53 @@ class ObjCDataFormatterTestCase(TestBase):
self.runCmd('type summary clear', check=False)
self.runCmd('type synth clear', check=False)
-
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
# check formatters for common Objective-C types
- expect_strings = ['(CFGregorianUnits) cf_greg_units = 1 years, 3 months, 5 days, 12 hours, 5 minutes 7 seconds',
- '(CFRange) cf_range = location=4 length=4',
- '(NSPoint) ns_point = (x = 4, y = 4)',
- '(NSRange) ns_range = location=4, length=4',
- '(NSRect) ns_rect = (origin = (x = 1, y = 1), size = (width = 5, height = 5))',
- '(NSRectArray) ns_rect_arr = ((x = 1, y = 1), (width = 5, height = 5)), ...',
- '(NSSize) ns_size = (width = 5, height = 7)',
- '(CGSize) cg_size = (width = 1, height = 6)',
- '(CGPoint) cg_point = (x = 2, y = 7)',
- '(CGRect) cg_rect = (origin = (x = 1, y = 2), size = (width = 7, height = 7))',
- '(Rect) rect = (t=4, l=8, b=4, r=7)',
- '(Rect *) rect_ptr = (t=4, l=8, b=4, r=7)',
- '(Point) point = (v=7, h=12)',
- '(Point *) point_ptr = (v=7, h=12)',
- '1985',
- 'foo_selector_impl'];
-
+ expect_strings = [
+ '(CFGregorianUnits) cf_greg_units = 1 years, 3 months, 5 days, 12 hours, 5 minutes 7 seconds',
+ '(CFRange) cf_range = location=4 length=4',
+ '(NSPoint) ns_point = (x = 4, y = 4)',
+ '(NSRange) ns_range = location=4, length=4',
+ '(NSRect) ns_rect = (origin = (x = 1, y = 1), size = (width = 5, height = 5))',
+ '(NSRectArray) ns_rect_arr = ((x = 1, y = 1), (width = 5, height = 5)), ...',
+ '(NSSize) ns_size = (width = 5, height = 7)',
+ '(CGSize) cg_size = (width = 1, height = 6)',
+ '(CGPoint) cg_point = (x = 2, y = 7)',
+ '(CGRect) cg_rect = (origin = (x = 1, y = 2), size = (width = 7, height = 7))',
+ '(Rect) rect = (t=4, l=8, b=4, r=7)',
+ '(Rect *) rect_ptr = (t=4, l=8, b=4, r=7)',
+ '(Point) point = (v=7, h=12)',
+ '(Point *) point_ptr = (v=7, h=12)',
+ '1985',
+ 'foo_selector_impl']
+
if self.getArchitecture() in ['i386', 'x86_64']:
expect_strings.append('(HIPoint) hi_point = (x=7, y=12)')
- expect_strings.append('(HIRect) hi_rect = origin=(x = 3, y = 5) size=(width = 4, height = 6)')
- expect_strings.append('(RGBColor) rgb_color = red=3 green=56 blue=35')
- expect_strings.append('(RGBColor *) rgb_color_ptr = red=3 green=56 blue=35')
-
- self.expect("frame variable",
- substrs = expect_strings)
+ expect_strings.append(
+ '(HIRect) hi_rect = origin=(x = 3, y = 5) size=(width = 4, height = 6)')
+ expect_strings.append(
+ '(RGBColor) rgb_color = red=3 green=56 blue=35')
+ expect_strings.append(
+ '(RGBColor *) rgb_color_ptr = red=3 green=56 blue=35')
+ self.expect("frame variable",
+ substrs=expect_strings)
def kvo_data_formatter_commands(self):
"""Test the behavior of formatters when KVO is in use."""
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_file_and_line (self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
self.runCmd("run", RUN_SUCCEEDED)
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
@@ -420,18 +478,23 @@ class ObjCDataFormatterTestCase(TestBase):
# we should be able to dynamically figure out that the KVO implementor class
# is a subclass of Molecule, and use the appropriate summary for it
self.runCmd("type summary add -s JustAMoleculeHere Molecule")
- self.expect('frame variable molecule', substrs = ['JustAMoleculeHere'])
+ self.expect('frame variable molecule', substrs=['JustAMoleculeHere'])
self.runCmd("next")
self.expect("thread list",
- substrs = ['stopped',
- 'step over'])
- self.expect('frame variable molecule', substrs = ['JustAMoleculeHere'])
+ substrs=['stopped',
+ 'step over'])
+ self.expect('frame variable molecule', substrs=['JustAMoleculeHere'])
self.runCmd("next")
- # check that NSMutableDictionary's formatter is not confused when dealing with a KVO'd dictionary
- self.expect('frame variable newMutableDictionary', substrs = ['(NSDictionary *) newMutableDictionary = ',' 21 key/value pairs'])
+ # check that NSMutableDictionary's formatter is not confused when
+ # dealing with a KVO'd dictionary
+ self.expect(
+ 'frame variable newMutableDictionary',
+ substrs=[
+ '(NSDictionary *) newMutableDictionary = ',
+ ' 21 key/value pairs'])
- lldbutil.run_break_set_by_regexp (self, 'setAtoms')
+ lldbutil.run_break_set_by_regexp(self, 'setAtoms')
self.runCmd("continue")
- self.expect("frame variable _cmd",substrs = ['setAtoms:'])
+ self.expect("frame variable _cmd", substrs=['setAtoms:'])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/main.m b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/main.m
index 020e2fc6227a..1543ce6edb91 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/main.m
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/main.m
@@ -463,7 +463,7 @@ int main (int argc, const char * argv[])
NSError **nserrorptr = &nserror;
NSBundle* bundle_string = [[NSBundle alloc] initWithPath:@"/System/Library/Frameworks/Accelerate.framework"];
- NSBundle* bundle_url = [[NSBundle alloc] initWithURL:[[NSURL alloc] initWithString:@"file://localhost/System/Library/Frameworks/Cocoa.framework"]];
+ NSBundle* bundle_url = [[NSBundle alloc] initWithURL:[[NSURL alloc] initWithString:@"file://localhost/System/Library/Frameworks/Foundation.framework"]];
NSBundle* main_bundle = [NSBundle mainBundle];
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsindexpath/Makefile b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsindexpath/Makefile
new file mode 100644
index 000000000000..0d94c2247f14
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsindexpath/Makefile
@@ -0,0 +1,9 @@
+LEVEL = ../../../../make
+
+OBJC_SOURCES := main.m
+
+CFLAGS_EXTRAS += -w
+
+include $(LEVEL)/Makefile.rules
+
+LDFLAGS += -framework Foundation
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsindexpath/TestDataFormatterNSIndexPath.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsindexpath/TestDataFormatterNSIndexPath.py
new file mode 100644
index 000000000000..2d66a941ed34
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsindexpath/TestDataFormatterNSIndexPath.py
@@ -0,0 +1,115 @@
+# encoding: utf-8
+"""
+Test lldb data formatter subsystem.
+"""
+
+from __future__ import print_function
+
+
+import os
+import time
+import datetime
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class NSIndexPathDataFormatterTestCase(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ def appkit_tester_impl(self, commands):
+ self.build()
+ self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
+
+ self.runCmd("run", RUN_SUCCEEDED)
+
+ # The stop reason of the thread should be breakpoint.
+ self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
+
+ # This is the function to remove the custom formats in order to have a
+ # clean slate for the next test case.
+ def cleanup():
+ self.runCmd('type format clear', check=False)
+ self.runCmd('type summary clear', check=False)
+ self.runCmd('type synth clear', check=False)
+
+ # Execute the cleanup function during test case tear down.
+ self.addTearDownHook(cleanup)
+ commands()
+
+ @skipUnlessDarwin
+ @expectedFailureAll(archs=['i386'], bugnumber="rdar://28656605")
+ def test_nsindexpath_with_run_command(self):
+ """Test formatters for NSIndexPath."""
+ self.appkit_tester_impl(self.nsindexpath_data_formatter_commands)
+
+ def setUp(self):
+ # Call super's setUp().
+ TestBase.setUp(self)
+ # Find the line number to break at.
+ self.line = line_number('main.m', '// break here')
+
+ def nsindexpath_data_formatter_commands(self):
+ # check 'frame variable'
+ self.expect(
+ 'frame variable --ptr-depth=1 -d run -- indexPath1',
+ substrs=['[0] = 1'])
+ self.expect(
+ 'frame variable --ptr-depth=1 -d run -- indexPath2',
+ substrs=[
+ '[0] = 1',
+ '[1] = 2'])
+ self.expect(
+ 'frame variable --ptr-depth=1 -d run -- indexPath3',
+ substrs=[
+ '[0] = 1',
+ '[1] = 2',
+ '[2] = 3'])
+ self.expect(
+ 'frame variable --ptr-depth=1 -d run -- indexPath4',
+ substrs=[
+ '[0] = 1',
+ '[1] = 2',
+ '[2] = 3',
+ '[3] = 4'])
+ self.expect(
+ 'frame variable --ptr-depth=1 -d run -- indexPath5',
+ substrs=[
+ '[0] = 1',
+ '[1] = 2',
+ '[2] = 3',
+ '[3] = 4',
+ '[4] = 5'])
+
+ # and 'expression'
+ self.expect(
+ 'expression --ptr-depth=1 -d run -- indexPath1',
+ substrs=['[0] = 1'])
+ self.expect(
+ 'expression --ptr-depth=1 -d run -- indexPath2',
+ substrs=[
+ '[0] = 1',
+ '[1] = 2'])
+ self.expect(
+ 'expression --ptr-depth=1 -d run -- indexPath3',
+ substrs=[
+ '[0] = 1',
+ '[1] = 2',
+ '[2] = 3'])
+ self.expect('expression --ptr-depth=1 -d run -- indexPath4',
+ substrs=['[0] = 1', '[1] = 2', '[2] = 3', '[3] = 4'])
+ self.expect(
+ 'expression --ptr-depth=1 -d run -- indexPath5',
+ substrs=[
+ '[0] = 1',
+ '[1] = 2',
+ '[2] = 3',
+ '[3] = 4',
+ '[4] = 5'])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsindexpath/main.m b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsindexpath/main.m
new file mode 100644
index 000000000000..baaff180e34e
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsindexpath/main.m
@@ -0,0 +1,31 @@
+//===-- main.m ------------------------------------------------*- ObjC -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#import <Foundation/Foundation.h>
+
+int main(int argc, const char **argv)
+{
+ @autoreleasepool
+ {
+ const NSUInteger values[] = { 1, 2, 3, 4, 5 };
+
+ NSIndexPath* indexPath1 = [NSIndexPath indexPathWithIndexes:values length:1];
+ NSIndexPath* indexPath2 = [NSIndexPath indexPathWithIndexes:values length:2];
+ NSIndexPath* indexPath3 = [NSIndexPath indexPathWithIndexes:values length:3];
+ NSIndexPath* indexPath4 = [NSIndexPath indexPathWithIndexes:values length:4];
+ NSIndexPath* indexPath5 = [NSIndexPath indexPathWithIndexes:values length:5];
+
+ NSLog(@"%@", indexPath1); // break here
+ NSLog(@"%@", indexPath2);
+ NSLog(@"%@", indexPath3);
+ NSLog(@"%@", indexPath4);
+ NSLog(@"%@", indexPath5);
+ }
+ return 0;
+}
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py
index f5c792593772..12e62f62ee97 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py
@@ -6,30 +6,32 @@ Test lldb data formatter subsystem.
from __future__ import print_function
-
-import os, time
+import os
+import time
import datetime
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+
class NSStringDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- def appkit_tester_impl(self,commands):
+ def appkit_tester_impl(self, commands):
self.build()
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_file_and_line (self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
self.runCmd("run", RUN_SUCCEEDED)
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
@@ -38,7 +40,6 @@ class NSStringDataFormatterTestCase(TestBase):
self.runCmd('type summary clear', check=False)
self.runCmd('type synth clear', check=False)
-
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
commands()
@@ -58,7 +59,6 @@ class NSStringDataFormatterTestCase(TestBase):
"""Test formatters for NSString."""
self.appkit_tester_impl(self.nsstring_withNULs_commands)
-
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
@@ -67,42 +67,55 @@ class NSStringDataFormatterTestCase(TestBase):
def rdar11106605_commands(self):
"""Check that Unicode characters come out of CFString summary correctly."""
- self.expect('frame variable italian', substrs = ['L\'Italia è una Repubblica democratica, fondata sul lavoro. La sovranità appartiene al popolo, che la esercita nelle forme e nei limiti della Costituzione.'])
- self.expect('frame variable french', substrs = ['Que veut cette horde d\'esclaves, De traîtres, de rois conjurés?'])
- self.expect('frame variable german', substrs = ['Über-Ich und aus den Ansprüchen der sozialen Umwelt'])
- self.expect('frame variable japanese', substrs = ['色は匂へど散りぬるを'])
- self.expect('frame variable hebrew', substrs = ['לילה טוב'])
+ self.expect('frame variable italian', substrs=[
+ 'L\'Italia è una Repubblica democratica, fondata sul lavoro. La sovranità appartiene al popolo, che la esercita nelle forme e nei limiti della Costituzione.'])
+ self.expect('frame variable french', substrs=[
+ 'Que veut cette horde d\'esclaves, De traîtres, de rois conjurés?'])
+ self.expect('frame variable german', substrs=[
+ 'Über-Ich und aus den Ansprüchen der sozialen Umwelt'])
+ self.expect('frame variable japanese', substrs=['色は匂へど散りぬるを'])
+ self.expect('frame variable hebrew', substrs=['לילה טוב'])
def nsstring_data_formatter_commands(self):
self.expect('frame variable str0 str1 str2 str3 str4 str5 str6 str8 str9 str10 str11 label1 label2 processName str12',
- substrs = ['(NSString *) str1 = ',' @"A rather short ASCII NSString object is here"',
- # '(NSString *) str0 = ',' @"255"',
- '(NSString *) str1 = ',' @"A rather short ASCII NSString object is here"',
- '(NSString *) str2 = ',' @"A rather short UTF8 NSString object is here"',
- '(NSString *) str3 = ',' @"A string made with the at sign is here"',
- '(NSString *) str4 = ',' @"This is string number 4 right here"',
- '(NSString *) str5 = ',' @"{{1, 1}, {5, 5}}"',
- '(NSString *) str6 = ',' @"1ST"',
- '(NSString *) str8 = ',' @"hasVeryLongExtensionThisTimehasVeryLongExtensionThisTimehasVeryLongExtensionThisTimehasVeryLongExtensionThisTimehasVeryLongExtensionThisTimehasVeryLongExtensionThisTimehasVeryLongExtensionThisTimehasVeryLongExtensionThisTimehasVeryLongExtensionThisTime',
- '(NSString *) str9 = ',' @"a very much boring task to write a string this way!!',
- '(NSString *) str10 = ',' @"This is a Unicode string σ number 4 right here"',
- '(NSString *) str11 = ',' @"__NSCFString"',
- '(NSString *) label1 = ',' @"Process Name: "',
- '(NSString *) label2 = ',' @"Process Id: "',
- '(NSString *) str12 = ',' @"Process Name: a.out Process Id:'])
- self.expect('frame variable attrString mutableAttrString mutableGetConst',
- substrs = ['(NSAttributedString *) attrString = ',' @"hello world from foo"',
- '(NSAttributedString *) mutableAttrString = ',' @"hello world from foo"',
- '(NSString *) mutableGetConst = ',' @"foo said this string needs to be very long so much longer than whatever other string has been seen ever before by anyone of the mankind that of course this is still not long enough given what foo our friend foo our lovely dearly friend foo desired of us so i am adding more stuff here for the sake of it and for the joy of our friend who is named guess what just foo. hence, dear friend foo, stay safe, your string is now long enough to accommodate your testing need and I will make sure that if not we extend it with even more fuzzy random meaningless words pasted one after the other from a long tiresome friday evening spent working in my office. my office mate went home but I am still randomly typing just for the fun of seeing what happens of the length of a Mutable String in Cocoa if it goes beyond one byte.. so be it, dear foo"'])
-
- self.expect('expr -d run-target -- path',substrs = ['usr/blah/stuff'])
- self.expect('frame variable path',substrs = ['usr/blah/stuff'])
+ substrs=['(NSString *) str1 = ', ' @"A rather short ASCII NSString object is here"',
+ # '(NSString *) str0 = ',' @"255"',
+ '(NSString *) str1 = ', ' @"A rather short ASCII NSString object is here"',
+ '(NSString *) str2 = ', ' @"A rather short UTF8 NSString object is here"',
+ '(NSString *) str3 = ', ' @"A string made with the at sign is here"',
+ '(NSString *) str4 = ', ' @"This is string number 4 right here"',
+ '(NSString *) str5 = ', ' @"{{1, 1}, {5, 5}}"',
+ '(NSString *) str6 = ', ' @"1ST"',
+ '(NSString *) str8 = ', ' @"hasVeryLongExtensionThisTimehasVeryLongExtensionThisTimehasVeryLongExtensionThisTimehasVeryLongExtensionThisTimehasVeryLongExtensionThisTimehasVeryLongExtensionThisTimehasVeryLongExtensionThisTimehasVeryLongExtensionThisTimehasVeryLongExtensionThisTime',
+ '(NSString *) str9 = ', ' @"a very much boring task to write a string this way!!',
+ '(NSString *) str10 = ', ' @"This is a Unicode string σ number 4 right here"',
+ '(NSString *) str11 = ', ' @"__NSCFString"',
+ '(NSString *) label1 = ', ' @"Process Name: "',
+ '(NSString *) label2 = ', ' @"Process Id: "',
+ '(NSString *) str12 = ', ' @"Process Name: a.out Process Id:'])
+ self.expect(
+ 'frame variable attrString mutableAttrString mutableGetConst',
+ substrs=[
+ '(NSAttributedString *) attrString = ',
+ ' @"hello world from foo"',
+ '(NSAttributedString *) mutableAttrString = ',
+ ' @"hello world from foo"',
+ '(NSString *) mutableGetConst = ',
+ ' @"foo said this string needs to be very long so much longer than whatever other string has been seen ever before by anyone of the mankind that of course this is still not long enough given what foo our friend foo our lovely dearly friend foo desired of us so i am adding more stuff here for the sake of it and for the joy of our friend who is named guess what just foo. hence, dear friend foo, stay safe, your string is now long enough to accommodate your testing need and I will make sure that if not we extend it with even more fuzzy random meaningless words pasted one after the other from a long tiresome friday evening spent working in my office. my office mate went home but I am still randomly typing just for the fun of seeing what happens of the length of a Mutable String in Cocoa if it goes beyond one byte.. so be it, dear foo"'])
+
+ self.expect('expr -d run-target -- path', substrs=['usr/blah/stuff'])
+ self.expect('frame variable path', substrs=['usr/blah/stuff'])
def nsstring_withNULs_commands(self):
"""Check that the NSString formatter supports embedded NULs in the text"""
- self.expect('po strwithNULs', substrs=['a very much boring task to write'])
+ self.expect(
+ 'po strwithNULs',
+ substrs=['a very much boring task to write'])
self.expect('expr [strwithNULs length]', substrs=['54'])
- self.expect('frame variable strwithNULs', substrs=['@"a very much boring task to write\\0a string this way!!'])
- self.expect('po strwithNULs2', substrs=['a very much boring task to write'])
+ self.expect('frame variable strwithNULs', substrs=[
+ '@"a very much boring task to write\\0a string this way!!'])
+ self.expect('po strwithNULs2', substrs=[
+ 'a very much boring task to write'])
self.expect('expr [strwithNULs2 length]', substrs=['52'])
- self.expect('frame variable strwithNULs2', substrs=['@"a very much boring task to write\\0a string this way!!'])
+ self.expect('frame variable strwithNULs2', substrs=[
+ '@"a very much boring task to write\\0a string this way!!'])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-proper-plurals/TestFormattersOneIsSingular.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-proper-plurals/TestFormattersOneIsSingular.py
index 3c9be04a2f6c..bf600219bced 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-proper-plurals/TestFormattersOneIsSingular.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-proper-plurals/TestFormattersOneIsSingular.py
@@ -5,14 +5,15 @@ Test lldb data formatter subsystem.
from __future__ import print_function
-
import datetime
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+
class DataFormatterOneIsSingularTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@@ -33,14 +34,15 @@ class DataFormatterOneIsSingularTestCase(TestBase):
"""Test that 1 item is not as reported as 1 items."""
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_file_and_line (self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
self.runCmd("run", RUN_SUCCEEDED)
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
@@ -54,26 +56,26 @@ class DataFormatterOneIsSingularTestCase(TestBase):
# Now check that we are displaying Cocoa classes correctly
self.expect('frame variable key',
- substrs = ['@"1 element"'])
+ substrs=['@"1 element"'])
self.expect('frame variable key', matching=False,
- substrs = ['1 elements'])
+ substrs=['1 elements'])
self.expect('frame variable value',
- substrs = ['@"1 element"'])
+ substrs=['@"1 element"'])
self.expect('frame variable value', matching=False,
- substrs = ['1 elements'])
+ substrs=['1 elements'])
self.expect('frame variable dict',
- substrs = ['1 key/value pair'])
+ substrs=['1 key/value pair'])
self.expect('frame variable dict', matching=False,
- substrs = ['1 key/value pairs'])
+ substrs=['1 key/value pairs'])
self.expect('frame variable imset',
- substrs = ['1 index'])
+ substrs=['1 index'])
self.expect('frame variable imset', matching=False,
- substrs = ['1 indexes'])
+ substrs=['1 indexes'])
self.expect('frame variable binheap_ref',
- substrs = ['@"1 item"'])
+ substrs=['@"1 item"'])
self.expect('frame variable binheap_ref', matching=False,
- substrs = ['1 items'])
+ substrs=['1 items'])
self.expect('frame variable immutableData',
- substrs = ['1 byte'])
+ substrs=['1 byte'])
self.expect('frame variable immutableData', matching=False,
- substrs = ['1 bytes'])
+ substrs=['1 bytes'])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-ptr-to-array/TestPtrToArrayFormatting.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-ptr-to-array/TestPtrToArrayFormatting.py
index 86cd3c427288..ebabe3076611 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-ptr-to-array/TestPtrToArrayFormatting.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-ptr-to-array/TestPtrToArrayFormatting.py
@@ -5,12 +5,13 @@ Test lldb data formatter subsystem.
from __future__ import print_function
-
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.lldbtest import *
import lldbsuite.test.lldbutil as lldbutil
+
class PtrToArrayDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@@ -30,14 +31,15 @@ class PtrToArrayDataFormatterTestCase(TestBase):
"""Test that LLDB handles the clang typeclass Paren correctly."""
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
self.runCmd("run", RUN_SUCCEEDED)
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
@@ -49,9 +51,9 @@ class PtrToArrayDataFormatterTestCase(TestBase):
self.addTearDownHook(cleanup)
self.expect('p *(int (*)[3])foo',
- substrs = ['(int [3]) $','[0] = 1','[1] = 2','[2] = 3'])
+ substrs=['(int [3]) $', '[0] = 1', '[1] = 2', '[2] = 3'])
self.expect('p *(int (*)[3])foo', matching=False,
- substrs = ['01 00 00 00 02 00 00 00 03 00 00 00'])
+ substrs=['01 00 00 00 02 00 00 00 03 00 00 00'])
self.expect('p *(int (*)[3])foo', matching=False,
- substrs = ['0x000000030000000200000001'])
+ substrs=['0x000000030000000200000001'])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py
index c7ff28874c5a..75d1853f6a71 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py
@@ -5,18 +5,19 @@ Test lldb data formatter subsystem.
from __future__ import print_function
-
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+
class PythonSynthDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- @skipIfFreeBSD # llvm.org/pr20545 bogus output confuses buildbot parser
+ @skipIfFreeBSD # llvm.org/pr20545 bogus output confuses buildbot parser
def test_with_run_command(self):
"""Test data formatter commands."""
self.build()
@@ -27,20 +28,22 @@ class PythonSynthDataFormatterTestCase(TestBase):
self.build()
self.rdar10960550_formatter_commands()
-
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
# Find the line number to break at.
self.line = line_number('main.cpp', '// Set break point at this line.')
- self.line2 = line_number('main.cpp', '// Set cast break point at this line.')
- self.line3 = line_number('main.cpp', '// Set second cast break point at this line.')
+ self.line2 = line_number('main.cpp',
+ '// Set cast break point at this line.')
+ self.line3 = line_number(
+ 'main.cpp', '// Set second cast break point at this line.')
def data_formatter_commands(self):
"""Test using Python synthetic children provider."""
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
self.runCmd("run", RUN_SUCCEEDED)
@@ -48,8 +51,8 @@ class PythonSynthDataFormatterTestCase(TestBase):
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
@@ -64,9 +67,9 @@ class PythonSynthDataFormatterTestCase(TestBase):
# print the f00_1 variable without a synth
self.expect("frame variable f00_1",
- substrs = ['a = 1',
- 'b = 2',
- 'r = 34']);
+ substrs=['a = 1',
+ 'b = 2',
+ 'r = 34'])
# now set up the synth
self.runCmd("script from fooSynthProvider import *")
@@ -81,30 +84,32 @@ class PythonSynthDataFormatterTestCase(TestBase):
# check that we get the two real vars and the fake_a variables
self.expect("frame variable f00_1",
- substrs = ['r = 34',
- 'fake_a = %d' % fake_a_val,
- 'a = 1']);
+ substrs=['r = 34',
+ 'fake_a = %d' % fake_a_val,
+ 'a = 1'])
# check that we do not get the extra vars
self.expect("frame variable f00_1", matching=False,
- substrs = ['b = 2']);
-
+ substrs=['b = 2'])
+
# check access to members by name
self.expect('frame variable f00_1.fake_a',
- substrs = ['%d' % fake_a_val])
-
+ substrs=['%d' % fake_a_val])
+
# check access to members by index
self.expect('frame variable f00_1[1]',
- substrs = ['%d' % fake_a_val])
-
+ substrs=['%d' % fake_a_val])
+
# put synthetic children in summary in several combinations
- self.runCmd("type summary add --summary-string \"fake_a=${svar.fake_a}\" foo")
+ self.runCmd(
+ "type summary add --summary-string \"fake_a=${svar.fake_a}\" foo")
self.expect('frame variable f00_1',
- substrs = ['fake_a=%d' % fake_a_val])
- self.runCmd("type summary add --summary-string \"fake_a=${svar[1]}\" foo")
+ substrs=['fake_a=%d' % fake_a_val])
+ self.runCmd(
+ "type summary add --summary-string \"fake_a=${svar[1]}\" foo")
self.expect('frame variable f00_1',
- substrs = ['fake_a=%d' % fake_a_val])
-
+ substrs=['fake_a=%d' % fake_a_val])
+
# clear the summary
self.runCmd("type summary delete foo")
@@ -117,9 +122,9 @@ class PythonSynthDataFormatterTestCase(TestBase):
fake_a_val = 0x00000200
self.expect("frame variable f00_1",
- substrs = ['r = 34',
- 'fake_a = %d' % fake_a_val,
- 'a = 2']);
+ substrs=['r = 34',
+ 'fake_a = %d' % fake_a_val,
+ 'a = 2'])
# check that altering the object also alters fake_a
self.runCmd("expr f00_1.a = 280")
@@ -130,9 +135,9 @@ class PythonSynthDataFormatterTestCase(TestBase):
fake_a_val = 0x00011800
self.expect("frame variable f00_1",
- substrs = ['r = 34',
- 'fake_a = %d' % fake_a_val,
- 'a = 280']);
+ substrs=['r = 34',
+ 'fake_a = %d' % fake_a_val,
+ 'a = 280'])
# check that expanding a pointer does the right thing
if process.GetByteOrder() == lldb.eByteOrderLittle:
@@ -141,94 +146,97 @@ class PythonSynthDataFormatterTestCase(TestBase):
fake_a_val = 0x00000c00
self.expect("frame variable --ptr-depth 1 f00_ptr",
- substrs = ['r = 45',
- 'fake_a = %d' % fake_a_val,
- 'a = 12'])
-
+ substrs=['r = 45',
+ 'fake_a = %d' % fake_a_val,
+ 'a = 12'])
+
# now add a filter.. it should fail
self.expect("type filter add foo --child b --child j", error=True,
- substrs = ['cannot add'])
-
+ substrs=['cannot add'])
+
# we get the synth again..
self.expect('frame variable f00_1', matching=False,
- substrs = ['b = 1',
- 'j = 17'])
+ substrs=['b = 1',
+ 'j = 17'])
self.expect("frame variable --ptr-depth 1 f00_ptr",
- substrs = ['r = 45',
- 'fake_a = %d' % fake_a_val,
- 'a = 12'])
-
+ substrs=['r = 45',
+ 'fake_a = %d' % fake_a_val,
+ 'a = 12'])
+
# now delete the synth and add the filter
self.runCmd("type synth delete foo")
self.runCmd("type filter add foo --child b --child j")
-
+
self.expect('frame variable f00_1',
- substrs = ['b = 2',
- 'j = 18'])
+ substrs=['b = 2',
+ 'j = 18'])
self.expect("frame variable --ptr-depth 1 f00_ptr", matching=False,
- substrs = ['r = 45',
- 'fake_a = %d' % fake_a_val,
- 'a = 12'])
-
+ substrs=['r = 45',
+ 'fake_a = %d' % fake_a_val,
+ 'a = 12'])
+
# now add the synth and it should fail
self.expect("type synth add -l fooSynthProvider foo", error=True,
- substrs = ['cannot add'])
-
+ substrs=['cannot add'])
+
# check the listing
self.expect('type synth list', matching=False,
- substrs = ['foo',
- 'Python class fooSynthProvider'])
- self.expect('type filter list',
- substrs = ['foo',
- '.b',
- '.j'])
-
+ substrs=['foo',
+ 'Python class fooSynthProvider'])
+ self.expect('type filter list',
+ substrs=['foo',
+ '.b',
+ '.j'])
+
# delete the filter, add the synth
self.runCmd("type filter delete foo")
self.runCmd("type synth add -l fooSynthProvider foo")
-
+
self.expect('frame variable f00_1', matching=False,
- substrs = ['b = 2',
- 'j = 18'])
- self.expect("frame variable --ptr-depth 1 f00_ptr",
- substrs = ['r = 45',
- 'fake_a = %d' % fake_a_val,
- 'a = 12'])
+ substrs=['b = 2',
+ 'j = 18'])
+ self.expect("frame variable --ptr-depth 1 f00_ptr",
+ substrs=['r = 45',
+ 'fake_a = %d' % fake_a_val,
+ 'a = 12'])
# check the listing
self.expect('type synth list',
- substrs = ['foo',
- 'Python class fooSynthProvider'])
+ substrs=['foo',
+ 'Python class fooSynthProvider'])
self.expect('type filter list', matching=False,
- substrs = ['foo',
- '.b',
- '.j'])
-
+ substrs=['foo',
+ '.b',
+ '.j'])
+
# delete the synth and check that we get good output
self.runCmd("type synth delete foo")
-
+
self.expect("frame variable f00_1",
- substrs = ['a = 280',
- 'b = 2',
- 'j = 18']);
+ substrs=['a = 280',
+ 'b = 2',
+ 'j = 18'])
self.expect("frame variable f00_1", matching=False,
- substrs = ['fake_a = '])
+ substrs=['fake_a = '])
def rdar10960550_formatter_commands(self):
"""Test that synthetic children persist stoppoints."""
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- # The second breakpoint is on a multi-line expression, so the comment can't be on the right line...
- lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line2, num_expected_locations=1, loc_exact=False)
- lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line3, num_expected_locations=1, loc_exact=True)
+ # The second breakpoint is on a multi-line expression, so the comment
+ # can't be on the right line...
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.cpp", self.line2, num_expected_locations=1, loc_exact=False)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.cpp", self.line3, num_expected_locations=1, loc_exact=True)
self.runCmd("run", RUN_SUCCEEDED)
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
@@ -248,25 +256,28 @@ class PythonSynthDataFormatterTestCase(TestBase):
# but their values change correctly across stop-points - in order to do this, self.runCmd("next")
# does not work because it forces a wipe of the stack frame - this is why we are using this more contrived
# mechanism to achieve our goal of preserving test_cast as a VO
- test_cast = self.dbg.GetSelectedTarget().GetProcess().GetSelectedThread().GetSelectedFrame().FindVariable('test_cast')
+ test_cast = self.dbg.GetSelectedTarget().GetProcess(
+ ).GetSelectedThread().GetSelectedFrame().FindVariable('test_cast')
str_cast = str(test_cast)
if self.TraceOn():
- print(str_cast)
+ print(str_cast)
self.assertTrue(str_cast.find('A') != -1, 'could not find A in output')
self.assertTrue(str_cast.find('B') != -1, 'could not find B in output')
self.assertTrue(str_cast.find('C') != -1, 'could not find C in output')
self.assertTrue(str_cast.find('D') != -1, 'could not find D in output')
- self.assertTrue(str_cast.find("4 = '\\0'") != -1, 'could not find item 4 == 0')
+ self.assertTrue(
+ str_cast.find("4 = '\\0'") != -1,
+ 'could not find item 4 == 0')
self.dbg.GetSelectedTarget().GetProcess().GetSelectedThread().StepOver()
str_cast = str(test_cast)
if self.TraceOn():
- print(str_cast)
+ print(str_cast)
# we detect that all the values of the child objects have changed - but the counter-generated item
# is still fixed at 0 because it is cached - this would fail if update(self): in ftsp returned False
@@ -275,4 +286,6 @@ class PythonSynthDataFormatterTestCase(TestBase):
self.assertTrue(str_cast.find('X') != -1, 'could not find X in output')
self.assertTrue(str_cast.find('T') != -1, 'could not find T in output')
self.assertTrue(str_cast.find('F') != -1, 'could not find F in output')
- self.assertTrue(str_cast.find("4 = '\\0'") != -1, 'could not find item 4 == 0')
+ self.assertTrue(
+ str_cast.find("4 = '\\0'") != -1,
+ 'could not find item 4 == 0')
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/fooSynthProvider.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/fooSynthProvider.py
index 0dc2c233e2a6..45fb00468e08 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/fooSynthProvider.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/fooSynthProvider.py
@@ -1,23 +1,30 @@
import lldb
+
+
class fooSynthProvider:
- def __init__(self, valobj, dict):
- self.valobj = valobj;
- self.int_type = valobj.GetType().GetBasicType(lldb.eBasicTypeInt)
- def num_children(self):
- return 3;
- def get_child_at_index(self, index):
- if index == 0:
- child = self.valobj.GetChildMemberWithName('a');
- if index == 1:
- child = self.valobj.CreateChildAtOffset ('fake_a', 1, self.int_type);
- if index == 2:
- child = self.valobj.GetChildMemberWithName('r');
- return child;
- def get_child_index(self, name):
- if name == 'a':
- return 0;
- if name == 'fake_a':
- return 1;
- return 2;
- def update(self):
- return True \ No newline at end of file
+
+ def __init__(self, valobj, dict):
+ self.valobj = valobj
+ self.int_type = valobj.GetType().GetBasicType(lldb.eBasicTypeInt)
+
+ def num_children(self):
+ return 3
+
+ def get_child_at_index(self, index):
+ if index == 0:
+ child = self.valobj.GetChildMemberWithName('a')
+ if index == 1:
+ child = self.valobj.CreateChildAtOffset('fake_a', 1, self.int_type)
+ if index == 2:
+ child = self.valobj.GetChildMemberWithName('r')
+ return child
+
+ def get_child_index(self, name):
+ if name == 'a':
+ return 0
+ if name == 'fake_a':
+ return 1
+ return 2
+
+ def update(self):
+ return True
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/ftsp.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/ftsp.py
index d162b00db329..b96dbac6f503 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/ftsp.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/ftsp.py
@@ -2,31 +2,39 @@ import lldb
counter = 0
+
class ftsp:
- def __init__(self, valobj, dict):
- self.valobj = valobj;
- def num_children(self):
- if self.char.IsValid():
- return 5;
- return 0;
- def get_child_index(self,name):
- return 0;
- def get_child_at_index(self,index):
- if index == 0:
- return self.x.Cast(self.char)
- if index == 4:
- return self.valobj.CreateValueFromExpression(str(index),'(char)('+str(self.count)+')')
- return self.x.CreateChildAtOffset(str(index),
- index,
- self.char);
- def update(self):
- self.x = self.valobj.GetChildMemberWithName('x');
- self.char = self.valobj.GetType().GetBasicType(lldb.eBasicTypeChar)
- global counter
- self.count = counter
- counter = counter + 1
- return True # important: if we return False here, or fail to return, the test will fail
+
+ def __init__(self, valobj, dict):
+ self.valobj = valobj
+
+ def num_children(self):
+ if self.char.IsValid():
+ return 5
+ return 0
+
+ def get_child_index(self, name):
+ return 0
+
+ def get_child_at_index(self, index):
+ if index == 0:
+ return self.x.Cast(self.char)
+ if index == 4:
+ return self.valobj.CreateValueFromExpression(
+ str(index), '(char)(' + str(self.count) + ')')
+ return self.x.CreateChildAtOffset(str(index),
+ index,
+ self.char)
+
+ def update(self):
+ self.x = self.valobj.GetChildMemberWithName('x')
+ self.char = self.valobj.GetType().GetBasicType(lldb.eBasicTypeChar)
+ global counter
+ self.count = counter
+ counter = counter + 1
+ return True # important: if we return False here, or fail to return, the test will fail
+
def __lldb_init_module(debugger, dict):
- global counter
- counter = 0 \ No newline at end of file
+ global counter
+ counter = 0
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-script/TestDataFormatterScript.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-script/TestDataFormatterScript.py
index 7ebc1c14ce13..3355ca16305b 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-script/TestDataFormatterScript.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-script/TestDataFormatterScript.py
@@ -5,12 +5,13 @@ Test lldb data formatter subsystem.
from __future__ import print_function
-
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.lldbtest import *
import lldbsuite.test.lldbutil as lldbutil
+
class ScriptDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@@ -30,14 +31,15 @@ class ScriptDataFormatterTestCase(TestBase):
"""Test that that file and class static variables display correctly."""
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
self.runCmd("run", RUN_SUCCEEDED)
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
@@ -51,121 +53,133 @@ class ScriptDataFormatterTestCase(TestBase):
# Set the script here to ease the formatting
script = 'a = valobj.GetChildMemberWithName(\'integer\'); a_val = a.GetValue(); str = \'Hello from Python, \' + a_val + \' time\'; return str + (\'!\' if a_val == \'1\' else \'s!\');'
- self.runCmd("type summary add i_am_cool --python-script \"%s\"" % script)
+ self.runCmd(
+ "type summary add i_am_cool --python-script \"%s\"" %
+ script)
self.expect('type summary list i_am_cool', substrs=[script])
self.expect("frame variable one",
- substrs = ['Hello from Python',
- '1 time!'])
+ substrs=['Hello from Python',
+ '1 time!'])
self.expect("frame variable two",
- substrs = ['Hello from Python',
- '4 times!'])
-
- self.runCmd("n"); # skip ahead to make values change
+ substrs=['Hello from Python',
+ '4 times!'])
+
+ self.runCmd("n") # skip ahead to make values change
self.expect("frame variable three",
- substrs = ['Hello from Python, 10 times!',
- 'Hello from Python, 4 times!'])
+ substrs=['Hello from Python, 10 times!',
+ 'Hello from Python, 4 times!'])
+
+ self.runCmd("n") # skip ahead to make values change
- self.runCmd("n"); # skip ahead to make values change
-
self.expect("frame variable two",
- substrs = ['Hello from Python',
- '1 time!'])
+ substrs=['Hello from Python',
+ '1 time!'])
script = 'a = valobj.GetChildMemberWithName(\'integer\'); a_val = a.GetValue(); str = \'int says \' + a_val; return str;'
# Check that changes in the script are immediately reflected
- self.runCmd("type summary add i_am_cool --python-script \"%s\"" % script)
+ self.runCmd(
+ "type summary add i_am_cool --python-script \"%s\"" %
+ script)
self.expect("frame variable two",
- substrs = ['int says 1'])
-
+ substrs=['int says 1'])
+
self.expect("frame variable twoptr",
- substrs = ['int says 1'])
+ substrs=['int says 1'])
# Change the summary
- self.runCmd("type summary add --summary-string \"int says ${var.integer}, and float says ${var.floating}\" i_am_cool")
+ self.runCmd(
+ "type summary add --summary-string \"int says ${var.integer}, and float says ${var.floating}\" i_am_cool")
self.expect("frame variable two",
- substrs = ['int says 1',
- 'and float says 2.71'])
+ substrs=['int says 1',
+ 'and float says 2.71'])
# Try it for pointers
self.expect("frame variable twoptr",
- substrs = ['int says 1',
- 'and float says 2.71'])
+ substrs=['int says 1',
+ 'and float says 2.71'])
# Force a failure for pointers
- self.runCmd("type summary add i_am_cool -p --python-script \"%s\"" % script)
+ self.runCmd(
+ "type summary add i_am_cool -p --python-script \"%s\"" %
+ script)
self.expect("frame variable twoptr", matching=False,
- substrs = ['and float says 2.71'])
+ substrs=['and float says 2.71'])
- script = 'return \'Python summary\'';
+ script = 'return \'Python summary\''
- self.runCmd("type summary add --name test_summary --python-script \"%s\"" % script)
+ self.runCmd(
+ "type summary add --name test_summary --python-script \"%s\"" %
+ script)
# attach the Python named summary to someone
self.expect("frame variable one --summary test_summary",
- substrs = ['Python summary'])
+ substrs=['Python summary'])
# should not bind to the type
self.expect("frame variable two", matching=False,
- substrs = ['Python summary'])
+ substrs=['Python summary'])
# and should not stick to the variable
- self.expect("frame variable one",matching=False,
- substrs = ['Python summary'])
+ self.expect("frame variable one", matching=False,
+ substrs=['Python summary'])
- self.runCmd("type summary add i_am_cool --summary-string \"Text summary\"")
+ self.runCmd(
+ "type summary add i_am_cool --summary-string \"Text summary\"")
# should be temporary only
- self.expect("frame variable one",matching=False,
- substrs = ['Python summary'])
+ self.expect("frame variable one", matching=False,
+ substrs=['Python summary'])
# use the type summary
self.expect("frame variable two",
- substrs = ['Text summary'])
+ substrs=['Text summary'])
- self.runCmd("n"); # skip ahead to make values change
+ self.runCmd("n") # skip ahead to make values change
# both should use the type summary now
self.expect("frame variable one",
- substrs = ['Text summary'])
-
+ substrs=['Text summary'])
+
self.expect("frame variable two",
- substrs = ['Text summary'])
+ substrs=['Text summary'])
# disable type summary for pointers, and make a Python regex summary
- self.runCmd("type summary add i_am_cool -p --summary-string \"Text summary\"")
+ self.runCmd(
+ "type summary add i_am_cool -p --summary-string \"Text summary\"")
self.runCmd("type summary add -x cool --python-script \"%s\"" % script)
# variables should stick to the type summary
self.expect("frame variable one",
- substrs = ['Text summary'])
+ substrs=['Text summary'])
self.expect("frame variable two",
- substrs = ['Text summary'])
+ substrs=['Text summary'])
# array and pointer should match the Python one
self.expect("frame variable twoptr",
- substrs = ['Python summary'])
-
+ substrs=['Python summary'])
+
self.expect("frame variable array",
- substrs = ['Python summary'])
+ substrs=['Python summary'])
# return pointers to the type summary
- self.runCmd("type summary add i_am_cool --summary-string \"Text summary\"")
+ self.runCmd(
+ "type summary add i_am_cool --summary-string \"Text summary\"")
self.expect("frame variable one",
- substrs = ['Text summary'])
-
+ substrs=['Text summary'])
+
self.expect("frame variable two",
- substrs = ['Text summary'])
-
+ substrs=['Text summary'])
+
self.expect("frame variable twoptr",
- substrs = ['Text summary'])
-
+ substrs=['Text summary'])
+
self.expect("frame variable array",
- substrs = ['Python summary'])
+ substrs=['Python summary'])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py
index c186f1465cf5..5b52277e8b7a 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py
@@ -5,19 +5,24 @@ Test lldb data formatter subsystem.
from __future__ import print_function
-
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+
class SkipSummaryDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- @expectedFailureAll(oslist=['freebsd'], bugnumber="llvm.org/pr20548 fails to build on lab.llvm.org buildbot")
- @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24462, Data formatters have problems on Windows")
+ @expectedFailureAll(
+ oslist=['freebsd'],
+ bugnumber="llvm.org/pr20548 fails to build on lab.llvm.org buildbot")
+ @expectedFailureAll(
+ oslist=["windows"],
+ bugnumber="llvm.org/pr24462, Data formatters have problems on Windows")
def test_with_run_command(self):
"""Test data formatter commands."""
self.build()
@@ -34,15 +39,15 @@ class SkipSummaryDataFormatterTestCase(TestBase):
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
#import lldbsuite.test.lldbutil as lldbutil
- lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
-
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
self.runCmd("run", RUN_SUCCEEDED)
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
@@ -55,122 +60,146 @@ class SkipSummaryDataFormatterTestCase(TestBase):
# Setup the summaries for this scenario
#self.runCmd("type summary add --summary-string \"${var._M_dataplus._M_p}\" std::string")
- self.runCmd("type summary add --summary-string \"Level 1\" \"DeepData_1\"")
- self.runCmd("type summary add --summary-string \"Level 2\" \"DeepData_2\" -e")
- self.runCmd("type summary add --summary-string \"Level 3\" \"DeepData_3\"")
- self.runCmd("type summary add --summary-string \"Level 4\" \"DeepData_4\"")
- self.runCmd("type summary add --summary-string \"Level 5\" \"DeepData_5\"")
-
+ self.runCmd(
+ "type summary add --summary-string \"Level 1\" \"DeepData_1\"")
+ self.runCmd(
+ "type summary add --summary-string \"Level 2\" \"DeepData_2\" -e")
+ self.runCmd(
+ "type summary add --summary-string \"Level 3\" \"DeepData_3\"")
+ self.runCmd(
+ "type summary add --summary-string \"Level 4\" \"DeepData_4\"")
+ self.runCmd(
+ "type summary add --summary-string \"Level 5\" \"DeepData_5\"")
+
# Default case, just print out summaries
self.expect('frame variable',
- substrs = ['(DeepData_1) data1 = Level 1',
- '(DeepData_2) data2 = Level 2 {',
- 'm_child1 = Level 3',
- 'm_child2 = Level 3',
- 'm_child3 = Level 3',
- 'm_child4 = Level 3',
- '}'])
+ substrs=['(DeepData_1) data1 = Level 1',
+ '(DeepData_2) data2 = Level 2 {',
+ 'm_child1 = Level 3',
+ 'm_child2 = Level 3',
+ 'm_child3 = Level 3',
+ 'm_child4 = Level 3',
+ '}'])
# Skip the default (should be 1) levels of summaries
self.expect('frame variable --no-summary-depth',
- substrs = ['(DeepData_1) data1 = {',
- 'm_child1 = 0x',
- '}',
- '(DeepData_2) data2 = {',
- 'm_child1 = Level 3',
- 'm_child2 = Level 3',
- 'm_child3 = Level 3',
- 'm_child4 = Level 3',
- '}'])
+ substrs=['(DeepData_1) data1 = {',
+ 'm_child1 = 0x',
+ '}',
+ '(DeepData_2) data2 = {',
+ 'm_child1 = Level 3',
+ 'm_child2 = Level 3',
+ 'm_child3 = Level 3',
+ 'm_child4 = Level 3',
+ '}'])
# Now skip 2 levels of summaries
self.expect('frame variable --no-summary-depth=2',
- substrs = ['(DeepData_1) data1 = {',
- 'm_child1 = 0x',
- '}',
- '(DeepData_2) data2 = {',
- 'm_child1 = {',
- 'm_child1 = 0x',
- 'Level 4',
- 'm_child2 = {',
- 'm_child3 = {',
- '}'])
+ substrs=['(DeepData_1) data1 = {',
+ 'm_child1 = 0x',
+ '}',
+ '(DeepData_2) data2 = {',
+ 'm_child1 = {',
+ 'm_child1 = 0x',
+ 'Level 4',
+ 'm_child2 = {',
+ 'm_child3 = {',
+ '}'])
# Check that no "Level 3" comes out
- self.expect('frame variable data1.m_child1 --no-summary-depth=2', matching=False,
- substrs = ['Level 3'])
+ self.expect(
+ 'frame variable data1.m_child1 --no-summary-depth=2',
+ matching=False,
+ substrs=['Level 3'])
# Now expand a pointer with 2 level of skipped summaries
self.expect('frame variable data1.m_child1 --no-summary-depth=2',
- substrs = ['(DeepData_2 *) data1.m_child1 = 0x'])
+ substrs=['(DeepData_2 *) data1.m_child1 = 0x'])
# Deref and expand said pointer
self.expect('frame variable *data1.m_child1 --no-summary-depth=2',
- substrs = ['(DeepData_2) *data1.m_child1 = {',
- 'm_child2 = {',
- 'm_child1 = 0x',
- 'Level 4',
- '}'])
+ substrs=['(DeepData_2) *data1.m_child1 = {',
+ 'm_child2 = {',
+ 'm_child1 = 0x',
+ 'Level 4',
+ '}'])
# Expand an expression, skipping 2 layers of summaries
- self.expect('frame variable data1.m_child1->m_child2 --no-summary-depth=2',
- substrs = ['(DeepData_3) data1.m_child1->m_child2 = {',
- 'm_child2 = {',
- 'm_child1 = Level 5',
- 'm_child2 = Level 5',
- 'm_child3 = Level 5',
- '}'])
+ self.expect(
+ 'frame variable data1.m_child1->m_child2 --no-summary-depth=2',
+ substrs=[
+ '(DeepData_3) data1.m_child1->m_child2 = {',
+ 'm_child2 = {',
+ 'm_child1 = Level 5',
+ 'm_child2 = Level 5',
+ 'm_child3 = Level 5',
+ '}'])
# Expand same expression, skipping only 1 layer of summaries
- self.expect('frame variable data1.m_child1->m_child2 --no-summary-depth=1',
- substrs = ['(DeepData_3) data1.m_child1->m_child2 = {',
- 'm_child1 = 0x',
- 'Level 4',
- 'm_child2 = Level 4',
- '}'])
+ self.expect(
+ 'frame variable data1.m_child1->m_child2 --no-summary-depth=1',
+ substrs=[
+ '(DeepData_3) data1.m_child1->m_child2 = {',
+ 'm_child1 = 0x',
+ 'Level 4',
+ 'm_child2 = Level 4',
+ '}'])
# Bad debugging info on SnowLeopard gcc (Apple Inc. build 5666).
# Skip the following tests if the condition is met.
if self.getCompiler().endswith('gcc') and not self.getCompiler().endswith('llvm-gcc'):
- import re
- gcc_version_output = system([[lldbutil.which(self.getCompiler()), "-v"]])[1]
- #print("my output:", gcc_version_output)
- for line in gcc_version_output.split(os.linesep):
- m = re.search('\(Apple Inc\. build ([0-9]+)\)', line)
- #print("line:", line)
- if m:
- gcc_build = int(m.group(1))
- #print("gcc build:", gcc_build)
- if gcc_build >= 5666:
- # rdar://problem/9804600"
- self.skipTest("rdar://problem/9804600 wrong namespace for std::string in debug info")
+ import re
+ gcc_version_output = system(
+ [[lldbutil.which(self.getCompiler()), "-v"]])[1]
+ #print("my output:", gcc_version_output)
+ for line in gcc_version_output.split(os.linesep):
+ m = re.search('\(Apple Inc\. build ([0-9]+)\)', line)
+ #print("line:", line)
+ if m:
+ gcc_build = int(m.group(1))
+ #print("gcc build:", gcc_build)
+ if gcc_build >= 5666:
+ # rdar://problem/9804600"
+ self.skipTest(
+ "rdar://problem/9804600 wrong namespace for std::string in debug info")
# Expand same expression, skipping 3 layers of summaries
- self.expect('frame variable data1.m_child1->m_child2 --show-types --no-summary-depth=3',
- substrs = ['(DeepData_3) data1.m_child1->m_child2 = {',
- 'm_some_text = "Just a test"',
- 'm_child2 = {',
- 'm_some_text = "Just a test"'])
-
- # Expand within a standard string (might depend on the implementation of the C++ stdlib you use)
- self.expect('frame variable data1.m_child1->m_child2.m_child1.m_child2 --no-summary-depth=2',
- substrs = ['(DeepData_5) data1.m_child1->m_child2.m_child1.m_child2 = {',
- 'm_some_text = {',
- '_M_dataplus = (_M_p = "Just a test")'])
+ self.expect(
+ 'frame variable data1.m_child1->m_child2 --show-types --no-summary-depth=3',
+ substrs=[
+ '(DeepData_3) data1.m_child1->m_child2 = {',
+ 'm_some_text = "Just a test"',
+ 'm_child2 = {',
+ 'm_some_text = "Just a test"'])
+
+ # Expand within a standard string (might depend on the implementation
+ # of the C++ stdlib you use)
+ self.expect(
+ 'frame variable data1.m_child1->m_child2.m_child1.m_child2 --no-summary-depth=2',
+ substrs=[
+ '(DeepData_5) data1.m_child1->m_child2.m_child1.m_child2 = {',
+ 'm_some_text = {',
+ '_M_dataplus = (_M_p = "Just a test")'])
# Repeat the above, but only skip 1 level of summaries
- self.expect('frame variable data1.m_child1->m_child2.m_child1.m_child2 --no-summary-depth=1',
- substrs = ['(DeepData_5) data1.m_child1->m_child2.m_child1.m_child2 = {',
- 'm_some_text = "Just a test"',
- '}'])
-
- # Change summary and expand, first without --no-summary-depth then with --no-summary-depth
- self.runCmd("type summary add --summary-string \"${var.m_some_text}\" DeepData_5")
-
- self.expect('fr var data2.m_child4.m_child2.m_child2',
- substrs = ['(DeepData_5) data2.m_child4.m_child2.m_child2 = "Just a test"'])
-
- self.expect('fr var data2.m_child4.m_child2.m_child2 --no-summary-depth',
- substrs = ['(DeepData_5) data2.m_child4.m_child2.m_child2 = {',
- 'm_some_text = "Just a test"',
- '}'])
+ self.expect(
+ 'frame variable data1.m_child1->m_child2.m_child1.m_child2 --no-summary-depth=1',
+ substrs=[
+ '(DeepData_5) data1.m_child1->m_child2.m_child1.m_child2 = {',
+ 'm_some_text = "Just a test"',
+ '}'])
+
+ # Change summary and expand, first without --no-summary-depth then with
+ # --no-summary-depth
+ self.runCmd(
+ "type summary add --summary-string \"${var.m_some_text}\" DeepData_5")
+
+ self.expect('fr var data2.m_child4.m_child2.m_child2', substrs=[
+ '(DeepData_5) data2.m_child4.m_child2.m_child2 = "Just a test"'])
+
+ self.expect(
+ 'fr var data2.m_child4.m_child2.m_child2 --no-summary-depth',
+ substrs=[
+ '(DeepData_5) data2.m_child4.m_child2.m_child2 = {',
+ 'm_some_text = "Just a test"',
+ '}'])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-smart-array/TestDataFormatterSmartArray.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-smart-array/TestDataFormatterSmartArray.py
index b3f8ba7d048e..9e82f11ff36b 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-smart-array/TestDataFormatterSmartArray.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-smart-array/TestDataFormatterSmartArray.py
@@ -5,18 +5,21 @@ Test lldb data formatter subsystem.
from __future__ import print_function
-
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+
class SmartArrayDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24462, Data formatters have problems on Windows")
+ @expectedFailureAll(
+ oslist=["windows"],
+ bugnumber="llvm.org/pr24462, Data formatters have problems on Windows")
def test_with_run_command(self):
"""Test data formatter commands."""
self.build()
@@ -32,7 +35,8 @@ class SmartArrayDataFormatterTestCase(TestBase):
"""Test that that file and class static variables display correctly."""
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
self.runCmd("run", RUN_SUCCEEDED)
@@ -40,9 +44,9 @@ class SmartArrayDataFormatterTestCase(TestBase):
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
-
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
+
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
def cleanup():
@@ -56,338 +60,400 @@ class SmartArrayDataFormatterTestCase(TestBase):
self.runCmd("type summary add --summary-string \"${var%V}\" SomeData")
self.expect("frame variable data",
- substrs = ['SomeData @ 0x'])
+ substrs=['SomeData @ 0x'])
# ${var%s}
- self.runCmd("type summary add --summary-string \"ptr = ${var%s}\" \"char *\"")
+ self.runCmd(
+ "type summary add --summary-string \"ptr = ${var%s}\" \"char *\"")
self.expect("frame variable strptr",
- substrs = ['ptr = \"',
- 'Hello world!'])
+ substrs=['ptr = \"',
+ 'Hello world!'])
self.expect("frame variable other.strptr",
- substrs = ['ptr = \"',
- 'Nested Hello world!'])
-
- self.runCmd("type summary add --summary-string \"arr = ${var%s}\" -x \"char \\[[0-9]+\\]\"")
-
+ substrs=['ptr = \"',
+ 'Nested Hello world!'])
+
+ self.runCmd(
+ "type summary add --summary-string \"arr = ${var%s}\" -x \"char \\[[0-9]+\\]\"")
+
self.expect("frame variable strarr",
- substrs = ['arr = \"',
- 'Hello world!'])
-
+ substrs=['arr = \"',
+ 'Hello world!'])
+
self.expect("frame variable other.strarr",
- substrs = ['arr = \"',
- 'Nested Hello world!'])
+ substrs=['arr = \"',
+ 'Nested Hello world!'])
self.expect("p strarr",
- substrs = ['arr = \"',
- 'Hello world!'])
+ substrs=['arr = \"',
+ 'Hello world!'])
self.expect("p other.strarr",
- substrs = ['arr = \"',
- 'Nested Hello world!'])
+ substrs=['arr = \"',
+ 'Nested Hello world!'])
# ${var%c}
- self.runCmd("type summary add --summary-string \"ptr = ${var%c}\" \"char *\"")
-
+ self.runCmd(
+ "type summary add --summary-string \"ptr = ${var%c}\" \"char *\"")
+
self.expect("frame variable strptr",
- substrs = ['ptr = \"',
- 'Hello world!'])
-
+ substrs=['ptr = \"',
+ 'Hello world!'])
+
self.expect("frame variable other.strptr",
- substrs = ['ptr = \"',
- 'Nested Hello world!'])
+ substrs=['ptr = \"',
+ 'Nested Hello world!'])
self.expect("p strptr",
- substrs = ['ptr = \"',
- 'Hello world!'])
+ substrs=['ptr = \"',
+ 'Hello world!'])
self.expect("p other.strptr",
- substrs = ['ptr = \"',
- 'Nested Hello world!'])
+ substrs=['ptr = \"',
+ 'Nested Hello world!'])
- self.runCmd("type summary add --summary-string \"arr = ${var%c}\" -x \"char \\[[0-9]+\\]\"")
+ self.runCmd(
+ "type summary add --summary-string \"arr = ${var%c}\" -x \"char \\[[0-9]+\\]\"")
self.expect("frame variable strarr",
- substrs = ['arr = \"',
- 'Hello world!'])
+ substrs=['arr = \"',
+ 'Hello world!'])
self.expect("frame variable other.strarr",
- substrs = ['arr = \"',
- 'Nested Hello world!'])
-
+ substrs=['arr = \"',
+ 'Nested Hello world!'])
+
self.expect("p strarr",
- substrs = ['arr = \"',
- 'Hello world!'])
+ substrs=['arr = \"',
+ 'Hello world!'])
self.expect("p other.strarr",
- substrs = ['arr = \"',
- 'Nested Hello world!'])
+ substrs=['arr = \"',
+ 'Nested Hello world!'])
# ${var%char[]}
- self.runCmd("type summary add --summary-string \"arr = ${var%char[]}\" -x \"char \\[[0-9]+\\]\"")
+ self.runCmd(
+ "type summary add --summary-string \"arr = ${var%char[]}\" -x \"char \\[[0-9]+\\]\"")
self.expect("frame variable strarr",
- substrs = ['arr = \"',
- 'Hello world!'])
+ substrs=['arr = \"',
+ 'Hello world!'])
self.expect("frame variable other.strarr",
- substrs = ['arr = ',
- 'Nested Hello world!'])
+ substrs=['arr = ',
+ 'Nested Hello world!'])
self.expect("p strarr",
- substrs = ['arr = \"',
- 'Hello world!'])
+ substrs=['arr = \"',
+ 'Hello world!'])
self.expect("p other.strarr",
- substrs = ['arr = ',
- 'Nested Hello world!'])
+ substrs=['arr = ',
+ 'Nested Hello world!'])
- self.runCmd("type summary add --summary-string \"ptr = ${var%char[]}\" \"char *\"")
+ self.runCmd(
+ "type summary add --summary-string \"ptr = ${var%char[]}\" \"char *\"")
self.expect("frame variable strptr",
- substrs = ['ptr = \"',
- 'Hello world!'])
-
+ substrs=['ptr = \"',
+ 'Hello world!'])
+
self.expect("frame variable other.strptr",
- substrs = ['ptr = \"',
- 'Nested Hello world!'])
+ substrs=['ptr = \"',
+ 'Nested Hello world!'])
self.expect("p strptr",
- substrs = ['ptr = \"',
- 'Hello world!'])
+ substrs=['ptr = \"',
+ 'Hello world!'])
self.expect("p other.strptr",
- substrs = ['ptr = \"',
- 'Nested Hello world!'])
+ substrs=['ptr = \"',
+ 'Nested Hello world!'])
# ${var%a}
- self.runCmd("type summary add --summary-string \"arr = ${var%a}\" -x \"char \\[[0-9]+\\]\"")
+ self.runCmd(
+ "type summary add --summary-string \"arr = ${var%a}\" -x \"char \\[[0-9]+\\]\"")
self.expect("frame variable strarr",
- substrs = ['arr = \"',
- 'Hello world!'])
+ substrs=['arr = \"',
+ 'Hello world!'])
self.expect("frame variable other.strarr",
- substrs = ['arr = ',
- 'Nested Hello world!'])
+ substrs=['arr = ',
+ 'Nested Hello world!'])
self.expect("p strarr",
- substrs = ['arr = \"',
- 'Hello world!'])
+ substrs=['arr = \"',
+ 'Hello world!'])
self.expect("p other.strarr",
- substrs = ['arr = ',
- 'Nested Hello world!'])
+ substrs=['arr = ',
+ 'Nested Hello world!'])
- self.runCmd("type summary add --summary-string \"ptr = ${var%a}\" \"char *\"")
+ self.runCmd(
+ "type summary add --summary-string \"ptr = ${var%a}\" \"char *\"")
self.expect("frame variable strptr",
- substrs = ['ptr = \"',
- 'Hello world!'])
+ substrs=['ptr = \"',
+ 'Hello world!'])
self.expect("frame variable other.strptr",
- substrs = ['ptr = \"',
- 'Nested Hello world!'])
+ substrs=['ptr = \"',
+ 'Nested Hello world!'])
self.expect("p strptr",
- substrs = ['ptr = \"',
- 'Hello world!'])
+ substrs=['ptr = \"',
+ 'Hello world!'])
self.expect("p other.strptr",
- substrs = ['ptr = \"',
- 'Nested Hello world!'])
+ substrs=['ptr = \"',
+ 'Nested Hello world!'])
+
+ self.runCmd(
+ "type summary add --summary-string \"ptr = ${var[]%char[]}\" \"char *\"")
- self.runCmd("type summary add --summary-string \"ptr = ${var[]%char[]}\" \"char *\"")
-
# I do not know the size of the data, but you are asking for a full array slice..
# use the ${var%char[]} to obtain a string as result
self.expect("frame variable strptr", matching=False,
- substrs = ['ptr = \"',
- 'Hello world!'])
-
+ substrs=['ptr = \"',
+ 'Hello world!'])
+
self.expect("frame variable other.strptr", matching=False,
- substrs = ['ptr = \"',
- 'Nested Hello world!'])
+ substrs=['ptr = \"',
+ 'Nested Hello world!'])
self.expect("p strptr", matching=False,
- substrs = ['ptr = \"',
- 'Hello world!'])
+ substrs=['ptr = \"',
+ 'Hello world!'])
self.expect("p other.strptr", matching=False,
- substrs = ['ptr = \"',
- 'Nested Hello world!'])
+ substrs=['ptr = \"',
+ 'Nested Hello world!'])
# You asked an array-style printout...
- self.runCmd("type summary add --summary-string \"ptr = ${var[0-1]%char[]}\" \"char *\"")
-
+ self.runCmd(
+ "type summary add --summary-string \"ptr = ${var[0-1]%char[]}\" \"char *\"")
+
self.expect("frame variable strptr",
- substrs = ['ptr = ',
- '[{H},{e}]'])
-
+ substrs=['ptr = ',
+ '[{H},{e}]'])
+
self.expect("frame variable other.strptr",
- substrs = ['ptr = ',
- '[{N},{e}]'])
+ substrs=['ptr = ',
+ '[{N},{e}]'])
self.expect("p strptr",
- substrs = ['ptr = ',
- '[{H},{e}]'])
+ substrs=['ptr = ',
+ '[{H},{e}]'])
self.expect("p other.strptr",
- substrs = ['ptr = ',
- '[{N},{e}]'])
+ substrs=['ptr = ',
+ '[{N},{e}]'])
# using [] is required here
- self.runCmd("type summary add --summary-string \"arr = ${var%x}\" \"int [5]\"")
-
- self.expect("frame variable intarr",matching=False,
- substrs = ['0x00000001,0x00000001,0x00000002,0x00000003,0x00000005'])
-
- self.expect("frame variable other.intarr", matching=False,
- substrs = ['0x00000009,0x00000008,0x00000007,0x00000006,0x00000005'])
-
- self.runCmd("type summary add --summary-string \"arr = ${var[]%x}\" \"int [5]\"")
-
- self.expect("frame variable intarr",
- substrs = ['intarr = arr =',
- '0x00000001,0x00000001,0x00000002,0x00000003,0x00000005'])
-
- self.expect("frame variable other.intarr",
- substrs = ['intarr = arr =',
- '0x00000009,0x00000008,0x00000007,0x00000006,0x00000005'])
+ self.runCmd(
+ "type summary add --summary-string \"arr = ${var%x}\" \"int [5]\"")
+
+ self.expect("frame variable intarr", matching=False, substrs=[
+ '0x00000001,0x00000001,0x00000002,0x00000003,0x00000005'])
+
+ self.expect("frame variable other.intarr", matching=False, substrs=[
+ '0x00000009,0x00000008,0x00000007,0x00000006,0x00000005'])
+
+ self.runCmd(
+ "type summary add --summary-string \"arr = ${var[]%x}\" \"int [5]\"")
+
+ self.expect(
+ "frame variable intarr",
+ substrs=[
+ 'intarr = arr =',
+ '0x00000001,0x00000001,0x00000002,0x00000003,0x00000005'])
+
+ self.expect(
+ "frame variable other.intarr",
+ substrs=[
+ 'intarr = arr =',
+ '0x00000009,0x00000008,0x00000007,0x00000006,0x00000005'])
# printing each array item as an array
- self.runCmd("type summary add --summary-string \"arr = ${var[]%uint32_t[]}\" \"int [5]\"")
-
- self.expect("frame variable intarr",
- substrs = ['intarr = arr =',
- '{0x00000001},{0x00000001},{0x00000002},{0x00000003},{0x00000005}'])
-
- self.expect("frame variable other.intarr",
- substrs = ['intarr = arr = ',
- '{0x00000009},{0x00000008},{0x00000007},{0x00000006},{0x00000005}'])
+ self.runCmd(
+ "type summary add --summary-string \"arr = ${var[]%uint32_t[]}\" \"int [5]\"")
+
+ self.expect(
+ "frame variable intarr",
+ substrs=[
+ 'intarr = arr =',
+ '{0x00000001},{0x00000001},{0x00000002},{0x00000003},{0x00000005}'])
+
+ self.expect(
+ "frame variable other.intarr",
+ substrs=[
+ 'intarr = arr = ',
+ '{0x00000009},{0x00000008},{0x00000007},{0x00000006},{0x00000005}'])
# printing full array as an array
- self.runCmd("type summary add --summary-string \"arr = ${var%uint32_t[]}\" \"int [5]\"")
-
- self.expect("frame variable intarr",
- substrs = ['intarr = arr =',
- '0x00000001,0x00000001,0x00000002,0x00000003,0x00000005'])
+ self.runCmd(
+ "type summary add --summary-string \"arr = ${var%uint32_t[]}\" \"int [5]\"")
- self.expect("frame variable other.intarr",
- substrs = ['intarr = arr =',
- '0x00000009,0x00000008,0x00000007,0x00000006,0x00000005'])
+ self.expect(
+ "frame variable intarr",
+ substrs=[
+ 'intarr = arr =',
+ '0x00000001,0x00000001,0x00000002,0x00000003,0x00000005'])
+
+ self.expect(
+ "frame variable other.intarr",
+ substrs=[
+ 'intarr = arr =',
+ '0x00000009,0x00000008,0x00000007,0x00000006,0x00000005'])
# printing each array item as an array
- self.runCmd("type summary add --summary-string \"arr = ${var[]%float32[]}\" \"float [7]\"")
-
- self.expect("frame variable flarr",
- substrs = ['flarr = arr =',
- '{78.5},{77.25},{78},{76.125},{76.75},{76.875},{77}'])
-
- self.expect("frame variable other.flarr",
- substrs = ['flarr = arr = ',
- '{25.5},{25.25},{25.125},{26.75},{27.375},{27.5},{26.125}'])
-
+ self.runCmd(
+ "type summary add --summary-string \"arr = ${var[]%float32[]}\" \"float [7]\"")
+
+ self.expect(
+ "frame variable flarr",
+ substrs=[
+ 'flarr = arr =',
+ '{78.5},{77.25},{78},{76.125},{76.75},{76.875},{77}'])
+
+ self.expect(
+ "frame variable other.flarr",
+ substrs=[
+ 'flarr = arr = ',
+ '{25.5},{25.25},{25.125},{26.75},{27.375},{27.5},{26.125}'])
+
# printing full array as an array
- self.runCmd("type summary add --summary-string \"arr = ${var%float32[]}\" \"float [7]\"")
-
+ self.runCmd(
+ "type summary add --summary-string \"arr = ${var%float32[]}\" \"float [7]\"")
+
self.expect("frame variable flarr",
- substrs = ['flarr = arr =',
- '78.5,77.25,78,76.125,76.75,76.875,77'])
-
+ substrs=['flarr = arr =',
+ '78.5,77.25,78,76.125,76.75,76.875,77'])
+
self.expect("frame variable other.flarr",
- substrs = ['flarr = arr =',
- '25.5,25.25,25.125,26.75,27.375,27.5,26.125'])
+ substrs=['flarr = arr =',
+ '25.5,25.25,25.125,26.75,27.375,27.5,26.125'])
# using array smart summary strings for pointers should make no sense
- self.runCmd("type summary add --summary-string \"arr = ${var%float32[]}\" \"float *\"")
- self.runCmd("type summary add --summary-string \"arr = ${var%int32_t[]}\" \"int *\"")
+ self.runCmd(
+ "type summary add --summary-string \"arr = ${var%float32[]}\" \"float *\"")
+ self.runCmd(
+ "type summary add --summary-string \"arr = ${var%int32_t[]}\" \"int *\"")
self.expect("frame variable flptr", matching=False,
- substrs = ['78.5,77.25,78,76.125,76.75,76.875,77'])
-
+ substrs=['78.5,77.25,78,76.125,76.75,76.875,77'])
+
self.expect("frame variable intptr", matching=False,
- substrs = ['1,1,2,3,5'])
+ substrs=['1,1,2,3,5'])
# use y and Y
- self.runCmd("type summary add --summary-string \"arr = ${var%y}\" \"float [7]\"")
- self.runCmd("type summary add --summary-string \"arr = ${var%y}\" \"int [5]\"")
+ self.runCmd(
+ "type summary add --summary-string \"arr = ${var%y}\" \"float [7]\"")
+ self.runCmd(
+ "type summary add --summary-string \"arr = ${var%y}\" \"int [5]\"")
if process.GetByteOrder() == lldb.eByteOrderLittle:
- self.expect("frame variable flarr",
- substrs = ['flarr = arr =',
- '00 00 9d 42,00 80 9a 42,00 00 9c 42,00 40 98 42,00 80 99 42,00 c0 99 42,00 00 9a 42'])
+ self.expect(
+ "frame variable flarr",
+ substrs=[
+ 'flarr = arr =',
+ '00 00 9d 42,00 80 9a 42,00 00 9c 42,00 40 98 42,00 80 99 42,00 c0 99 42,00 00 9a 42'])
else:
- self.expect("frame variable flarr",
- substrs = ['flarr = arr =',
- '42 9d 00 00,42 9a 80 00,42 9c 00 00,42 98 40 00,42 99 80 00,42 99 c0 00,42 9a 00 00'])
+ self.expect(
+ "frame variable flarr",
+ substrs=[
+ 'flarr = arr =',
+ '42 9d 00 00,42 9a 80 00,42 9c 00 00,42 98 40 00,42 99 80 00,42 99 c0 00,42 9a 00 00'])
if process.GetByteOrder() == lldb.eByteOrderLittle:
- self.expect("frame variable other.flarr",
- substrs = ['flarr = arr =',
- '00 00 cc 41,00 00 ca 41,00 00 c9 41,00 00 d6 41,00 00 db 41,00 00 dc 41,00 00 d1 41'])
+ self.expect(
+ "frame variable other.flarr",
+ substrs=[
+ 'flarr = arr =',
+ '00 00 cc 41,00 00 ca 41,00 00 c9 41,00 00 d6 41,00 00 db 41,00 00 dc 41,00 00 d1 41'])
else:
- self.expect("frame variable other.flarr",
- substrs = ['flarr = arr =',
- '41 cc 00 00,41 ca 00 00,41 c9 00 00,41 d6 00 00,41 db 00 00,41 dc 00 00,41 d1 00 00'])
+ self.expect(
+ "frame variable other.flarr",
+ substrs=[
+ 'flarr = arr =',
+ '41 cc 00 00,41 ca 00 00,41 c9 00 00,41 d6 00 00,41 db 00 00,41 dc 00 00,41 d1 00 00'])
if process.GetByteOrder() == lldb.eByteOrderLittle:
- self.expect("frame variable intarr",
- substrs = ['intarr = arr =',
- '01 00 00 00,01 00 00 00,02 00 00 00,03 00 00 00,05 00 00 00'])
+ self.expect(
+ "frame variable intarr",
+ substrs=[
+ 'intarr = arr =',
+ '01 00 00 00,01 00 00 00,02 00 00 00,03 00 00 00,05 00 00 00'])
else:
- self.expect("frame variable intarr",
- substrs = ['intarr = arr =',
- '00 00 00 01,00 00 00 01,00 00 00 02,00 00 00 03,00 00 00 05'])
+ self.expect(
+ "frame variable intarr",
+ substrs=[
+ 'intarr = arr =',
+ '00 00 00 01,00 00 00 01,00 00 00 02,00 00 00 03,00 00 00 05'])
if process.GetByteOrder() == lldb.eByteOrderLittle:
- self.expect("frame variable other.intarr",
- substrs = ['intarr = arr = ',
- '09 00 00 00,08 00 00 00,07 00 00 00,06 00 00 00,05 00 00 00'])
+ self.expect(
+ "frame variable other.intarr",
+ substrs=[
+ 'intarr = arr = ',
+ '09 00 00 00,08 00 00 00,07 00 00 00,06 00 00 00,05 00 00 00'])
else:
- self.expect("frame variable other.intarr",
- substrs = ['intarr = arr = ',
- '00 00 00 09,00 00 00 08,00 00 00 07,00 00 00 06,00 00 00 05'])
-
- self.runCmd("type summary add --summary-string \"arr = ${var%Y}\" \"float [7]\"")
- self.runCmd("type summary add --summary-string \"arr = ${var%Y}\" \"int [5]\"")
-
+ self.expect(
+ "frame variable other.intarr",
+ substrs=[
+ 'intarr = arr = ',
+ '00 00 00 09,00 00 00 08,00 00 00 07,00 00 00 06,00 00 00 05'])
+
+ self.runCmd(
+ "type summary add --summary-string \"arr = ${var%Y}\" \"float [7]\"")
+ self.runCmd(
+ "type summary add --summary-string \"arr = ${var%Y}\" \"int [5]\"")
+
if process.GetByteOrder() == lldb.eByteOrderLittle:
- self.expect("frame variable flarr",
- substrs = ['flarr = arr =',
- '00 00 9d 42 ...B,00 80 9a 42 ...B,00 00 9c 42 ...B,00 40 98 42 .@.B,00 80 99 42 ...B,00 c0 99 42 ...B,00 00 9a 42 ...B'])
+ self.expect(
+ "frame variable flarr",
+ substrs=[
+ 'flarr = arr =',
+ '00 00 9d 42 ...B,00 80 9a 42 ...B,00 00 9c 42 ...B,00 40 98 42 .@.B,00 80 99 42 ...B,00 c0 99 42 ...B,00 00 9a 42 ...B'])
else:
- self.expect("frame variable flarr",
- substrs = ['flarr = arr =',
- '42 9d 00 00 B...,42 9a 80 00 B...,42 9c 00 00 B...,42 98 40 00 B.@.,42 99 80 00 B...,42 99 c0 00 B...,42 9a 00 00 B...'])
+ self.expect(
+ "frame variable flarr",
+ substrs=[
+ 'flarr = arr =',
+ '42 9d 00 00 B...,42 9a 80 00 B...,42 9c 00 00 B...,42 98 40 00 B.@.,42 99 80 00 B...,42 99 c0 00 B...,42 9a 00 00 B...'])
if process.GetByteOrder() == lldb.eByteOrderLittle:
- self.expect("frame variable other.flarr",
- substrs = ['flarr = arr =',
- '00 00 cc 41 ...A,00 00 ca 41 ...A,00 00 c9 41 ...A,00 00 d6 41 ...A,00 00 db 41 ...A,00 00 dc 41 ...A,00 00 d1 41 ...A'])
+ self.expect(
+ "frame variable other.flarr",
+ substrs=[
+ 'flarr = arr =',
+ '00 00 cc 41 ...A,00 00 ca 41 ...A,00 00 c9 41 ...A,00 00 d6 41 ...A,00 00 db 41 ...A,00 00 dc 41 ...A,00 00 d1 41 ...A'])
else:
- self.expect("frame variable other.flarr",
- substrs = ['flarr = arr =',
- '41 cc 00 00 A...,41 ca 00 00 A...,41 c9 00 00 A...,41 d6 00 00 A...,41 db 00 00 A...,41 dc 00 00 A...,41 d1 00 00 A...'])
+ self.expect(
+ "frame variable other.flarr",
+ substrs=[
+ 'flarr = arr =',
+ '41 cc 00 00 A...,41 ca 00 00 A...,41 c9 00 00 A...,41 d6 00 00 A...,41 db 00 00 A...,41 dc 00 00 A...,41 d1 00 00 A...'])
if process.GetByteOrder() == lldb.eByteOrderLittle:
self.expect("frame variable intarr",
- substrs = ['intarr = arr =',
- '....,01 00 00 00',
- '....,05 00 00 00'])
+ substrs=['intarr = arr =',
+ '....,01 00 00 00',
+ '....,05 00 00 00'])
else:
self.expect("frame variable intarr",
- substrs = ['intarr = arr =',
- '....,00 00 00 01',
- '....,00 00 00 05'])
+ substrs=['intarr = arr =',
+ '....,00 00 00 01',
+ '....,00 00 00 05'])
if process.GetByteOrder() == lldb.eByteOrderLittle:
self.expect("frame variable other.intarr",
- substrs = ['intarr = arr = ',
- '09 00 00 00',
- '....,07 00 00 00'])
+ substrs=['intarr = arr = ',
+ '09 00 00 00',
+ '....,07 00 00 00'])
else:
self.expect("frame variable other.intarr",
- substrs = ['intarr = arr = ',
- '00 00 00 09',
- '....,00 00 00 07'])
+ substrs=['intarr = arr = ',
+ '00 00 00 09',
+ '....,00 00 00 07'])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/TestLibCxxAtomic.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/TestLibCxxAtomic.py
index 083f713c259d..2b63dbb1c83b 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/TestLibCxxAtomic.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/TestLibCxxAtomic.py
@@ -5,13 +5,14 @@ Test lldb data formatter subsystem.
from __future__ import print_function
-
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+
class LibCxxAtomicTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@@ -23,30 +24,39 @@ class LibCxxAtomicTestCase(TestBase):
return var
@skipIf(compiler="gcc")
- @skipIfWindows # libc++ not ported to Windows yet
+ @skipIfWindows # libc++ not ported to Windows yet
def test(self):
"""Test that std::atomic as defined by libc++ is correctly printed by LLDB"""
self.build()
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- bkpt = self.target().FindBreakpointByID(lldbutil.run_break_set_by_source_regexp (self, "Set break point at this line."))
+ bkpt = self.target().FindBreakpointByID(
+ lldbutil.run_break_set_by_source_regexp(
+ self, "Set break point at this line."))
self.runCmd("run", RUN_SUCCEEDED)
- lldbutil.skip_if_library_missing(self, self.target(), lldbutil.PrintableRegex("libc\+\+"))
+ lldbutil.skip_if_library_missing(
+ self, self.target(), lldbutil.PrintableRegex("libc\+\+"))
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
-
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
+
s = self.get_variable('s')
i = self.get_variable('i')
-
- if self.TraceOn(): print(s)
- if self.TraceOn(): print(i)
-
+
+ if self.TraceOn():
+ print(s)
+ if self.TraceOn():
+ print(i)
+
self.assertTrue(i.GetValueAsUnsigned(0) == 5, "i == 5")
self.assertTrue(s.GetNumChildren() == 2, "s has two children")
- self.assertTrue(s.GetChildAtIndex(0).GetValueAsUnsigned(0) == 1, "s.x == 1")
- self.assertTrue(s.GetChildAtIndex(1).GetValueAsUnsigned(0) == 2, "s.y == 2")
+ self.assertTrue(
+ s.GetChildAtIndex(0).GetValueAsUnsigned(0) == 1,
+ "s.x == 1")
+ self.assertTrue(
+ s.GetChildAtIndex(1).GetValueAsUnsigned(0) == 2,
+ "s.y == 2")
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/function/Makefile b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/function/Makefile
new file mode 100644
index 000000000000..fdd717119d95
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/function/Makefile
@@ -0,0 +1,5 @@
+LEVEL = ../../../../../make
+CXX_SOURCES := main.cpp
+CXXFLAGS += -std=c++11
+USE_LIBCPP := 1
+include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/function/TestLibCxxFunction.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/function/TestLibCxxFunction.py
new file mode 100644
index 000000000000..6a832e02990a
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/function/TestLibCxxFunction.py
@@ -0,0 +1,56 @@
+"""
+Test lldb data formatter subsystem.
+"""
+
+from __future__ import print_function
+
+
+import os
+import time
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class LibCxxFunctionTestCase(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ def get_variable(self, name):
+ var = self.frame().FindVariable(name)
+ var.SetPreferDynamicValue(lldb.eDynamicCanRunTarget)
+ var.SetPreferSyntheticValue(True)
+ return var
+
+ @skipIf(compiler="gcc")
+ @skipIfWindows # libc++ not ported to Windows yet
+ def test(self):
+ """Test that std::function as defined by libc++ is correctly printed by LLDB"""
+ self.build()
+ self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+
+ bkpt = self.target().FindBreakpointByID(
+ lldbutil.run_break_set_by_source_regexp(
+ self, "Set break point at this line."))
+
+ self.runCmd("run", RUN_SUCCEEDED)
+
+ lldbutil.skip_if_library_missing(
+ self, self.target(), lldbutil.PrintableRegex("libc\+\+"))
+
+ # The stop reason of the thread should be breakpoint.
+ self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
+
+ f1 = self.get_variable('f1')
+ f2 = self.get_variable('f2')
+
+ if self.TraceOn():
+ print(f1)
+ if self.TraceOn():
+ print(f2)
+
+ self.assertTrue(f1.GetValueAsUnsigned(0) != 0, 'f1 has a valid value')
+ self.assertTrue(f2.GetValueAsUnsigned(0) != 0, 'f2 has a valid value')
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/function/main.cpp b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/function/main.cpp
new file mode 100644
index 000000000000..cfe689b29b01
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/function/main.cpp
@@ -0,0 +1,25 @@
+//===-- main.cpp --------------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include <functional>
+
+int foo(int x, int y) {
+ return x + y - 1;
+}
+
+int main ()
+{
+ int acc = 42;
+ std::function<int (int,int)> f1 = foo;
+ std::function<int (int)> f2 = [acc,f1] (int x) -> int {
+ return x+f1(acc,x);
+ };
+ return f1(acc,acc) + f2(acc); // Set break point at this line.
+}
+
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py
index d452c1be69bf..f0857f420fc3 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py
@@ -5,37 +5,44 @@ Test lldb data formatter subsystem.
from __future__ import print_function
-
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+
class InitializerListTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- @skipIfWindows # libc++ not ported to Windows yet
+ @skipIfWindows # libc++ not ported to Windows yet
@skipIf(compiler="gcc")
- @expectedFailureAll(oslist=["linux"], bugnumber="fails on clang 3.5 and tot")
+ @expectedFailureAll(
+ oslist=["linux"],
+ bugnumber="fails on clang 3.5 and tot")
def test(self):
"""Test that that file and class static variables display correctly."""
self.build()
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- bkpt = self.target().FindBreakpointByID(lldbutil.run_break_set_by_source_regexp (self, "Set break point at this line."))
+ bkpt = self.target().FindBreakpointByID(
+ lldbutil.run_break_set_by_source_regexp(
+ self, "Set break point at this line."))
self.runCmd("run", RUN_SUCCEEDED)
- lldbutil.skip_if_library_missing(self, self.target(), lldbutil.PrintableRegex("libc\+\+"))
+ lldbutil.skip_if_library_missing(
+ self, self.target(), lldbutil.PrintableRegex("libc\+\+"))
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
- self.expect("frame variable ili", substrs = ['[1] = 2','[4] = 5'])
- self.expect("frame variable ils", substrs = ['[4] = "surprise it is a long string!! yay!!"'])
+ self.expect("frame variable ili", substrs=['[1] = 2', '[4] = 5'])
+ self.expect("frame variable ils", substrs=[
+ '[4] = "surprise it is a long string!! yay!!"'])
- self.expect('image list', substrs = self.getLibcPlusPlusLibs())
+ self.expect('image list', substrs=self.getLibcPlusPlusLibs())
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py
index 23f6956cf3f0..5d23fcef04ce 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py
@@ -5,13 +5,14 @@ Test lldb data formatter subsystem.
from __future__ import print_function
-
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+
class LibcxxIteratorDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@@ -23,22 +24,24 @@ class LibcxxIteratorDataFormatterTestCase(TestBase):
self.line = line_number('main.cpp', '// Set break point at this line.')
@skipIf(compiler="gcc")
- @skipIfWindows # libc++ not ported to Windows yet
+ @skipIfWindows # libc++ not ported to Windows yet
def test_with_run_command(self):
"""Test that libc++ iterators format properly."""
self.build()
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=-1)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.cpp", self.line, num_expected_locations=-1)
self.runCmd("run", RUN_SUCCEEDED)
- lldbutil.skip_if_library_missing(self, self.target(), lldbutil.PrintableRegex("libc\+\+"))
+ lldbutil.skip_if_library_missing(
+ self, self.target(), lldbutil.PrintableRegex("libc\+\+"))
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
@@ -47,21 +50,31 @@ class LibcxxIteratorDataFormatterTestCase(TestBase):
self.runCmd('type summary clear', check=False)
self.runCmd('type filter clear', check=False)
self.runCmd('type synth clear', check=False)
- self.runCmd("settings set target.max-children-count 256", check=False)
+ self.runCmd(
+ "settings set target.max-children-count 256",
+ check=False)
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
- self.expect('image list', substrs = self.getLibcPlusPlusLibs())
+ self.expect('image list', substrs=self.getLibcPlusPlusLibs())
- self.expect('frame variable ivI', substrs = ['item = 3'])
- self.expect('expr ivI', substrs = ['item = 3'])
+ self.expect('frame variable ivI', substrs=['item = 3'])
+ self.expect('expr ivI', substrs=['item = 3'])
- self.expect('frame variable iimI', substrs = ['first = 0','second = 12'])
- self.expect('expr iimI', substrs = ['first = 0','second = 12'])
+ self.expect(
+ 'frame variable iimI',
+ substrs=[
+ 'first = 43981',
+ 'second = 61681'])
+ self.expect('expr iimI', substrs=['first = 43981', 'second = 61681'])
- self.expect('frame variable simI', substrs = ['first = "world"','second = 42'])
- self.expect('expr simI', substrs = ['first = "world"','second = 42'])
+ self.expect(
+ 'frame variable simI',
+ substrs=[
+ 'first = "world"',
+ 'second = 42'])
+ self.expect('expr simI', substrs=['first = "world"', 'second = 42'])
- self.expect('frame variable svI', substrs = ['item = "hello"'])
- self.expect('expr svI', substrs = ['item = "hello"'])
+ self.expect('frame variable svI', substrs=['item = "hello"'])
+ self.expect('expr svI', substrs=['item = "hello"'])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/main.cpp b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/main.cpp
index 97b37851f53d..058a79317d19 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/main.cpp
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/main.cpp
@@ -20,23 +20,23 @@ typedef string_vector::iterator svter;
int main()
{
- intint_map iim;
- iim[0] = 12;
-
+ intint_map iim;
+ iim[0xABCD] = 0xF0F1;
+
strint_map sim;
sim["world"] = 42;
-
+
int_vector iv;
iv.push_back(3);
-
+
string_vector sv;
sv.push_back("hello");
iimter iimI = iim.begin();
simter simI = sim.begin();
-
+
ivter ivI = iv.begin();
svter svI = sv.begin();
- return 0; // Set break point at this line.
+ return 0; // Set break point at this line.
} \ No newline at end of file
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py
index 6fcdc37465db..dd97a9ab5977 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py
@@ -5,13 +5,15 @@ Test lldb data formatter subsystem.
from __future__ import print_function
-
-import os, time, re
+import os
+import time
+import re
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+
class LibcxxListDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@@ -21,31 +23,38 @@ class LibcxxListDataFormatterTestCase(TestBase):
TestBase.setUp(self)
# Find the line number to break at.
self.line = line_number('main.cpp', '// Set break point at this line.')
- self.line2 = line_number('main.cpp', '// Set second break point at this line.')
- self.line3 = line_number('main.cpp', '// Set third break point at this line.')
- self.line4 = line_number('main.cpp', '// Set fourth break point at this line.')
+ self.line2 = line_number('main.cpp',
+ '// Set second break point at this line.')
+ self.line3 = line_number('main.cpp',
+ '// Set third break point at this line.')
+ self.line4 = line_number('main.cpp',
+ '// Set fourth break point at this line.')
@skipIf(compiler="gcc")
- @skipIfWindows # libc++ not ported to Windows yet
- @expectedFailureAll(oslist=["macosx"], bugnumber="rdar://25499635")
+ @skipIfWindows # libc++ not ported to Windows yet
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
-
- lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=-1)
- lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line2, num_expected_locations=-1)
- lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line3, num_expected_locations=-1)
- lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line4, num_expected_locations=-1)
+
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.cpp", self.line, num_expected_locations=-1)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.cpp", self.line2, num_expected_locations=-1)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.cpp", self.line3, num_expected_locations=-1)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.cpp", self.line4, num_expected_locations=-1)
self.runCmd("run", RUN_SUCCEEDED)
- lldbutil.skip_if_library_missing(self, self.target(), lldbutil.PrintableRegex("libc\+\+"))
+ lldbutil.skip_if_library_missing(
+ self, self.target(), lldbutil.PrintableRegex("libc\+\+"))
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
@@ -54,135 +63,154 @@ class LibcxxListDataFormatterTestCase(TestBase):
self.runCmd('type summary clear', check=False)
self.runCmd('type filter clear', check=False)
self.runCmd('type synth clear', check=False)
- self.runCmd("settings set target.max-children-count 256", check=False)
+ self.runCmd(
+ "settings set target.max-children-count 256",
+ check=False)
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
self.runCmd("frame variable numbers_list --show-types")
- self.runCmd("type summary add std::int_list std::string_list int_list string_list --summary-string \"list has ${svar%#} items\" -e")
+ self.runCmd(
+ "type summary add std::int_list std::string_list int_list string_list --summary-string \"list has ${svar%#} items\" -e")
self.runCmd("type format add -f hex int")
self.expect("frame variable numbers_list --raw", matching=False,
- substrs = ['list has 0 items',
- '{}'])
+ substrs=['list has 0 items',
+ '{}'])
self.expect("frame variable numbers_list",
- substrs = ['list has 0 items',
- '{}'])
+ substrs=['list has 0 items',
+ '{}'])
self.expect("p numbers_list",
- substrs = ['list has 0 items',
- '{}'])
+ substrs=['list has 0 items',
+ '{}'])
self.runCmd("n")
self.expect("frame variable numbers_list",
- substrs = ['list has 1 items',
- '[0] = ',
- '0x12345678'])
+ substrs=['list has 1 items',
+ '[0] = ',
+ '0x12345678'])
- self.runCmd("n");self.runCmd("n");self.runCmd("n");
+ self.runCmd("n")
+ self.runCmd("n")
+ self.runCmd("n")
self.expect("frame variable numbers_list",
- substrs = ['list has 4 items',
- '[0] = ',
- '0x12345678',
- '[1] =',
- '0x11223344',
- '[2] =',
- '0xbeeffeed',
- '[3] =',
- '0x00abba00'])
-
- self.runCmd("n");self.runCmd("n");
+ substrs=['list has 4 items',
+ '[0] = ',
+ '0x12345678',
+ '[1] =',
+ '0x11223344',
+ '[2] =',
+ '0xbeeffeed',
+ '[3] =',
+ '0x00abba00'])
+
+ self.runCmd("n")
+ self.runCmd("n")
self.expect("frame variable numbers_list",
- substrs = ['list has 6 items',
- '[0] = ',
- '0x12345678',
- '0x11223344',
- '0xbeeffeed',
- '0x00abba00',
- '[4] =',
- '0x0abcdef0',
- '[5] =',
- '0x0cab0cab'])
+ substrs=['list has 6 items',
+ '[0] = ',
+ '0x12345678',
+ '0x11223344',
+ '0xbeeffeed',
+ '0x00abba00',
+ '[4] =',
+ '0x0abcdef0',
+ '[5] =',
+ '0x0cab0cab'])
self.expect("p numbers_list",
- substrs = ['list has 6 items',
- '[0] = ',
- '0x12345678',
- '0x11223344',
- '0xbeeffeed',
- '0x00abba00',
- '[4] =',
- '0x0abcdef0',
- '[5] =',
- '0x0cab0cab'])
+ substrs=['list has 6 items',
+ '[0] = ',
+ '0x12345678',
+ '0x11223344',
+ '0xbeeffeed',
+ '0x00abba00',
+ '[4] =',
+ '0x0abcdef0',
+ '[5] =',
+ '0x0cab0cab'])
# check access-by-index
self.expect("frame variable numbers_list[0]",
- substrs = ['0x12345678']);
+ substrs=['0x12345678'])
self.expect("frame variable numbers_list[1]",
- substrs = ['0x11223344']);
+ substrs=['0x11223344'])
self.runCmd("n")
-
+
self.expect("frame variable numbers_list",
- substrs = ['list has 0 items',
- '{}'])
+ substrs=['list has 0 items',
+ '{}'])
+
+ self.runCmd("n")
+ self.runCmd("n")
+ self.runCmd("n")
+ self.runCmd("n")
- self.runCmd("n");self.runCmd("n");self.runCmd("n");self.runCmd("n");
-
self.expect("frame variable numbers_list",
- substrs = ['list has 4 items',
- '[0] = ', '1',
- '[1] = ', '2',
- '[2] = ', '3',
- '[3] = ', '4'])
+ substrs=['list has 4 items',
+ '[0] = ', '1',
+ '[1] = ', '2',
+ '[2] = ', '3',
+ '[3] = ', '4'])
# check that MightHaveChildren() gets it right
- self.assertTrue(self.frame().FindVariable("numbers_list").MightHaveChildren(), "numbers_list.MightHaveChildren() says False for non empty!")
+ self.assertTrue(
+ self.frame().FindVariable("numbers_list").MightHaveChildren(),
+ "numbers_list.MightHaveChildren() says False for non empty!")
self.runCmd("type format delete int")
self.runCmd("c")
self.expect("frame variable text_list",
- substrs = ['list has 3 items',
- '[0]', 'goofy',
- '[1]', 'is',
- '[2]', 'smart'])
+ substrs=['list has 3 items',
+ '[0]', 'goofy',
+ '[1]', 'is',
+ '[2]', 'smart'])
# check that MightHaveChildren() gets it right
- self.assertTrue(self.frame().FindVariable("text_list").MightHaveChildren(), "text_list.MightHaveChildren() says False for non empty!")
+ self.assertTrue(
+ self.frame().FindVariable("text_list").MightHaveChildren(),
+ "text_list.MightHaveChildren() says False for non empty!")
self.expect("p text_list",
- substrs = ['list has 3 items',
- '\"goofy\"',
- '\"is\"',
- '\"smart\"'])
-
+ substrs=['list has 3 items',
+ '\"goofy\"',
+ '\"is\"',
+ '\"smart\"'])
+
self.runCmd("n")
# check access-by-index
self.expect("frame variable text_list[0]",
- substrs = ['goofy']);
+ substrs=['goofy'])
self.expect("frame variable text_list[3]",
- substrs = ['!!!']);
-
+ substrs=['!!!'])
+
self.runCmd("continue")
-
+
# check that the list provider correctly updates if elements move
countingList = self.frame().FindVariable("countingList")
countingList.SetPreferDynamicValue(True)
countingList.SetPreferSyntheticValue(True)
-
- self.assertTrue(countingList.GetChildAtIndex(0).GetValueAsUnsigned(0) == 3141, "list[0] == 3141")
- self.assertTrue(countingList.GetChildAtIndex(1).GetValueAsUnsigned(0) == 3141, "list[1] == 3141")
-
+
+ self.assertTrue(countingList.GetChildAtIndex(
+ 0).GetValueAsUnsigned(0) == 3141, "list[0] == 3141")
+ self.assertTrue(countingList.GetChildAtIndex(
+ 1).GetValueAsUnsigned(0) == 3141, "list[1] == 3141")
+
self.runCmd("continue")
- self.assertTrue(countingList.GetChildAtIndex(0).GetValueAsUnsigned(0) == 3141, "uniqued list[0] == 3141")
- self.assertTrue(countingList.GetChildAtIndex(1).GetValueAsUnsigned(0) == 3142, "uniqued list[1] == 3142")
+ self.assertTrue(
+ countingList.GetChildAtIndex(0).GetValueAsUnsigned(0) == 3141,
+ "uniqued list[0] == 3141")
+ self.assertTrue(
+ countingList.GetChildAtIndex(1).GetValueAsUnsigned(0) == 3142,
+ "uniqued list[1] == 3142")
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py
index 9e68e1dbc004..e2e082c795f7 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py
@@ -6,19 +6,21 @@ corruption).
from __future__ import print_function
-
-import os, time, re
+import os
+import time
+import re
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+
class LibcxxListDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@skipIf(compiler="gcc")
- @skipIfWindows # libc++ not ported to Windows yet
+ @skipIfWindows # libc++ not ported to Windows yet
@add_test_categories(["pyapi"])
@skipIfDarwin # rdar://25499635
def test_with_run_command(self):
@@ -27,29 +29,47 @@ class LibcxxListDataFormatterTestCase(TestBase):
target = self.dbg.CreateTarget(exe)
self.assertTrue(target and target.IsValid(), "Target is valid")
- file_spec = lldb.SBFileSpec ("main.cpp", False)
- breakpoint1 = target.BreakpointCreateBySourceRegex('// Set break point at this line.', file_spec)
+ file_spec = lldb.SBFileSpec("main.cpp", False)
+ breakpoint1 = target.BreakpointCreateBySourceRegex(
+ '// Set break point at this line.', file_spec)
self.assertTrue(breakpoint1 and breakpoint1.IsValid())
- breakpoint2 = target.BreakpointCreateBySourceRegex('// Set second break point at this line.', file_spec)
+ breakpoint2 = target.BreakpointCreateBySourceRegex(
+ '// Set second break point at this line.', file_spec)
self.assertTrue(breakpoint2 and breakpoint2.IsValid())
# Run the program, it should stop at breakpoint 1.
- process = target.LaunchSimple(None, None, self.get_process_working_directory())
- lldbutil.skip_if_library_missing(self, target, lldbutil.PrintableRegex("libc\+\+"))
+ process = target.LaunchSimple(
+ None, None, self.get_process_working_directory())
+ lldbutil.skip_if_library_missing(
+ self, target, lldbutil.PrintableRegex("libc\+\+"))
self.assertTrue(process and process.IsValid(), PROCESS_IS_VALID)
- self.assertEqual(len(lldbutil.get_threads_stopped_at_breakpoint(process, breakpoint1)), 1)
+ self.assertEqual(
+ len(lldbutil.get_threads_stopped_at_breakpoint(process, breakpoint1)), 1)
# verify our list is displayed correctly
- self.expect("frame variable *numbers_list", substrs=['[0] = 1', '[1] = 2', '[2] = 3', '[3] = 4', '[5] = 6'])
+ self.expect(
+ "frame variable *numbers_list",
+ substrs=[
+ '[0] = 1',
+ '[1] = 2',
+ '[2] = 3',
+ '[3] = 4',
+ '[5] = 6'])
# Continue to breakpoint 2.
process.Continue()
self.assertTrue(process and process.IsValid(), PROCESS_IS_VALID)
- self.assertEqual(len(lldbutil.get_threads_stopped_at_breakpoint(process, breakpoint2)), 1)
+ self.assertEqual(
+ len(lldbutil.get_threads_stopped_at_breakpoint(process, breakpoint2)), 1)
# The list is now inconsistent. However, we should be able to get the first three
# elements at least (and most importantly, not crash).
- self.expect("frame variable *numbers_list", substrs=['[0] = 1', '[1] = 2', '[2] = 3'])
+ self.expect(
+ "frame variable *numbers_list",
+ substrs=[
+ '[0] = 1',
+ '[1] = 2',
+ '[2] = 3'])
# Run to completion.
process.Continue()
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py
index cecc3178b318..7433a0b0da2c 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py
@@ -5,34 +5,38 @@ Test lldb data formatter subsystem.
from __future__ import print_function
-
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+
class LibcxxMapDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@skipIf(compiler="gcc")
- @skipIfWindows # libc++ not ported to Windows yet
+ @skipIfWindows # libc++ not ported to Windows yet
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- bkpt = self.target().FindBreakpointByID(lldbutil.run_break_set_by_source_regexp (self, "Set break point at this line."))
+ bkpt = self.target().FindBreakpointByID(
+ lldbutil.run_break_set_by_source_regexp(
+ self, "Set break point at this line."))
self.runCmd("run", RUN_SUCCEEDED)
- lldbutil.skip_if_library_missing(self, self.target(), lldbutil.PrintableRegex("libc\+\+"))
+ lldbutil.skip_if_library_missing(
+ self, self.target(), lldbutil.PrintableRegex("libc\+\+"))
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
@@ -41,259 +45,269 @@ class LibcxxMapDataFormatterTestCase(TestBase):
self.runCmd('type summary clear', check=False)
self.runCmd('type filter clear', check=False)
self.runCmd('type synth clear', check=False)
- self.runCmd("settings set target.max-children-count 256", check=False)
+ self.runCmd(
+ "settings set target.max-children-count 256",
+ check=False)
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
- self.expect('image list', substrs = self.getLibcPlusPlusLibs())
-
+ self.expect('image list', substrs=self.getLibcPlusPlusLibs())
+
self.expect('frame variable ii',
- substrs = ['size=0',
- '{}'])
+ substrs=['size=0',
+ '{}'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect('frame variable ii',
- substrs = ['size=2',
- '[0] = ',
- 'first = 0',
- 'second = 0',
- '[1] = ',
- 'first = 1',
- 'second = 1'])
+ substrs=['size=2',
+ '[0] = ',
+ 'first = 0',
+ 'second = 0',
+ '[1] = ',
+ 'first = 1',
+ 'second = 1'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect('frame variable ii',
- substrs = ['size=4',
- '[2] = ',
- 'first = 2',
- 'second = 0',
- '[3] = ',
- 'first = 3',
- 'second = 1'])
+ substrs=['size=4',
+ '[2] = ',
+ 'first = 2',
+ 'second = 0',
+ '[3] = ',
+ 'first = 3',
+ 'second = 1'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect("frame variable ii",
- substrs = ['size=8',
- '[5] = ',
- 'first = 5',
- 'second = 0',
- '[7] = ',
- 'first = 7',
- 'second = 1'])
+ substrs=['size=8',
+ '[5] = ',
+ 'first = 5',
+ 'second = 0',
+ '[7] = ',
+ 'first = 7',
+ 'second = 1'])
self.expect("p ii",
- substrs = ['size=8',
- '[5] = ',
- 'first = 5',
- 'second = 0',
- '[7] = ',
- 'first = 7',
- 'second = 1'])
+ substrs=['size=8',
+ '[5] = ',
+ 'first = 5',
+ 'second = 0',
+ '[7] = ',
+ 'first = 7',
+ 'second = 1'])
# check access-by-index
self.expect("frame variable ii[0]",
- substrs = ['first = 0',
- 'second = 0']);
+ substrs=['first = 0',
+ 'second = 0'])
self.expect("frame variable ii[3]",
- substrs = ['first =',
- 'second =']);
+ substrs=['first =',
+ 'second ='])
# check that MightHaveChildren() gets it right
- self.assertTrue(self.frame().FindVariable("ii").MightHaveChildren(), "ii.MightHaveChildren() says False for non empty!")
+ self.assertTrue(
+ self.frame().FindVariable("ii").MightHaveChildren(),
+ "ii.MightHaveChildren() says False for non empty!")
# check that the expression parser does not make use of
# synthetic children instead of running code
# TOT clang has a fix for this, which makes the expression command here succeed
# since this would make the test fail or succeed depending on clang version in use
# this is safer commented for the time being
- #self.expect("expression ii[8]", matching=False, error=True,
+ # self.expect("expression ii[8]", matching=False, error=True,
# substrs = ['1234567'])
- self.runCmd("continue");
-
+ self.runCmd("continue")
+
self.expect('frame variable ii',
- substrs = ['size=0',
- '{}'])
+ substrs=['size=0',
+ '{}'])
self.expect('frame variable si',
- substrs = ['size=0',
- '{}'])
+ substrs=['size=0',
+ '{}'])
- self.runCmd("continue");
+ self.runCmd("continue")
self.expect('frame variable si',
- substrs = ['size=1',
- '[0] = ',
- 'first = \"zero\"',
- 'second = 0'])
+ substrs=['size=1',
+ '[0] = ',
+ 'first = \"zero\"',
+ 'second = 0'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect("frame variable si",
- substrs = ['size=4',
- '[0] = ',
- 'first = \"zero\"',
- 'second = 0',
- '[1] = ',
- 'first = \"one\"',
- 'second = 1',
- '[2] = ',
- 'first = \"two\"',
- 'second = 2',
- '[3] = ',
- 'first = \"three\"',
- 'second = 3'])
+ substrs=['size=4',
+ '[0] = ',
+ 'first = \"zero\"',
+ 'second = 0',
+ '[1] = ',
+ 'first = \"one\"',
+ 'second = 1',
+ '[2] = ',
+ 'first = \"two\"',
+ 'second = 2',
+ '[3] = ',
+ 'first = \"three\"',
+ 'second = 3'])
self.expect("p si",
- substrs = ['size=4',
- '[0] = ',
- 'first = \"zero\"',
- 'second = 0',
- '[1] = ',
- 'first = \"one\"',
- 'second = 1',
- '[2] = ',
- 'first = \"two\"',
- 'second = 2',
- '[3] = ',
- 'first = \"three\"',
- 'second = 3'])
+ substrs=['size=4',
+ '[0] = ',
+ 'first = \"zero\"',
+ 'second = 0',
+ '[1] = ',
+ 'first = \"one\"',
+ 'second = 1',
+ '[2] = ',
+ 'first = \"two\"',
+ 'second = 2',
+ '[3] = ',
+ 'first = \"three\"',
+ 'second = 3'])
# check that MightHaveChildren() gets it right
- self.assertTrue(self.frame().FindVariable("si").MightHaveChildren(), "si.MightHaveChildren() says False for non empty!")
+ self.assertTrue(
+ self.frame().FindVariable("si").MightHaveChildren(),
+ "si.MightHaveChildren() says False for non empty!")
# check access-by-index
self.expect("frame variable si[0]",
- substrs = ['first = ', 'one',
- 'second = 1']);
-
+ substrs=['first = ', 'one',
+ 'second = 1'])
+
# check that the expression parser does not make use of
# synthetic children instead of running code
# TOT clang has a fix for this, which makes the expression command here succeed
# since this would make the test fail or succeed depending on clang version in use
# this is safer commented for the time being
- #self.expect("expression si[0]", matching=False, error=True,
+ # self.expect("expression si[0]", matching=False, error=True,
# substrs = ['first = ', 'zero'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
-
+
self.expect('frame variable si',
- substrs = ['size=0',
- '{}'])
+ substrs=['size=0',
+ '{}'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
-
+
self.expect('frame variable is',
- substrs = ['size=0',
- '{}'])
+ substrs=['size=0',
+ '{}'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect("frame variable is",
- substrs = ['size=4',
- '[0] = ',
- 'second = \"goofy\"',
- 'first = 85',
- '[1] = ',
- 'second = \"is\"',
- 'first = 1',
- '[2] = ',
- 'second = \"smart\"',
- 'first = 2',
- '[3] = ',
- 'second = \"!!!\"',
- 'first = 3'])
-
+ substrs=['size=4',
+ '[0] = ',
+ 'second = \"goofy\"',
+ 'first = 85',
+ '[1] = ',
+ 'second = \"is\"',
+ 'first = 1',
+ '[2] = ',
+ 'second = \"smart\"',
+ 'first = 2',
+ '[3] = ',
+ 'second = \"!!!\"',
+ 'first = 3'])
+
self.expect("p is",
- substrs = ['size=4',
- '[0] = ',
- 'second = \"goofy\"',
- 'first = 85',
- '[1] = ',
- 'second = \"is\"',
- 'first = 1',
- '[2] = ',
- 'second = \"smart\"',
- 'first = 2',
- '[3] = ',
- 'second = \"!!!\"',
- 'first = 3'])
+ substrs=['size=4',
+ '[0] = ',
+ 'second = \"goofy\"',
+ 'first = 85',
+ '[1] = ',
+ 'second = \"is\"',
+ 'first = 1',
+ '[2] = ',
+ 'second = \"smart\"',
+ 'first = 2',
+ '[3] = ',
+ 'second = \"!!!\"',
+ 'first = 3'])
# check that MightHaveChildren() gets it right
- self.assertTrue(self.frame().FindVariable("is").MightHaveChildren(), "is.MightHaveChildren() says False for non empty!")
+ self.assertTrue(
+ self.frame().FindVariable("is").MightHaveChildren(),
+ "is.MightHaveChildren() says False for non empty!")
# check access-by-index
self.expect("frame variable is[0]",
- substrs = ['first = ',
- 'second =']);
-
+ substrs=['first = ',
+ 'second ='])
+
# check that the expression parser does not make use of
# synthetic children instead of running code
# TOT clang has a fix for this, which makes the expression command here succeed
# since this would make the test fail or succeed depending on clang version in use
# this is safer commented for the time being
- #self.expect("expression is[0]", matching=False, error=True,
+ # self.expect("expression is[0]", matching=False, error=True,
# substrs = ['first = ', 'goofy'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
-
+
self.expect('frame variable is',
- substrs = ['size=0',
- '{}'])
+ substrs=['size=0',
+ '{}'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
-
+
self.expect('frame variable ss',
- substrs = ['size=0',
- '{}'])
+ substrs=['size=0',
+ '{}'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect("frame variable ss",
- substrs = ['size=3',
- '[0] = ',
- 'second = \"hello\"',
- 'first = \"ciao\"',
- '[1] = ',
- 'second = \"house\"',
- 'first = \"casa\"',
- '[2] = ',
- 'second = \"cat\"',
- 'first = \"gatto\"'])
-
+ substrs=['size=3',
+ '[0] = ',
+ 'second = \"hello\"',
+ 'first = \"ciao\"',
+ '[1] = ',
+ 'second = \"house\"',
+ 'first = \"casa\"',
+ '[2] = ',
+ 'second = \"cat\"',
+ 'first = \"gatto\"'])
+
self.expect("p ss",
- substrs = ['size=3',
- '[0] = ',
- 'second = \"hello\"',
- 'first = \"ciao\"',
- '[1] = ',
- 'second = \"house\"',
- 'first = \"casa\"',
- '[2] = ',
- 'second = \"cat\"',
- 'first = \"gatto\"'])
+ substrs=['size=3',
+ '[0] = ',
+ 'second = \"hello\"',
+ 'first = \"ciao\"',
+ '[1] = ',
+ 'second = \"house\"',
+ 'first = \"casa\"',
+ '[2] = ',
+ 'second = \"cat\"',
+ 'first = \"gatto\"'])
# check that MightHaveChildren() gets it right
- self.assertTrue(self.frame().FindVariable("ss").MightHaveChildren(), "ss.MightHaveChildren() says False for non empty!")
+ self.assertTrue(
+ self.frame().FindVariable("ss").MightHaveChildren(),
+ "ss.MightHaveChildren() says False for non empty!")
# check access-by-index
self.expect("frame variable ss[2]",
- substrs = ['gatto', 'cat']);
-
+ substrs=['gatto', 'cat'])
+
# check that the expression parser does not make use of
# synthetic children instead of running code
# TOT clang has a fix for this, which makes the expression command here succeed
# since this would make the test fail or succeed depending on clang version in use
# this is safer commented for the time being
- #self.expect("expression ss[3]", matching=False, error=True,
+ # self.expect("expression ss[3]", matching=False, error=True,
# substrs = ['gatto'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
-
+
self.expect('frame variable ss',
- substrs = ['size=0',
- '{}'])
+ substrs=['size=0',
+ '{}'])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py
index eb74818c91f5..66091e6e113f 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py
@@ -5,35 +5,39 @@ Test lldb data formatter subsystem.
from __future__ import print_function
-
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.lldbtest import *
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+
class LibcxxMultiMapDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- @skipIfWindows # libc++ not ported to Windows yet
+ @skipIfWindows # libc++ not ported to Windows yet
@skipIf(compiler="gcc")
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
-
- bkpt = self.target().FindBreakpointByID(lldbutil.run_break_set_by_source_regexp (self, "Set break point at this line."))
+
+ bkpt = self.target().FindBreakpointByID(
+ lldbutil.run_break_set_by_source_regexp(
+ self, "Set break point at this line."))
self.runCmd("run", RUN_SUCCEEDED)
- lldbutil.skip_if_library_missing(self, self.target(), lldbutil.PrintableRegex("libc\+\+"))
+ lldbutil.skip_if_library_missing(
+ self, self.target(), lldbutil.PrintableRegex("libc\+\+"))
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
@@ -42,259 +46,269 @@ class LibcxxMultiMapDataFormatterTestCase(TestBase):
self.runCmd('type summary clear', check=False)
self.runCmd('type filter clear', check=False)
self.runCmd('type synth clear', check=False)
- self.runCmd("settings set target.max-children-count 256", check=False)
+ self.runCmd(
+ "settings set target.max-children-count 256",
+ check=False)
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
- self.expect('image list', substrs = self.getLibcPlusPlusLibs())
-
+ self.expect('image list', substrs=self.getLibcPlusPlusLibs())
+
self.expect('frame variable ii',
- substrs = ['size=0',
- '{}'])
+ substrs=['size=0',
+ '{}'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect('frame variable ii',
- substrs = ['size=2',
- '[0] = ',
- 'first = 0',
- 'second = 0',
- '[1] = ',
- 'first = 1',
- 'second = 1'])
+ substrs=['size=2',
+ '[0] = ',
+ 'first = 0',
+ 'second = 0',
+ '[1] = ',
+ 'first = 1',
+ 'second = 1'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect('frame variable ii',
- substrs = ['size=4',
- '[2] = ',
- 'first = 2',
- 'second = 0',
- '[3] = ',
- 'first = 3',
- 'second = 1'])
+ substrs=['size=4',
+ '[2] = ',
+ 'first = 2',
+ 'second = 0',
+ '[3] = ',
+ 'first = 3',
+ 'second = 1'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect("frame variable ii",
- substrs = ['size=8',
- '[5] = ',
- 'first = 5',
- 'second = 0',
- '[7] = ',
- 'first = 7',
- 'second = 1'])
+ substrs=['size=8',
+ '[5] = ',
+ 'first = 5',
+ 'second = 0',
+ '[7] = ',
+ 'first = 7',
+ 'second = 1'])
self.expect("p ii",
- substrs = ['size=8',
- '[5] = ',
- 'first = 5',
- 'second = 0',
- '[7] = ',
- 'first = 7',
- 'second = 1'])
+ substrs=['size=8',
+ '[5] = ',
+ 'first = 5',
+ 'second = 0',
+ '[7] = ',
+ 'first = 7',
+ 'second = 1'])
# check access-by-index
self.expect("frame variable ii[0]",
- substrs = ['first = 0',
- 'second = 0']);
+ substrs=['first = 0',
+ 'second = 0'])
self.expect("frame variable ii[3]",
- substrs = ['first =',
- 'second =']);
+ substrs=['first =',
+ 'second ='])
# check that MightHaveChildren() gets it right
- self.assertTrue(self.frame().FindVariable("ii").MightHaveChildren(), "ii.MightHaveChildren() says False for non empty!")
+ self.assertTrue(
+ self.frame().FindVariable("ii").MightHaveChildren(),
+ "ii.MightHaveChildren() says False for non empty!")
# check that the expression parser does not make use of
# synthetic children instead of running code
# TOT clang has a fix for this, which makes the expression command here succeed
# since this would make the test fail or succeed depending on clang version in use
# this is safer commented for the time being
- #self.expect("expression ii[8]", matching=False, error=True,
+ # self.expect("expression ii[8]", matching=False, error=True,
# substrs = ['1234567'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
-
+
self.expect('frame variable ii',
- substrs = ['size=0',
- '{}'])
+ substrs=['size=0',
+ '{}'])
self.expect('frame variable si',
- substrs = ['size=0',
- '{}'])
+ substrs=['size=0',
+ '{}'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect('frame variable si',
- substrs = ['size=1',
- '[0] = ',
- 'first = \"zero\"',
- 'second = 0'])
+ substrs=['size=1',
+ '[0] = ',
+ 'first = \"zero\"',
+ 'second = 0'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect("frame variable si",
- substrs = ['size=4',
- '[0] = ',
- 'first = \"zero\"',
- 'second = 0',
- '[1] = ',
- 'first = \"one\"',
- 'second = 1',
- '[2] = ',
- 'first = \"two\"',
- 'second = 2',
- '[3] = ',
- 'first = \"three\"',
- 'second = 3'])
+ substrs=['size=4',
+ '[0] = ',
+ 'first = \"zero\"',
+ 'second = 0',
+ '[1] = ',
+ 'first = \"one\"',
+ 'second = 1',
+ '[2] = ',
+ 'first = \"two\"',
+ 'second = 2',
+ '[3] = ',
+ 'first = \"three\"',
+ 'second = 3'])
self.expect("p si",
- substrs = ['size=4',
- '[0] = ',
- 'first = \"zero\"',
- 'second = 0',
- '[1] = ',
- 'first = \"one\"',
- 'second = 1',
- '[2] = ',
- 'first = \"two\"',
- 'second = 2',
- '[3] = ',
- 'first = \"three\"',
- 'second = 3'])
+ substrs=['size=4',
+ '[0] = ',
+ 'first = \"zero\"',
+ 'second = 0',
+ '[1] = ',
+ 'first = \"one\"',
+ 'second = 1',
+ '[2] = ',
+ 'first = \"two\"',
+ 'second = 2',
+ '[3] = ',
+ 'first = \"three\"',
+ 'second = 3'])
# check that MightHaveChildren() gets it right
- self.assertTrue(self.frame().FindVariable("si").MightHaveChildren(), "si.MightHaveChildren() says False for non empty!")
+ self.assertTrue(
+ self.frame().FindVariable("si").MightHaveChildren(),
+ "si.MightHaveChildren() says False for non empty!")
# check access-by-index
self.expect("frame variable si[0]",
- substrs = ['first = ', 'one',
- 'second = 1']);
-
+ substrs=['first = ', 'one',
+ 'second = 1'])
+
# check that the expression parser does not make use of
# synthetic children instead of running code
# TOT clang has a fix for this, which makes the expression command here succeed
# since this would make the test fail or succeed depending on clang version in use
# this is safer commented for the time being
- #self.expect("expression si[0]", matching=False, error=True,
+ # self.expect("expression si[0]", matching=False, error=True,
# substrs = ['first = ', 'zero'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
-
+
self.expect('frame variable si',
- substrs = ['size=0',
- '{}'])
+ substrs=['size=0',
+ '{}'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
-
+
self.expect('frame variable is',
- substrs = ['size=0',
- '{}'])
+ substrs=['size=0',
+ '{}'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect("frame variable is",
- substrs = ['size=4',
- '[0] = ',
- 'second = \"goofy\"',
- 'first = 85',
- '[1] = ',
- 'second = \"is\"',
- 'first = 1',
- '[2] = ',
- 'second = \"smart\"',
- 'first = 2',
- '[3] = ',
- 'second = \"!!!\"',
- 'first = 3'])
-
+ substrs=['size=4',
+ '[0] = ',
+ 'second = \"goofy\"',
+ 'first = 85',
+ '[1] = ',
+ 'second = \"is\"',
+ 'first = 1',
+ '[2] = ',
+ 'second = \"smart\"',
+ 'first = 2',
+ '[3] = ',
+ 'second = \"!!!\"',
+ 'first = 3'])
+
self.expect("p is",
- substrs = ['size=4',
- '[0] = ',
- 'second = \"goofy\"',
- 'first = 85',
- '[1] = ',
- 'second = \"is\"',
- 'first = 1',
- '[2] = ',
- 'second = \"smart\"',
- 'first = 2',
- '[3] = ',
- 'second = \"!!!\"',
- 'first = 3'])
+ substrs=['size=4',
+ '[0] = ',
+ 'second = \"goofy\"',
+ 'first = 85',
+ '[1] = ',
+ 'second = \"is\"',
+ 'first = 1',
+ '[2] = ',
+ 'second = \"smart\"',
+ 'first = 2',
+ '[3] = ',
+ 'second = \"!!!\"',
+ 'first = 3'])
# check that MightHaveChildren() gets it right
- self.assertTrue(self.frame().FindVariable("is").MightHaveChildren(), "is.MightHaveChildren() says False for non empty!")
+ self.assertTrue(
+ self.frame().FindVariable("is").MightHaveChildren(),
+ "is.MightHaveChildren() says False for non empty!")
# check access-by-index
self.expect("frame variable is[0]",
- substrs = ['first = ',
- 'second =']);
-
+ substrs=['first = ',
+ 'second ='])
+
# check that the expression parser does not make use of
# synthetic children instead of running code
# TOT clang has a fix for this, which makes the expression command here succeed
# since this would make the test fail or succeed depending on clang version in use
# this is safer commented for the time being
- #self.expect("expression is[0]", matching=False, error=True,
+ # self.expect("expression is[0]", matching=False, error=True,
# substrs = ['first = ', 'goofy'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
-
+
self.expect('frame variable is',
- substrs = ['size=0',
- '{}'])
+ substrs=['size=0',
+ '{}'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
-
+
self.expect('frame variable ss',
- substrs = ['size=0',
- '{}'])
+ substrs=['size=0',
+ '{}'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect("frame variable ss",
- substrs = ['size=3',
- '[0] = ',
- 'second = \"hello\"',
- 'first = \"ciao\"',
- '[1] = ',
- 'second = \"house\"',
- 'first = \"casa\"',
- '[2] = ',
- 'second = \"cat\"',
- 'first = \"gatto\"'])
-
+ substrs=['size=3',
+ '[0] = ',
+ 'second = \"hello\"',
+ 'first = \"ciao\"',
+ '[1] = ',
+ 'second = \"house\"',
+ 'first = \"casa\"',
+ '[2] = ',
+ 'second = \"cat\"',
+ 'first = \"gatto\"'])
+
self.expect("p ss",
- substrs = ['size=3',
- '[0] = ',
- 'second = \"hello\"',
- 'first = \"ciao\"',
- '[1] = ',
- 'second = \"house\"',
- 'first = \"casa\"',
- '[2] = ',
- 'second = \"cat\"',
- 'first = \"gatto\"'])
+ substrs=['size=3',
+ '[0] = ',
+ 'second = \"hello\"',
+ 'first = \"ciao\"',
+ '[1] = ',
+ 'second = \"house\"',
+ 'first = \"casa\"',
+ '[2] = ',
+ 'second = \"cat\"',
+ 'first = \"gatto\"'])
# check that MightHaveChildren() gets it right
- self.assertTrue(self.frame().FindVariable("ss").MightHaveChildren(), "ss.MightHaveChildren() says False for non empty!")
+ self.assertTrue(
+ self.frame().FindVariable("ss").MightHaveChildren(),
+ "ss.MightHaveChildren() says False for non empty!")
# check access-by-index
self.expect("frame variable ss[2]",
- substrs = ['gatto', 'cat']);
-
+ substrs=['gatto', 'cat'])
+
# check that the expression parser does not make use of
# synthetic children instead of running code
# TOT clang has a fix for this, which makes the expression command here succeed
# since this would make the test fail or succeed depending on clang version in use
# this is safer commented for the time being
- #self.expect("expression ss[3]", matching=False, error=True,
+ # self.expect("expression ss[3]", matching=False, error=True,
# substrs = ['gatto'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
-
+
self.expect('frame variable ss',
- substrs = ['size=0',
- '{}'])
+ substrs=['size=0',
+ '{}'])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py
index cfdfd07ddec1..d40bce83e0af 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py
@@ -5,34 +5,38 @@ Test lldb data formatter subsystem.
from __future__ import print_function
-
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+
class LibcxxMultiSetDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@skipIf(compiler="gcc")
- @skipIfWindows # libc++ not ported to Windows yet
+ @skipIfWindows # libc++ not ported to Windows yet
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
-
- bkpt = self.target().FindBreakpointByID(lldbutil.run_break_set_by_source_regexp (self, "Set break point at this line."))
+
+ bkpt = self.target().FindBreakpointByID(
+ lldbutil.run_break_set_by_source_regexp(
+ self, "Set break point at this line."))
self.runCmd("run", RUN_SUCCEEDED)
- lldbutil.skip_if_library_missing(self, self.target(), lldbutil.PrintableRegex("libc\+\+"))
+ lldbutil.skip_if_library_missing(
+ self, self.target(), lldbutil.PrintableRegex("libc\+\+"))
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
@@ -41,30 +45,78 @@ class LibcxxMultiSetDataFormatterTestCase(TestBase):
self.runCmd('type summary clear', check=False)
self.runCmd('type filter clear', check=False)
self.runCmd('type synth clear', check=False)
- self.runCmd("settings set target.max-children-count 256", check=False)
+ self.runCmd(
+ "settings set target.max-children-count 256",
+ check=False)
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
- self.expect('image list', substrs = self.getLibcPlusPlusLibs())
+ self.expect('image list', substrs=self.getLibcPlusPlusLibs())
- self.expect("frame variable ii",substrs = ["size=0","{}"])
+ self.expect("frame variable ii", substrs=["size=0", "{}"])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
- self.expect("frame variable ii",substrs = ["size=6","[0] = 0","[1] = 1", "[2] = 2", "[3] = 3", "[4] = 4", "[5] = 5"])
+ self.expect(
+ "frame variable ii",
+ substrs=[
+ "size=6",
+ "[0] = 0",
+ "[1] = 1",
+ "[2] = 2",
+ "[3] = 3",
+ "[4] = 4",
+ "[5] = 5"])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
- self.expect("frame variable ii",substrs = ["size=7","[2] = 2", "[3] = 3", "[6] = 6"])
- self.expect("p ii",substrs = ["size=7","[2] = 2", "[3] = 3", "[6] = 6"])
- self.expect("frame variable ii[2]",substrs = [" = 2"])
+ self.expect(
+ "frame variable ii",
+ substrs=[
+ "size=7",
+ "[2] = 2",
+ "[3] = 3",
+ "[6] = 6"])
+ self.expect(
+ "p ii",
+ substrs=[
+ "size=7",
+ "[2] = 2",
+ "[3] = 3",
+ "[6] = 6"])
+ self.expect("frame variable ii[2]", substrs=[" = 2"])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
- self.expect("frame variable ii",substrs = ["size=0","{}"])
+ self.expect("frame variable ii", substrs=["size=0", "{}"])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
- self.expect("frame variable ii",substrs = ["size=0","{}"])
- self.expect("frame variable ss",substrs = ["size=0","{}"])
+ self.expect("frame variable ii", substrs=["size=0", "{}"])
+ self.expect("frame variable ss", substrs=["size=0", "{}"])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
- self.expect("frame variable ss",substrs = ["size=2",'[0] = "a"','[1] = "a very long string is right here"'])
+ self.expect(
+ "frame variable ss",
+ substrs=[
+ "size=2",
+ '[0] = "a"',
+ '[1] = "a very long string is right here"'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
- self.expect("frame variable ss",substrs = ["size=4",'[2] = "b"','[3] = "c"','[0] = "a"','[1] = "a very long string is right here"'])
- self.expect("p ss",substrs = ["size=4",'[2] = "b"','[3] = "c"','[0] = "a"','[1] = "a very long string is right here"'])
- self.expect("frame variable ss[2]",substrs = [' = "b"'])
+ self.expect(
+ "frame variable ss",
+ substrs=[
+ "size=4",
+ '[2] = "b"',
+ '[3] = "c"',
+ '[0] = "a"',
+ '[1] = "a very long string is right here"'])
+ self.expect(
+ "p ss",
+ substrs=[
+ "size=4",
+ '[2] = "b"',
+ '[3] = "c"',
+ '[0] = "a"',
+ '[1] = "a very long string is right here"'])
+ self.expect("frame variable ss[2]", substrs=[' = "b"'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
- self.expect("frame variable ss",substrs = ["size=3",'[0] = "a"','[1] = "a very long string is right here"','[2] = "c"'])
+ self.expect(
+ "frame variable ss",
+ substrs=[
+ "size=3",
+ '[0] = "a"',
+ '[1] = "a very long string is right here"',
+ '[2] = "c"'])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py
index 00c1e548cf6b..be1547ea5d8f 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py
@@ -5,24 +5,25 @@ Test lldb data formatter subsystem.
from __future__ import print_function
-
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+
class LibcxxSetDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@skipIf(compiler="gcc")
- @skipIfWindows # libc++ not ported to Windows yet
+ @skipIfWindows # libc++ not ported to Windows yet
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
-
+
# bkpt = self.target().FindBreakpointByID(lldbutil.run_break_set_by_source_regexp (self, "Set break point at this line."))
self.runCmd("run", RUN_SUCCEEDED)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py
index 76eedb8c8919..b0e84121dded 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py
@@ -1,4 +1,4 @@
-#coding=utf8
+# coding=utf8
"""
Test lldb data formatter subsystem.
"""
@@ -6,13 +6,14 @@ Test lldb data formatter subsystem.
from __future__ import print_function
-
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+
class LibcxxStringDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@@ -24,22 +25,24 @@ class LibcxxStringDataFormatterTestCase(TestBase):
self.line = line_number('main.cpp', '// Set break point at this line.')
@skipIf(compiler="gcc")
- @skipIfWindows # libc++ not ported to Windows yet
+ @skipIfWindows # libc++ not ported to Windows yet
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=-1)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.cpp", self.line, num_expected_locations=-1)
self.runCmd("run", RUN_SUCCEEDED)
- lldbutil.skip_if_library_missing(self, self.target(), lldbutil.PrintableRegex("libc\+\+"))
+ lldbutil.skip_if_library_missing(
+ self, self.target(), lldbutil.PrintableRegex("libc\+\+"))
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
@@ -48,40 +51,51 @@ class LibcxxStringDataFormatterTestCase(TestBase):
self.runCmd('type summary clear', check=False)
self.runCmd('type filter clear', check=False)
self.runCmd('type synth clear', check=False)
- self.runCmd("settings set target.max-children-count 256", check=False)
+ self.runCmd(
+ "settings set target.max-children-count 256",
+ check=False)
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
- self.expect("frame variable",
- substrs = ['(std::__1::wstring) s = L"hello world! מזל טוב!"',
- '(std::__1::wstring) S = L"!!!!"',
- '(const wchar_t *) mazeltov = 0x','L"מזל טוב"',
- '(std::__1::string) q = "hello world"',
- '(std::__1::string) Q = "quite a long std::strin with lots of info inside it"',
- '(std::__1::string) IHaveEmbeddedZeros = "a\\0b\\0c\\0d"',
- '(std::__1::wstring) IHaveEmbeddedZerosToo = L"hello world!\\0てざ ル゜䋨ミ㠧槊 きゅへ狦穤襩 じゃ馩リョ 䤦監"'])
+ self.expect(
+ "frame variable",
+ substrs=[
+ '(std::__1::wstring) s = L"hello world! מזל טוב!"',
+ '(std::__1::wstring) S = L"!!!!"',
+ '(const wchar_t *) mazeltov = 0x',
+ 'L"מזל טוב"',
+ '(std::__1::string) q = "hello world"',
+ '(std::__1::string) Q = "quite a long std::strin with lots of info inside it"',
+ '(std::__1::string) IHaveEmbeddedZeros = "a\\0b\\0c\\0d"',
+ '(std::__1::wstring) IHaveEmbeddedZerosToo = L"hello world!\\0てざ ル゜䋨ミ㠧槊 きゅへ狦穤襩 じゃ馩リョ 䤦監"'])
self.runCmd("n")
- TheVeryLongOne = self.frame().FindVariable("TheVeryLongOne");
+ TheVeryLongOne = self.frame().FindVariable("TheVeryLongOne")
summaryOptions = lldb.SBTypeSummaryOptions()
summaryOptions.SetCapping(lldb.eTypeSummaryUncapped)
uncappedSummaryStream = lldb.SBStream()
- TheVeryLongOne.GetSummary(uncappedSummaryStream,summaryOptions)
+ TheVeryLongOne.GetSummary(uncappedSummaryStream, summaryOptions)
uncappedSummary = uncappedSummaryStream.GetData()
- self.assertTrue(uncappedSummary.find("someText") > 0, "uncappedSummary does not include the full string")
+ self.assertTrue(uncappedSummary.find("someText") > 0,
+ "uncappedSummary does not include the full string")
summaryOptions.SetCapping(lldb.eTypeSummaryCapped)
cappedSummaryStream = lldb.SBStream()
- TheVeryLongOne.GetSummary(cappedSummaryStream,summaryOptions)
+ TheVeryLongOne.GetSummary(cappedSummaryStream, summaryOptions)
cappedSummary = cappedSummaryStream.GetData()
- self.assertTrue(cappedSummary.find("someText") <= 0, "cappedSummary includes the full string")
-
- self.expect("frame variable",
- substrs = ['(std::__1::wstring) s = L"hello world! מזל טוב!"',
- '(std::__1::wstring) S = L"!!!!!"',
- '(const wchar_t *) mazeltov = 0x','L"מזל טוב"',
- '(std::__1::string) q = "hello world"',
- '(std::__1::string) Q = "quite a long std::strin with lots of info inside it"',
- '(std::__1::string) IHaveEmbeddedZeros = "a\\0b\\0c\\0d"',
- '(std::__1::wstring) IHaveEmbeddedZerosToo = L"hello world!\\0てざ ル゜䋨ミ㠧槊 きゅへ狦穤襩 じゃ馩リョ 䤦監"'])
+ self.assertTrue(
+ cappedSummary.find("someText") <= 0,
+ "cappedSummary includes the full string")
+
+ self.expect(
+ "frame variable",
+ substrs=[
+ '(std::__1::wstring) s = L"hello world! מזל טוב!"',
+ '(std::__1::wstring) S = L"!!!!!"',
+ '(const wchar_t *) mazeltov = 0x',
+ 'L"מזל טוב"',
+ '(std::__1::string) q = "hello world"',
+ '(std::__1::string) Q = "quite a long std::strin with lots of info inside it"',
+ '(std::__1::string) IHaveEmbeddedZeros = "a\\0b\\0c\\0d"',
+ '(std::__1::wstring) IHaveEmbeddedZerosToo = L"hello world!\\0てざ ル゜䋨ミ㠧槊 きゅへ狦穤襩 じゃ馩リョ 䤦監"'])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py
index 4765cd70f67c..8a08d38975cf 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py
@@ -5,34 +5,37 @@ Test lldb data formatter subsystem.
from __future__ import print_function
-
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+
class LibcxxUnorderedDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- @skipIfWindows # libc++ not ported to Windows yet
+ @skipIfWindows # libc++ not ported to Windows yet
@skipIf(compiler="gcc")
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_source_regexp (self, "Set break point at this line.")
+ lldbutil.run_break_set_by_source_regexp(
+ self, "Set break point at this line.")
self.runCmd("run", RUN_SUCCEEDED)
- lldbutil.skip_if_library_missing(self, self.target(), lldbutil.PrintableRegex("libc\+\+"))
+ lldbutil.skip_if_library_missing(
+ self, self.target(), lldbutil.PrintableRegex("libc\+\+"))
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
@@ -41,12 +44,14 @@ class LibcxxUnorderedDataFormatterTestCase(TestBase):
self.runCmd('type summary clear', check=False)
self.runCmd('type filter clear', check=False)
self.runCmd('type synth clear', check=False)
- self.runCmd("settings set target.max-children-count 256", check=False)
+ self.runCmd(
+ "settings set target.max-children-count 256",
+ check=False)
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
- self.expect('image list', substrs = self.getLibcPlusPlusLibs())
+ self.expect('image list', substrs=self.getLibcPlusPlusLibs())
self.look_for_content_and_continue(
"map", ['size=5 {', 'hello', 'world', 'this', 'is', 'me'])
@@ -72,6 +77,6 @@ class LibcxxUnorderedDataFormatterTestCase(TestBase):
'(\[\d\] = "world"(\\n|.)+){2}'])
def look_for_content_and_continue(self, var_name, patterns):
- self.expect( ("frame variable %s" % var_name), patterns=patterns)
- self.expect( ("frame variable %s" % var_name), patterns=patterns)
+ self.expect(("frame variable %s" % var_name), patterns=patterns)
+ self.expect(("frame variable %s" % var_name), patterns=patterns)
self.runCmd("continue")
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py
index fe3b6c115e31..43d5ad4f1033 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py
@@ -5,13 +5,14 @@ Test lldb data formatter subsystem.
from __future__ import print_function
-
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+
class LibcxxVBoolDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@@ -23,22 +24,24 @@ class LibcxxVBoolDataFormatterTestCase(TestBase):
self.line = line_number('main.cpp', '// Set break point at this line.')
@skipIf(compiler="gcc")
- @skipIfWindows # libc++ not ported to Windows.
+ @skipIfWindows # libc++ not ported to Windows.
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.skip_if_library_missing(self, self.target(), lldbutil.PrintableRegex("libc\+\+"))
+ lldbutil.skip_if_library_missing(
+ self, self.target(), lldbutil.PrintableRegex("libc\+\+"))
- lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=-1)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.cpp", self.line, num_expected_locations=-1)
self.runCmd("run", RUN_SUCCEEDED)
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
@@ -47,13 +50,33 @@ class LibcxxVBoolDataFormatterTestCase(TestBase):
self.runCmd('type summary clear', check=False)
self.runCmd('type filter clear', check=False)
self.runCmd('type synth clear', check=False)
- self.runCmd("settings set target.max-children-count 256", check=False)
+ self.runCmd(
+ "settings set target.max-children-count 256",
+ check=False)
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
- self.expect("frame variable vBool",
- substrs = ['size=49','[0] = false','[1] = true','[18] = false','[27] = true','[36] = false','[47] = true','[48] = true'])
-
- self.expect("expr vBool",
- substrs = ['size=49','[0] = false','[1] = true','[18] = false','[27] = true','[36] = false','[47] = true','[48] = true'])
+ self.expect(
+ "frame variable vBool",
+ substrs=[
+ 'size=49',
+ '[0] = false',
+ '[1] = true',
+ '[18] = false',
+ '[27] = true',
+ '[36] = false',
+ '[47] = true',
+ '[48] = true'])
+
+ self.expect(
+ "expr vBool",
+ substrs=[
+ 'size=49',
+ '[0] = false',
+ '[1] = true',
+ '[18] = false',
+ '[27] = true',
+ '[36] = false',
+ '[47] = true',
+ '[48] = true'])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py
index 9a145fba73e8..719ed7300505 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py
@@ -5,34 +5,38 @@ Test lldb data formatter subsystem.
from __future__ import print_function
-
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+
class LibcxxVectorDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@skipIf(compiler="gcc")
- @skipIfWindows # libc++ not ported to Windows yet
+ @skipIfWindows # libc++ not ported to Windows yet
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
-
- lldbutil.skip_if_library_missing(self, self.target(), lldbutil.PrintableRegex("libc\+\+"))
- bkpt = self.target().FindBreakpointByID(lldbutil.run_break_set_by_source_regexp (self, "break here"))
+ lldbutil.skip_if_library_missing(
+ self, self.target(), lldbutil.PrintableRegex("libc\+\+"))
+
+ bkpt = self.target().FindBreakpointByID(
+ lldbutil.run_break_set_by_source_regexp(
+ self, "break here"))
self.runCmd("run", RUN_SUCCEEDED)
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
@@ -41,51 +45,54 @@ class LibcxxVectorDataFormatterTestCase(TestBase):
self.runCmd('type summary clear', check=False)
self.runCmd('type filter clear', check=False)
self.runCmd('type synth clear', check=False)
- self.runCmd("settings set target.max-children-count 256", check=False)
+ self.runCmd(
+ "settings set target.max-children-count 256",
+ check=False)
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
# empty vectors (and storage pointers SHOULD BOTH BE NULL..)
self.expect("frame variable numbers",
- substrs = ['numbers = size=0'])
+ substrs=['numbers = size=0'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
-
+
# first value added
self.expect("frame variable numbers",
- substrs = ['numbers = size=1',
- '[0] = 1',
- '}'])
+ substrs=['numbers = size=1',
+ '[0] = 1',
+ '}'])
# add some more data
lldbutil.continue_to_breakpoint(self.process(), bkpt)
-
+
self.expect("frame variable numbers",
- substrs = ['numbers = size=4',
- '[0] = 1',
- '[1] = 12',
- '[2] = 123',
- '[3] = 1234',
- '}'])
+ substrs=['numbers = size=4',
+ '[0] = 1',
+ '[1] = 12',
+ '[2] = 123',
+ '[3] = 1234',
+ '}'])
self.expect("p numbers",
- substrs = ['$', 'size=4',
- '[0] = 1',
- '[1] = 12',
- '[2] = 123',
- '[3] = 1234',
- '}'])
-
-
+ substrs=['$', 'size=4',
+ '[0] = 1',
+ '[1] = 12',
+ '[2] = 123',
+ '[3] = 1234',
+ '}'])
+
# check access to synthetic children
- self.runCmd("type summary add --summary-string \"item 0 is ${var[0]}\" std::int_vect int_vect")
+ self.runCmd(
+ "type summary add --summary-string \"item 0 is ${var[0]}\" std::int_vect int_vect")
self.expect('frame variable numbers',
- substrs = ['item 0 is 1']);
-
- self.runCmd("type summary add --summary-string \"item 0 is ${svar[0]}\" std::int_vect int_vect")
+ substrs=['item 0 is 1'])
+
+ self.runCmd(
+ "type summary add --summary-string \"item 0 is ${svar[0]}\" std::int_vect int_vect")
self.expect('frame variable numbers',
- substrs = ['item 0 is 1']);
+ substrs=['item 0 is 1'])
# move on with synths
self.runCmd("type summary delete std::int_vect")
self.runCmd("type summary delete int_vect")
@@ -94,88 +101,89 @@ class LibcxxVectorDataFormatterTestCase(TestBase):
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect("frame variable numbers",
- substrs = ['numbers = size=7',
- '[0] = 1',
- '[1] = 12',
- '[2] = 123',
- '[3] = 1234',
- '[4] = 12345',
- '[5] = 123456',
- '[6] = 1234567',
- '}'])
-
+ substrs=['numbers = size=7',
+ '[0] = 1',
+ '[1] = 12',
+ '[2] = 123',
+ '[3] = 1234',
+ '[4] = 12345',
+ '[5] = 123456',
+ '[6] = 1234567',
+ '}'])
+
self.expect("p numbers",
- substrs = ['$', 'size=7',
- '[0] = 1',
- '[1] = 12',
- '[2] = 123',
- '[3] = 1234',
- '[4] = 12345',
- '[5] = 123456',
- '[6] = 1234567',
- '}'])
+ substrs=['$', 'size=7',
+ '[0] = 1',
+ '[1] = 12',
+ '[2] = 123',
+ '[3] = 1234',
+ '[4] = 12345',
+ '[5] = 123456',
+ '[6] = 1234567',
+ '}'])
# check access-by-index
self.expect("frame variable numbers[0]",
- substrs = ['1']);
+ substrs=['1'])
self.expect("frame variable numbers[1]",
- substrs = ['12']);
+ substrs=['12'])
self.expect("frame variable numbers[2]",
- substrs = ['123']);
+ substrs=['123'])
self.expect("frame variable numbers[3]",
- substrs = ['1234']);
+ substrs=['1234'])
# clear out the vector and see that we do the right thing once again
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect("frame variable numbers",
- substrs = ['numbers = size=0'])
+ substrs=['numbers = size=0'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
# first value added
self.expect("frame variable numbers",
- substrs = ['numbers = size=1',
- '[0] = 7',
- '}'])
+ substrs=['numbers = size=1',
+ '[0] = 7',
+ '}'])
# check if we can display strings
self.expect("frame variable strings",
- substrs = ['goofy',
- 'is',
- 'smart'])
+ substrs=['goofy',
+ 'is',
+ 'smart'])
self.expect("p strings",
- substrs = ['goofy',
- 'is',
- 'smart'])
+ substrs=['goofy',
+ 'is',
+ 'smart'])
# test summaries based on synthetic children
- self.runCmd("type summary add std::string_vect string_vect --summary-string \"vector has ${svar%#} items\" -e")
+ self.runCmd(
+ "type summary add std::string_vect string_vect --summary-string \"vector has ${svar%#} items\" -e")
self.expect("frame variable strings",
- substrs = ['vector has 3 items',
- 'goofy',
- 'is',
- 'smart'])
+ substrs=['vector has 3 items',
+ 'goofy',
+ 'is',
+ 'smart'])
self.expect("p strings",
- substrs = ['vector has 3 items',
- 'goofy',
- 'is',
- 'smart'])
+ substrs=['vector has 3 items',
+ 'goofy',
+ 'is',
+ 'smart'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect("frame variable strings",
- substrs = ['vector has 4 items'])
-
+ substrs=['vector has 4 items'])
+
# check access-by-index
self.expect("frame variable strings[0]",
- substrs = ['goofy']);
+ substrs=['goofy'])
self.expect("frame variable strings[1]",
- substrs = ['is']);
+ substrs=['is'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect("frame variable strings",
- substrs = ['vector has 0 items'])
+ substrs=['vector has 0 items'])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py
index dbaa37daa2d1..ce5087dbc288 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py
@@ -5,13 +5,14 @@ Test lldb data formatter subsystem.
from __future__ import print_function
-
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+
class StdIteratorDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@@ -22,21 +23,21 @@ class StdIteratorDataFormatterTestCase(TestBase):
# Find the line number to break at.
self.line = line_number('main.cpp', '// Set break point at this line.')
- @skipIfWindows # libstdcpp not ported to Windows
- @expectedFailureAll(compiler="icc", bugnumber="llvm.org/pr15301 LLDB prints incorrect sizes of STL containers")
+ @skipIfWindows # libstdcpp not ported to Windows
def test_with_run_command(self):
"""Test that libstdcpp iterators format properly."""
self.build()
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=-1)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.cpp", self.line, num_expected_locations=-1)
self.runCmd("run", RUN_SUCCEEDED)
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
@@ -45,19 +46,29 @@ class StdIteratorDataFormatterTestCase(TestBase):
self.runCmd('type summary clear', check=False)
self.runCmd('type filter clear', check=False)
self.runCmd('type synth clear', check=False)
- self.runCmd("settings set target.max-children-count 256", check=False)
+ self.runCmd(
+ "settings set target.max-children-count 256",
+ check=False)
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
- self.expect('frame variable ivI', substrs = ['item = 3'])
- self.expect('expr ivI', substrs = ['item = 3'])
-
- self.expect('frame variable iimI', substrs = ['first = 0','second = 12'])
- self.expect('expr iimI', substrs = ['first = 0','second = 12'])
-
- self.expect('frame variable simI', substrs = ['first = "world"','second = 42'])
- self.expect('expr simI', substrs = ['first = "world"','second = 42'])
-
- self.expect('frame variable svI', substrs = ['item = "hello"'])
- self.expect('expr svI', substrs = ['item = "hello"'])
+ self.expect('frame variable ivI', substrs=['item = 3'])
+ self.expect('expr ivI', substrs=['item = 3'])
+
+ self.expect(
+ 'frame variable iimI',
+ substrs=[
+ 'first = 0',
+ 'second = 12'])
+ self.expect('expr iimI', substrs=['first = 0', 'second = 12'])
+
+ self.expect(
+ 'frame variable simI',
+ substrs=[
+ 'first = "world"',
+ 'second = 42'])
+ self.expect('expr simI', substrs=['first = "world"', 'second = 42'])
+
+ self.expect('frame variable svI', substrs=['item = "hello"'])
+ self.expect('expr svI', substrs=['item = "hello"'])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py
index 55658af1f2a3..a7f8c4b1e174 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py
@@ -5,13 +5,14 @@ Test lldb data formatter subsystem.
from __future__ import print_function
-
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+
class StdListDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@@ -21,23 +22,26 @@ class StdListDataFormatterTestCase(TestBase):
TestBase.setUp(self)
# Find the line numbers to break at for the different tests.
self.line = line_number('main.cpp', '// Set break point at this line.')
- self.optional_line = line_number('main.cpp', '// Optional break point at this line.')
- self.final_line = line_number('main.cpp', '// Set final break point at this line.')
+ self.optional_line = line_number(
+ 'main.cpp', '// Optional break point at this line.')
+ self.final_line = line_number(
+ 'main.cpp', '// Set final break point at this line.')
- @skipIfWindows # libstdcpp not ported to Windows
+ @skipIfWindows # libstdcpp not ported to Windows
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=-1)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.cpp", self.line, num_expected_locations=-1)
self.runCmd("run", RUN_SUCCEEDED)
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
@@ -46,7 +50,9 @@ class StdListDataFormatterTestCase(TestBase):
self.runCmd('type summary clear', check=False)
self.runCmd('type filter clear', check=False)
self.runCmd('type synth clear', check=False)
- self.runCmd("settings set target.max-children-count 256", check=False)
+ self.runCmd(
+ "settings set target.max-children-count 256",
+ check=False)
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
@@ -56,134 +62,148 @@ class StdListDataFormatterTestCase(TestBase):
self.runCmd("type format add -f hex int")
self.expect("frame variable numbers_list --raw", matching=False,
- substrs = ['size=0',
- '{}'])
- self.expect("frame variable &numbers_list._M_impl._M_node --raw", matching=False,
- substrs = ['size=0',
- '{}'])
+ substrs=['size=0',
+ '{}'])
+ self.expect(
+ "frame variable &numbers_list._M_impl._M_node --raw",
+ matching=False,
+ substrs=[
+ 'size=0',
+ '{}'])
self.expect("frame variable numbers_list",
- substrs = ['size=0',
- '{}'])
+ substrs=['size=0',
+ '{}'])
self.expect("p numbers_list",
- substrs = ['size=0',
- '{}'])
+ substrs=['size=0',
+ '{}'])
self.runCmd("n")
self.expect("frame variable numbers_list",
- substrs = ['size=1',
- '[0] = ',
- '0x12345678'])
+ substrs=['size=1',
+ '[0] = ',
+ '0x12345678'])
- self.runCmd("n");self.runCmd("n");self.runCmd("n");
+ self.runCmd("n")
+ self.runCmd("n")
+ self.runCmd("n")
self.expect("frame variable numbers_list",
- substrs = ['size=4',
- '[0] = ',
- '0x12345678',
- '[1] =',
- '0x11223344',
- '[2] =',
- '0xbeeffeed',
- '[3] =',
- '0x00abba00'])
-
- self.runCmd("n");self.runCmd("n");
+ substrs=['size=4',
+ '[0] = ',
+ '0x12345678',
+ '[1] =',
+ '0x11223344',
+ '[2] =',
+ '0xbeeffeed',
+ '[3] =',
+ '0x00abba00'])
+
+ self.runCmd("n")
+ self.runCmd("n")
self.expect("frame variable numbers_list",
- substrs = ['size=6',
- '[0] = ',
- '0x12345678',
- '0x11223344',
- '0xbeeffeed',
- '0x00abba00',
- '[4] =',
- '0x0abcdef0',
- '[5] =',
- '0x0cab0cab'])
+ substrs=['size=6',
+ '[0] = ',
+ '0x12345678',
+ '0x11223344',
+ '0xbeeffeed',
+ '0x00abba00',
+ '[4] =',
+ '0x0abcdef0',
+ '[5] =',
+ '0x0cab0cab'])
self.expect("p numbers_list",
- substrs = ['size=6',
- '[0] = ',
- '0x12345678',
- '0x11223344',
- '0xbeeffeed',
- '0x00abba00',
- '[4] =',
- '0x0abcdef0',
- '[5] =',
- '0x0cab0cab'])
+ substrs=['size=6',
+ '[0] = ',
+ '0x12345678',
+ '0x11223344',
+ '0xbeeffeed',
+ '0x00abba00',
+ '[4] =',
+ '0x0abcdef0',
+ '[5] =',
+ '0x0cab0cab'])
# check access-by-index
self.expect("frame variable numbers_list[0]",
- substrs = ['0x12345678']);
+ substrs=['0x12345678'])
self.expect("frame variable numbers_list[1]",
- substrs = ['0x11223344']);
-
+ substrs=['0x11223344'])
+
# but check that expression does not rely on us
self.expect("expression numbers_list[0]", matching=False, error=True,
- substrs = ['0x12345678'])
+ substrs=['0x12345678'])
# check that MightHaveChildren() gets it right
- self.assertTrue(self.frame().FindVariable("numbers_list").MightHaveChildren(), "numbers_list.MightHaveChildren() says False for non empty!")
+ self.assertTrue(
+ self.frame().FindVariable("numbers_list").MightHaveChildren(),
+ "numbers_list.MightHaveChildren() says False for non empty!")
self.runCmd("n")
-
+
self.expect("frame variable numbers_list",
- substrs = ['size=0',
- '{}'])
+ substrs=['size=0',
+ '{}'])
+
+ self.runCmd("n")
+ self.runCmd("n")
+ self.runCmd("n")
+ self.runCmd("n")
- self.runCmd("n");self.runCmd("n");self.runCmd("n");self.runCmd("n");
-
self.expect("frame variable numbers_list",
- substrs = ['size=4',
- '[0] = ', '1',
- '[1] = ', '2',
- '[2] = ', '3',
- '[3] = ', '4'])
+ substrs=['size=4',
+ '[0] = ', '1',
+ '[1] = ', '2',
+ '[2] = ', '3',
+ '[3] = ', '4'])
self.runCmd("type format delete int")
self.runCmd("n")
-
+
self.expect("frame variable text_list",
- substrs = ['size=0',
- '{}'])
-
- lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.final_line, num_expected_locations=-1)
+ substrs=['size=0',
+ '{}'])
+
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.cpp", self.final_line, num_expected_locations=-1)
self.runCmd("c", RUN_SUCCEEDED)
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
self.expect("frame variable text_list",
- substrs = ['size=4',
- '[0]', 'goofy',
- '[1]', 'is',
- '[2]', 'smart',
- '[3]', '!!!'])
+ substrs=['size=4',
+ '[0]', 'goofy',
+ '[1]', 'is',
+ '[2]', 'smart',
+ '[3]', '!!!'])
self.expect("p text_list",
- substrs = ['size=4',
- '\"goofy\"',
- '\"is\"',
- '\"smart\"',
- '\"!!!\"'])
-
+ substrs=['size=4',
+ '\"goofy\"',
+ '\"is\"',
+ '\"smart\"',
+ '\"!!!\"'])
+
# check access-by-index
self.expect("frame variable text_list[0]",
- substrs = ['goofy']);
+ substrs=['goofy'])
self.expect("frame variable text_list[3]",
- substrs = ['!!!']);
-
+ substrs=['!!!'])
+
# but check that expression does not rely on us
self.expect("expression text_list[0]", matching=False, error=True,
- substrs = ['goofy'])
+ substrs=['goofy'])
# check that MightHaveChildren() gets it right
- self.assertTrue(self.frame().FindVariable("text_list").MightHaveChildren(), "text_list.MightHaveChildren() says False for non empty!")
+ self.assertTrue(
+ self.frame().FindVariable("text_list").MightHaveChildren(),
+ "text_list.MightHaveChildren() says False for non empty!")
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py
index ff99255aec0c..cdaec8392fe0 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py
@@ -5,13 +5,14 @@ Test lldb data formatter subsystem.
from __future__ import print_function
-
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+
class StdMapDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@@ -22,22 +23,22 @@ class StdMapDataFormatterTestCase(TestBase):
# Find the line number to break at.
self.line = line_number('main.cpp', '// Set break point at this line.')
- @expectedFailureAll(compiler="icc", bugnumber="llvm.org/pr15301 LLDB prints incorrect sizes of STL containers")
- @skipIfWindows # libstdcpp not ported to Windows
+ @skipIfWindows # libstdcpp not ported to Windows
@skipIfFreeBSD
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_source_regexp (self, "Set break point at this line.")
+ lldbutil.run_break_set_by_source_regexp(
+ self, "Set break point at this line.")
self.runCmd("run", RUN_SUCCEEDED)
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
@@ -46,278 +47,289 @@ class StdMapDataFormatterTestCase(TestBase):
self.runCmd('type summary clear', check=False)
self.runCmd('type filter clear', check=False)
self.runCmd('type synth clear', check=False)
- self.runCmd("settings set target.max-children-count 256", check=False)
+ self.runCmd(
+ "settings set target.max-children-count 256",
+ check=False)
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
self.runCmd("frame variable ii --show-types")
-
- self.runCmd("type summary add -x \"std::map<\" --summary-string \"map has ${svar%#} items\" -e")
-
+
+ self.runCmd(
+ "type summary add -x \"std::map<\" --summary-string \"map has ${svar%#} items\" -e")
+
self.expect('frame variable ii',
- substrs = ['map has 0 items',
- '{}'])
+ substrs=['map has 0 items',
+ '{}'])
- self.runCmd("c");
+ self.runCmd("c")
self.expect('frame variable ii',
- substrs = ['map has 2 items',
- '[0] = ',
- 'first = 0',
- 'second = 0',
- '[1] = ',
- 'first = 1',
- 'second = 1'])
+ substrs=['map has 2 items',
+ '[0] = ',
+ 'first = 0',
+ 'second = 0',
+ '[1] = ',
+ 'first = 1',
+ 'second = 1'])
- self.runCmd("c");
+ self.runCmd("c")
self.expect('frame variable ii',
- substrs = ['map has 4 items',
- '[2] = ',
- 'first = 2',
- 'second = 0',
- '[3] = ',
- 'first = 3',
- 'second = 1'])
+ substrs=['map has 4 items',
+ '[2] = ',
+ 'first = 2',
+ 'second = 0',
+ '[3] = ',
+ 'first = 3',
+ 'second = 1'])
- self.runCmd("c");
+ self.runCmd("c")
self.expect("frame variable ii",
- substrs = ['map has 9 items',
- '[5] = ',
- 'first = 5',
- 'second = 0',
- '[7] = ',
- 'first = 7',
- 'second = 1'])
-
+ substrs=['map has 9 items',
+ '[5] = ',
+ 'first = 5',
+ 'second = 0',
+ '[7] = ',
+ 'first = 7',
+ 'second = 1'])
+
self.expect("p ii",
- substrs = ['map has 9 items',
- '[5] = ',
- 'first = 5',
- 'second = 0',
- '[7] = ',
- 'first = 7',
- 'second = 1'])
+ substrs=['map has 9 items',
+ '[5] = ',
+ 'first = 5',
+ 'second = 0',
+ '[7] = ',
+ 'first = 7',
+ 'second = 1'])
# check access-by-index
self.expect("frame variable ii[0]",
- substrs = ['first = 0',
- 'second = 0']);
+ substrs=['first = 0',
+ 'second = 0'])
self.expect("frame variable ii[3]",
- substrs = ['first =',
- 'second =']);
-
+ substrs=['first =',
+ 'second ='])
+
self.expect("frame variable ii[8]", matching=True,
- substrs = ['1234567'])
+ substrs=['1234567'])
# check that MightHaveChildren() gets it right
- self.assertTrue(self.frame().FindVariable("ii").MightHaveChildren(), "ii.MightHaveChildren() says False for non empty!")
+ self.assertTrue(
+ self.frame().FindVariable("ii").MightHaveChildren(),
+ "ii.MightHaveChildren() says False for non empty!")
# check that the expression parser does not make use of
# synthetic children instead of running code
# TOT clang has a fix for this, which makes the expression command here succeed
# since this would make the test fail or succeed depending on clang version in use
# this is safer commented for the time being
- #self.expect("expression ii[8]", matching=False, error=True,
+ # self.expect("expression ii[8]", matching=False, error=True,
# substrs = ['1234567'])
self.runCmd("c")
-
+
self.expect('frame variable ii',
- substrs = ['map has 0 items',
- '{}'])
-
+ substrs=['map has 0 items',
+ '{}'])
+
self.runCmd("frame variable si --show-types")
self.expect('frame variable si',
- substrs = ['map has 0 items',
- '{}'])
+ substrs=['map has 0 items',
+ '{}'])
self.runCmd("c")
self.expect('frame variable si',
- substrs = ['map has 1 items',
- '[0] = ',
- 'first = \"zero\"',
- 'second = 0'])
+ substrs=['map has 1 items',
+ '[0] = ',
+ 'first = \"zero\"',
+ 'second = 0'])
- self.runCmd("c");
+ self.runCmd("c")
self.expect("frame variable si",
- substrs = ['map has 5 items',
- '[0] = ',
- 'first = \"zero\"',
- 'second = 0',
- '[1] = ',
- 'first = \"one\"',
- 'second = 1',
- '[2] = ',
- 'first = \"two\"',
- 'second = 2',
- '[3] = ',
- 'first = \"three\"',
- 'second = 3',
- '[4] = ',
- 'first = \"four\"',
- 'second = 4'])
+ substrs=['map has 5 items',
+ '[0] = ',
+ 'first = \"zero\"',
+ 'second = 0',
+ '[1] = ',
+ 'first = \"one\"',
+ 'second = 1',
+ '[2] = ',
+ 'first = \"two\"',
+ 'second = 2',
+ '[3] = ',
+ 'first = \"three\"',
+ 'second = 3',
+ '[4] = ',
+ 'first = \"four\"',
+ 'second = 4'])
self.expect("p si",
- substrs = ['map has 5 items',
- '[0] = ',
- 'first = \"zero\"',
- 'second = 0',
- '[1] = ',
- 'first = \"one\"',
- 'second = 1',
- '[2] = ',
- 'first = \"two\"',
- 'second = 2',
- '[3] = ',
- 'first = \"three\"',
- 'second = 3',
- '[4] = ',
- 'first = \"four\"',
- 'second = 4'])
+ substrs=['map has 5 items',
+ '[0] = ',
+ 'first = \"zero\"',
+ 'second = 0',
+ '[1] = ',
+ 'first = \"one\"',
+ 'second = 1',
+ '[2] = ',
+ 'first = \"two\"',
+ 'second = 2',
+ '[3] = ',
+ 'first = \"three\"',
+ 'second = 3',
+ '[4] = ',
+ 'first = \"four\"',
+ 'second = 4'])
# check access-by-index
self.expect("frame variable si[0]",
- substrs = ['first = ', 'four',
- 'second = 4']);
+ substrs=['first = ', 'four',
+ 'second = 4'])
# check that MightHaveChildren() gets it right
- self.assertTrue(self.frame().FindVariable("si").MightHaveChildren(), "si.MightHaveChildren() says False for non empty!")
+ self.assertTrue(
+ self.frame().FindVariable("si").MightHaveChildren(),
+ "si.MightHaveChildren() says False for non empty!")
# check that the expression parser does not make use of
# synthetic children instead of running code
# TOT clang has a fix for this, which makes the expression command here succeed
# since this would make the test fail or succeed depending on clang version in use
# this is safer commented for the time being
- #self.expect("expression si[0]", matching=False, error=True,
+ # self.expect("expression si[0]", matching=False, error=True,
# substrs = ['first = ', 'zero'])
self.runCmd("c")
-
+
self.expect('frame variable si',
- substrs = ['map has 0 items',
- '{}'])
+ substrs=['map has 0 items',
+ '{}'])
self.runCmd("frame variable is --show-types")
-
+
self.expect('frame variable is',
- substrs = ['map has 0 items',
- '{}'])
+ substrs=['map has 0 items',
+ '{}'])
- self.runCmd("c");
+ self.runCmd("c")
self.expect("frame variable is",
- substrs = ['map has 4 items',
- '[0] = ',
- 'second = \"goofy\"',
- 'first = 85',
- '[1] = ',
- 'second = \"is\"',
- 'first = 1',
- '[2] = ',
- 'second = \"smart\"',
- 'first = 2',
- '[3] = ',
- 'second = \"!!!\"',
- 'first = 3'])
-
+ substrs=['map has 4 items',
+ '[0] = ',
+ 'second = \"goofy\"',
+ 'first = 85',
+ '[1] = ',
+ 'second = \"is\"',
+ 'first = 1',
+ '[2] = ',
+ 'second = \"smart\"',
+ 'first = 2',
+ '[3] = ',
+ 'second = \"!!!\"',
+ 'first = 3'])
+
self.expect("p is",
- substrs = ['map has 4 items',
- '[0] = ',
- 'second = \"goofy\"',
- 'first = 85',
- '[1] = ',
- 'second = \"is\"',
- 'first = 1',
- '[2] = ',
- 'second = \"smart\"',
- 'first = 2',
- '[3] = ',
- 'second = \"!!!\"',
- 'first = 3'])
+ substrs=['map has 4 items',
+ '[0] = ',
+ 'second = \"goofy\"',
+ 'first = 85',
+ '[1] = ',
+ 'second = \"is\"',
+ 'first = 1',
+ '[2] = ',
+ 'second = \"smart\"',
+ 'first = 2',
+ '[3] = ',
+ 'second = \"!!!\"',
+ 'first = 3'])
# check access-by-index
self.expect("frame variable is[0]",
- substrs = ['first = ',
- 'second =']);
+ substrs=['first = ',
+ 'second ='])
# check that MightHaveChildren() gets it right
- self.assertTrue(self.frame().FindVariable("is").MightHaveChildren(), "is.MightHaveChildren() says False for non empty!")
+ self.assertTrue(
+ self.frame().FindVariable("is").MightHaveChildren(),
+ "is.MightHaveChildren() says False for non empty!")
# check that the expression parser does not make use of
# synthetic children instead of running code
# TOT clang has a fix for this, which makes the expression command here succeed
# since this would make the test fail or succeed depending on clang version in use
# this is safer commented for the time being
- #self.expect("expression is[0]", matching=False, error=True,
+ # self.expect("expression is[0]", matching=False, error=True,
# substrs = ['first = ', 'goofy'])
self.runCmd("c")
-
+
self.expect('frame variable is',
- substrs = ['map has 0 items',
- '{}'])
+ substrs=['map has 0 items',
+ '{}'])
self.runCmd("frame variable ss --show-types")
-
+
self.expect('frame variable ss',
- substrs = ['map has 0 items',
- '{}'])
+ substrs=['map has 0 items',
+ '{}'])
- self.runCmd("c");
+ self.runCmd("c")
self.expect("frame variable ss",
- substrs = ['map has 4 items',
- '[0] = ',
- 'second = \"hello\"',
- 'first = \"ciao\"',
- '[1] = ',
- 'second = \"house\"',
- 'first = \"casa\"',
- '[2] = ',
- 'second = \"cat\"',
- 'first = \"gatto\"',
- '[3] = ',
- 'second = \"..is always a Mac!\"',
- 'first = \"a Mac..\"'])
-
+ substrs=['map has 4 items',
+ '[0] = ',
+ 'second = \"hello\"',
+ 'first = \"ciao\"',
+ '[1] = ',
+ 'second = \"house\"',
+ 'first = \"casa\"',
+ '[2] = ',
+ 'second = \"cat\"',
+ 'first = \"gatto\"',
+ '[3] = ',
+ 'second = \"..is always a Mac!\"',
+ 'first = \"a Mac..\"'])
+
self.expect("p ss",
- substrs = ['map has 4 items',
- '[0] = ',
- 'second = \"hello\"',
- 'first = \"ciao\"',
- '[1] = ',
- 'second = \"house\"',
- 'first = \"casa\"',
- '[2] = ',
- 'second = \"cat\"',
- 'first = \"gatto\"',
- '[3] = ',
- 'second = \"..is always a Mac!\"',
- 'first = \"a Mac..\"'])
+ substrs=['map has 4 items',
+ '[0] = ',
+ 'second = \"hello\"',
+ 'first = \"ciao\"',
+ '[1] = ',
+ 'second = \"house\"',
+ 'first = \"casa\"',
+ '[2] = ',
+ 'second = \"cat\"',
+ 'first = \"gatto\"',
+ '[3] = ',
+ 'second = \"..is always a Mac!\"',
+ 'first = \"a Mac..\"'])
# check access-by-index
self.expect("frame variable ss[3]",
- substrs = ['gatto', 'cat']);
+ substrs=['gatto', 'cat'])
# check that MightHaveChildren() gets it right
- self.assertTrue(self.frame().FindVariable("ss").MightHaveChildren(), "ss.MightHaveChildren() says False for non empty!")
-
+ self.assertTrue(
+ self.frame().FindVariable("ss").MightHaveChildren(),
+ "ss.MightHaveChildren() says False for non empty!")
+
# check that the expression parser does not make use of
# synthetic children instead of running code
# TOT clang has a fix for this, which makes the expression command here succeed
# since this would make the test fail or succeed depending on clang version in use
# this is safer commented for the time being
- #self.expect("expression ss[3]", matching=False, error=True,
+ # self.expect("expression ss[3]", matching=False, error=True,
# substrs = ['gatto'])
self.runCmd("c")
-
+
self.expect('frame variable ss',
- substrs = ['map has 0 items',
- '{}'])
+ substrs=['map has 0 items',
+ '{}'])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py
index 20b1a3d21156..8d940c2686a0 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py
@@ -4,43 +4,46 @@ Test lldb data formatter subsystem.
from __future__ import print_function
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+
class StdSmartPtrDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@skipIfFreeBSD
- @skipIfWindows # libstdcpp not ported to Windows
- @skipIfDarwin # doesn't compile on Darwin
+ @skipIfWindows # libstdcpp not ported to Windows
+ @skipIfDarwin # doesn't compile on Darwin
def test_with_run_command(self):
self.build()
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_source_regexp (self, "Set break point at this line.")
+ lldbutil.run_break_set_by_source_regexp(
+ self, "Set break point at this line.")
self.runCmd("run", RUN_SUCCEEDED)
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped', 'stop reason = breakpoint'])
+ substrs=['stopped', 'stop reason = breakpoint'])
+
+ self.expect("frame variable nsp", substrs=['nsp = nullptr'])
+ self.expect("frame variable isp", substrs=['isp = 123'])
+ self.expect("frame variable ssp", substrs=['ssp = "foobar"'])
- self.expect("frame variable nsp", substrs = ['nsp = nullptr'])
- self.expect("frame variable isp", substrs = ['isp = 123'])
- self.expect("frame variable ssp", substrs = ['ssp = "foobar"'])
+ self.expect("frame variable nwp", substrs=['nwp = nullptr'])
+ self.expect("frame variable iwp", substrs=['iwp = 123'])
+ self.expect("frame variable swp", substrs=['swp = "foobar"'])
- self.expect("frame variable nwp", substrs = ['nwp = nullptr'])
- self.expect("frame variable iwp", substrs = ['iwp = 123'])
- self.expect("frame variable swp", substrs = ['swp = "foobar"'])
-
self.runCmd("continue")
- self.expect("frame variable nsp", substrs = ['nsp = nullptr'])
- self.expect("frame variable isp", substrs = ['isp = nullptr'])
- self.expect("frame variable ssp", substrs = ['ssp = nullptr'])
+ self.expect("frame variable nsp", substrs=['nsp = nullptr'])
+ self.expect("frame variable isp", substrs=['isp = nullptr'])
+ self.expect("frame variable ssp", substrs=['ssp = nullptr'])
- self.expect("frame variable nwp", substrs = ['nwp = nullptr'])
- self.expect("frame variable iwp", substrs = ['iwp = nullptr'])
- self.expect("frame variable swp", substrs = ['swp = nullptr'])
+ self.expect("frame variable nwp", substrs=['nwp = nullptr'])
+ self.expect("frame variable iwp", substrs=['iwp = nullptr'])
+ self.expect("frame variable swp", substrs=['swp = nullptr'])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py
index fde2f791183a..67823c95f138 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py
@@ -1,4 +1,4 @@
-#coding=utf8
+# coding=utf8
"""
Test lldb data formatter subsystem.
"""
@@ -6,13 +6,14 @@ Test lldb data formatter subsystem.
from __future__ import print_function
-
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+
class StdStringDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@@ -23,20 +24,21 @@ class StdStringDataFormatterTestCase(TestBase):
# Find the line number to break at.
self.line = line_number('main.cpp', '// Set break point at this line.')
- @skipIfWindows # libstdcpp not ported to Windows
+ @skipIfWindows # libstdcpp not ported to Windows
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=-1)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.cpp", self.line, num_expected_locations=-1)
self.runCmd("run", RUN_SUCCEEDED)
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
@@ -45,7 +47,9 @@ class StdStringDataFormatterTestCase(TestBase):
self.runCmd('type summary clear', check=False)
self.runCmd('type filter clear', check=False)
self.runCmd('type synth clear', check=False)
- self.runCmd("settings set target.max-children-count 256", check=False)
+ self.runCmd(
+ "settings set target.max-children-count 256",
+ check=False)
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
@@ -56,12 +60,22 @@ class StdStringDataFormatterTestCase(TestBase):
var_q = self.frame().FindVariable('q')
var_Q = self.frame().FindVariable('Q')
- self.assertTrue(var_s.GetSummary() == 'L"hello world! מזל טוב!"', "s summary wrong")
+ self.assertTrue(
+ var_s.GetSummary() == 'L"hello world! מזל טוב!"',
+ "s summary wrong")
self.assertTrue(var_S.GetSummary() == 'L"!!!!"', "S summary wrong")
- self.assertTrue(var_mazeltov.GetSummary() == 'L"מזל טוב"', "mazeltov summary wrong")
- self.assertTrue(var_q.GetSummary() == '"hello world"', "q summary wrong")
- self.assertTrue(var_Q.GetSummary() == '"quite a long std::strin with lots of info inside it"', "Q summary wrong")
+ self.assertTrue(
+ var_mazeltov.GetSummary() == 'L"מזל טוב"',
+ "mazeltov summary wrong")
+ self.assertTrue(
+ var_q.GetSummary() == '"hello world"',
+ "q summary wrong")
+ self.assertTrue(
+ var_Q.GetSummary() == '"quite a long std::strin with lots of info inside it"',
+ "Q summary wrong")
self.runCmd("next")
- self.assertTrue(var_S.GetSummary() == 'L"!!!!!"', "new S summary wrong")
+ self.assertTrue(
+ var_S.GetSummary() == 'L"!!!!!"',
+ "new S summary wrong")
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/tuple/Makefile b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/tuple/Makefile
new file mode 100644
index 000000000000..beb2fd583e7a
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/tuple/Makefile
@@ -0,0 +1,8 @@
+LEVEL = ../../../../../make
+
+CXX_SOURCES := main.cpp
+
+USE_LIBSTDCPP := 1
+CFLAGS_EXTRAS += $(NO_LIMIT_DEBUG_INFO_FLAGS)
+
+include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/tuple/TestDataFormatterStdTuple.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/tuple/TestDataFormatterStdTuple.py
new file mode 100644
index 000000000000..56e231da8522
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/tuple/TestDataFormatterStdTuple.py
@@ -0,0 +1,49 @@
+"""
+Test lldb data formatter subsystem.
+"""
+
+from __future__ import print_function
+
+import os
+import time
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class StdTupleDataFormatterTestCase(TestBase):
+ mydir = TestBase.compute_mydir(__file__)
+
+ @skipIfFreeBSD
+ @skipIfWindows # libstdcpp not ported to Windows
+ @skipIfDarwin # doesn't compile on Darwin
+ def test_with_run_command(self):
+ self.build()
+ self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+
+ lldbutil.run_break_set_by_source_regexp(
+ self, "Set break point at this line.")
+ self.runCmd("run", RUN_SUCCEEDED)
+
+ # The stop reason of the thread should be breakpoint.
+ self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
+ substrs=['stopped', 'stop reason = breakpoint'])
+
+ frame = self.frame()
+ self.assertTrue(frame.IsValid())
+
+ self.expect("frame variable ti", substrs=['[0] = 1'])
+ self.expect("frame variable ts", substrs=['[0] = "foobar"'])
+ self.expect("frame variable tt", substrs=['[0] = 1', '[1] = "baz"', '[2] = 2'])
+
+ self.assertEqual(1, frame.GetValueForVariablePath("ti[0]").GetValueAsUnsigned())
+ self.assertFalse(frame.GetValueForVariablePath("ti[1]").IsValid())
+
+ self.assertEqual('"foobar"', frame.GetValueForVariablePath("ts[0]").GetSummary())
+ self.assertFalse(frame.GetValueForVariablePath("ts[1]").IsValid())
+
+ self.assertEqual(1, frame.GetValueForVariablePath("tt[0]").GetValueAsUnsigned())
+ self.assertEqual('"baz"', frame.GetValueForVariablePath("tt[1]").GetSummary())
+ self.assertEqual(2, frame.GetValueForVariablePath("tt[2]").GetValueAsUnsigned())
+ self.assertFalse(frame.GetValueForVariablePath("tt[3]").IsValid())
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/tuple/main.cpp b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/tuple/main.cpp
new file mode 100644
index 000000000000..7247742ee6bb
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/tuple/main.cpp
@@ -0,0 +1,9 @@
+#include <memory>
+#include <string>
+
+int main() {
+ std::tuple<int> ti{1};
+ std::tuple<std::string> ts{"foobar"};
+ std::tuple<int, std::string, int> tt{1, "baz", 2};
+ return 0; // Set break point at this line.
+}
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/Makefile b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/Makefile
new file mode 100644
index 000000000000..beb2fd583e7a
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/Makefile
@@ -0,0 +1,8 @@
+LEVEL = ../../../../../make
+
+CXX_SOURCES := main.cpp
+
+USE_LIBSTDCPP := 1
+CFLAGS_EXTRAS += $(NO_LIMIT_DEBUG_INFO_FLAGS)
+
+include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/TestDataFormatterStdUniquePtr.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/TestDataFormatterStdUniquePtr.py
new file mode 100644
index 000000000000..770d87178f50
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/TestDataFormatterStdUniquePtr.py
@@ -0,0 +1,61 @@
+"""
+Test lldb data formatter subsystem.
+"""
+
+from __future__ import print_function
+
+import os
+import time
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class StdUniquePtrDataFormatterTestCase(TestBase):
+ mydir = TestBase.compute_mydir(__file__)
+
+ @skipIfFreeBSD
+ @skipIfWindows # libstdcpp not ported to Windows
+ @skipIfDarwin # doesn't compile on Darwin
+ def test_with_run_command(self):
+ self.build()
+ self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+
+ lldbutil.run_break_set_by_source_regexp(
+ self, "Set break point at this line.")
+ self.runCmd("run", RUN_SUCCEEDED)
+
+ # The stop reason of the thread should be breakpoint.
+ self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
+ substrs=['stopped', 'stop reason = breakpoint'])
+
+ frame = self.frame()
+ self.assertTrue(frame.IsValid())
+
+ self.expect("frame variable nup", substrs=['nup = nullptr'])
+ self.expect("frame variable iup", substrs=['iup = 0x', 'object = 123'])
+ self.expect("frame variable sup", substrs=['sup = 0x', 'object = "foobar"'])
+
+ self.expect("frame variable ndp", substrs=['ndp = nullptr'])
+ self.expect("frame variable idp", substrs=['idp = 0x', 'object = 456', 'deleter = ', 'a = 1', 'b = 2'])
+ self.expect("frame variable sdp", substrs=['sdp = 0x', 'object = "baz"', 'deleter = ', 'a = 3', 'b = 4'])
+
+ self.assertEqual(123, frame.GetValueForVariablePath("iup.object").GetValueAsUnsigned())
+ self.assertFalse(frame.GetValueForVariablePath("iup.deleter").IsValid())
+
+ self.assertEqual('"foobar"', frame.GetValueForVariablePath("sup.object").GetSummary())
+ self.assertFalse(frame.GetValueForVariablePath("sup.deleter").IsValid())
+
+ self.assertEqual(456, frame.GetValueForVariablePath("idp.object").GetValueAsUnsigned())
+ self.assertEqual('"baz"', frame.GetValueForVariablePath("sdp.object").GetSummary())
+
+ idp_deleter = frame.GetValueForVariablePath("idp.deleter")
+ self.assertTrue(idp_deleter.IsValid())
+ self.assertEqual(1, idp_deleter.GetChildMemberWithName("a").GetValueAsUnsigned())
+ self.assertEqual(2, idp_deleter.GetChildMemberWithName("b").GetValueAsUnsigned())
+
+ sdp_deleter = frame.GetValueForVariablePath("sdp.deleter")
+ self.assertTrue(sdp_deleter.IsValid())
+ self.assertEqual(3, sdp_deleter.GetChildMemberWithName("a").GetValueAsUnsigned())
+ self.assertEqual(4, sdp_deleter.GetChildMemberWithName("b").GetValueAsUnsigned())
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/main.cpp b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/main.cpp
new file mode 100644
index 000000000000..4a40309338c1
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/main.cpp
@@ -0,0 +1,22 @@
+#include <memory>
+#include <string>
+
+struct Deleter {
+ void operator()(void *) {}
+
+ int a;
+ int b;
+};
+
+int main() {
+ std::unique_ptr<char> nup;
+ std::unique_ptr<int> iup(new int{123});
+ std::unique_ptr<std::string> sup(new std::string("foobar"));
+
+ std::unique_ptr<char, Deleter> ndp;
+ std::unique_ptr<int, Deleter> idp(new int{456}, Deleter{1, 2});
+ std::unique_ptr<std::string, Deleter> sdp(new std::string("baz"),
+ Deleter{3, 4});
+
+ return 0; // Set break point at this line.
+}
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py
index f5cf7c04c3a7..17b369df3e6b 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py
@@ -5,13 +5,14 @@ Test lldb data formatter subsystem.
from __future__ import print_function
-
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+
class StdVBoolDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@@ -22,23 +23,25 @@ class StdVBoolDataFormatterTestCase(TestBase):
# Find the line number to break at.
self.line = line_number('main.cpp', '// Set break point at this line.')
- @expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr20548 fails to build on lab.llvm.org buildbot')
- @expectedFailureAll(compiler="icc", bugnumber="llvm.org/pr15301 LLDB prints incorrect sizes of STL containers")
- @skipIfWindows # libstdcpp not ported to Windows.
+ @expectedFailureAll(
+ oslist=['freebsd'],
+ bugnumber='llvm.org/pr20548 fails to build on lab.llvm.org buildbot')
+ @skipIfWindows # libstdcpp not ported to Windows.
@skipIfDarwin
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=-1)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.cpp", self.line, num_expected_locations=-1)
self.runCmd("run", RUN_SUCCEEDED)
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
@@ -47,13 +50,33 @@ class StdVBoolDataFormatterTestCase(TestBase):
self.runCmd('type summary clear', check=False)
self.runCmd('type filter clear', check=False)
self.runCmd('type synth clear', check=False)
- self.runCmd("settings set target.max-children-count 256", check=False)
+ self.runCmd(
+ "settings set target.max-children-count 256",
+ check=False)
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
- self.expect("frame variable vBool",
- substrs = ['size=49','[0] = false','[1] = true','[18] = false','[27] = true','[36] = false','[47] = true','[48] = true'])
+ self.expect(
+ "frame variable vBool",
+ substrs=[
+ 'size=49',
+ '[0] = false',
+ '[1] = true',
+ '[18] = false',
+ '[27] = true',
+ '[36] = false',
+ '[47] = true',
+ '[48] = true'])
- self.expect("expr vBool",
- substrs = ['size=49','[0] = false','[1] = true','[18] = false','[27] = true','[36] = false','[47] = true','[48] = true'])
+ self.expect(
+ "expr vBool",
+ substrs=[
+ 'size=49',
+ '[0] = false',
+ '[1] = true',
+ '[18] = false',
+ '[27] = true',
+ '[36] = false',
+ '[47] = true',
+ '[48] = true'])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py
index 4a352ef41c17..e4ec703495b3 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py
@@ -5,13 +5,14 @@ Test lldb data formatter subsystem.
from __future__ import print_function
-
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+
class StdVectorDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@@ -23,21 +24,21 @@ class StdVectorDataFormatterTestCase(TestBase):
self.line = line_number('main.cpp', '// Set break point at this line.')
@skipIfFreeBSD
- @expectedFailureAll(compiler="icc", bugnumber="llvm.org/pr15301 LLDB prints incorrect sizes of STL containers")
- @skipIfWindows # libstdcpp not ported to Windows
+ @skipIfWindows # libstdcpp not ported to Windows
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_source_regexp (self, "Set break point at this line.")
+ lldbutil.run_break_set_by_source_regexp(
+ self, "Set break point at this line.")
self.runCmd("run", RUN_SUCCEEDED)
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
@@ -46,163 +47,171 @@ class StdVectorDataFormatterTestCase(TestBase):
self.runCmd('type summary clear', check=False)
self.runCmd('type filter clear', check=False)
self.runCmd('type synth clear', check=False)
- self.runCmd("settings set target.max-children-count 256", check=False)
+ self.runCmd(
+ "settings set target.max-children-count 256",
+ check=False)
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
# empty vectors (and storage pointers SHOULD BOTH BE NULL..)
self.expect("frame variable numbers",
- substrs = ['numbers = size=0'])
+ substrs=['numbers = size=0'])
self.runCmd("c")
-
+
# first value added
self.expect("frame variable numbers",
- substrs = ['numbers = size=1',
- '[0] = 1',
- '}'])
+ substrs=['numbers = size=1',
+ '[0] = 1',
+ '}'])
# add some more data
- self.runCmd("c");
-
+ self.runCmd("c")
+
self.expect("frame variable numbers",
- substrs = ['numbers = size=4',
- '[0] = 1',
- '[1] = 12',
- '[2] = 123',
- '[3] = 1234',
- '}'])
+ substrs=['numbers = size=4',
+ '[0] = 1',
+ '[1] = 12',
+ '[2] = 123',
+ '[3] = 1234',
+ '}'])
self.expect("p numbers",
- substrs = ['$', 'size=4',
- '[0] = 1',
- '[1] = 12',
- '[2] = 123',
- '[3] = 1234',
- '}'])
-
-
+ substrs=['$', 'size=4',
+ '[0] = 1',
+ '[1] = 12',
+ '[2] = 123',
+ '[3] = 1234',
+ '}'])
+
# check access to synthetic children
- self.runCmd("type summary add --summary-string \"item 0 is ${var[0]}\" std::int_vect int_vect")
+ self.runCmd(
+ "type summary add --summary-string \"item 0 is ${var[0]}\" std::int_vect int_vect")
self.expect('frame variable numbers',
- substrs = ['item 0 is 1']);
-
- self.runCmd("type summary add --summary-string \"item 0 is ${svar[0]}\" std::int_vect int_vect")
+ substrs=['item 0 is 1'])
+
+ self.runCmd(
+ "type summary add --summary-string \"item 0 is ${svar[0]}\" std::int_vect int_vect")
#import time
- #time.sleep(19)
+ # time.sleep(19)
self.expect('frame variable numbers',
- substrs = ['item 0 is 1']);
+ substrs=['item 0 is 1'])
# move on with synths
self.runCmd("type summary delete std::int_vect")
self.runCmd("type summary delete int_vect")
# add some more data
- self.runCmd("c");
+ self.runCmd("c")
self.expect("frame variable numbers",
- substrs = ['numbers = size=7',
- '[0] = 1',
- '[1] = 12',
- '[2] = 123',
- '[3] = 1234',
- '[4] = 12345',
- '[5] = 123456',
- '[6] = 1234567',
- '}'])
-
+ substrs=['numbers = size=7',
+ '[0] = 1',
+ '[1] = 12',
+ '[2] = 123',
+ '[3] = 1234',
+ '[4] = 12345',
+ '[5] = 123456',
+ '[6] = 1234567',
+ '}'])
+
self.expect("p numbers",
- substrs = ['$', 'size=7',
- '[0] = 1',
- '[1] = 12',
- '[2] = 123',
- '[3] = 1234',
- '[4] = 12345',
- '[5] = 123456',
- '[6] = 1234567',
- '}'])
+ substrs=['$', 'size=7',
+ '[0] = 1',
+ '[1] = 12',
+ '[2] = 123',
+ '[3] = 1234',
+ '[4] = 12345',
+ '[5] = 123456',
+ '[6] = 1234567',
+ '}'])
# check access-by-index
self.expect("frame variable numbers[0]",
- substrs = ['1']);
+ substrs=['1'])
self.expect("frame variable numbers[1]",
- substrs = ['12']);
+ substrs=['12'])
self.expect("frame variable numbers[2]",
- substrs = ['123']);
+ substrs=['123'])
self.expect("frame variable numbers[3]",
- substrs = ['1234']);
-
+ substrs=['1234'])
+
# but check that expression does not rely on us
# (when expression gets to call into STL code correctly, we will have to find
# another way to check this)
self.expect("expression numbers[6]", matching=False, error=True,
- substrs = ['1234567'])
+ substrs=['1234567'])
# check that MightHaveChildren() gets it right
- self.assertTrue(self.frame().FindVariable("numbers").MightHaveChildren(), "numbers.MightHaveChildren() says False for non empty!")
+ self.assertTrue(
+ self.frame().FindVariable("numbers").MightHaveChildren(),
+ "numbers.MightHaveChildren() says False for non empty!")
# clear out the vector and see that we do the right thing once again
self.runCmd("c")
self.expect("frame variable numbers",
- substrs = ['numbers = size=0'])
+ substrs=['numbers = size=0'])
self.runCmd("c")
# first value added
self.expect("frame variable numbers",
- substrs = ['numbers = size=1',
- '[0] = 7',
- '}'])
+ substrs=['numbers = size=1',
+ '[0] = 7',
+ '}'])
# check if we can display strings
self.runCmd("c")
self.expect("frame variable strings",
- substrs = ['goofy',
- 'is',
- 'smart'])
+ substrs=['goofy',
+ 'is',
+ 'smart'])
self.expect("p strings",
- substrs = ['goofy',
- 'is',
- 'smart'])
+ substrs=['goofy',
+ 'is',
+ 'smart'])
# test summaries based on synthetic children
- self.runCmd("type summary add std::string_vect string_vect --summary-string \"vector has ${svar%#} items\" -e")
+ self.runCmd(
+ "type summary add std::string_vect string_vect --summary-string \"vector has ${svar%#} items\" -e")
self.expect("frame variable strings",
- substrs = ['vector has 3 items',
- 'goofy',
- 'is',
- 'smart'])
+ substrs=['vector has 3 items',
+ 'goofy',
+ 'is',
+ 'smart'])
self.expect("p strings",
- substrs = ['vector has 3 items',
- 'goofy',
- 'is',
- 'smart'])
+ substrs=['vector has 3 items',
+ 'goofy',
+ 'is',
+ 'smart'])
- self.runCmd("c");
+ self.runCmd("c")
self.expect("frame variable strings",
- substrs = ['vector has 4 items'])
-
+ substrs=['vector has 4 items'])
+
# check access-by-index
self.expect("frame variable strings[0]",
- substrs = ['goofy']);
+ substrs=['goofy'])
self.expect("frame variable strings[1]",
- substrs = ['is']);
-
+ substrs=['is'])
+
# but check that expression does not rely on us
# (when expression gets to call into STL code correctly, we will have to find
# another way to check this)
self.expect("expression strings[0]", matching=False, error=True,
- substrs = ['goofy'])
+ substrs=['goofy'])
# check that MightHaveChildren() gets it right
- self.assertTrue(self.frame().FindVariable("strings").MightHaveChildren(), "strings.MightHaveChildren() says False for non empty!")
+ self.assertTrue(
+ self.frame().FindVariable("strings").MightHaveChildren(),
+ "strings.MightHaveChildren() says False for non empty!")
self.runCmd("c")
self.expect("frame variable strings",
- substrs = ['vector has 0 items'])
+ substrs=['vector has 0 items'])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py
index 8cebf20ddd2a..8fff07d89dca 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py
@@ -5,12 +5,13 @@ Test lldb data formatter subsystem.
from __future__ import print_function
-
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.lldbtest import *
import lldbsuite.test.lldbutil as lldbutil
+
class SynthDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@@ -26,14 +27,15 @@ class SynthDataFormatterTestCase(TestBase):
self.build()
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
self.runCmd("run", RUN_SUCCEEDED)
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
@@ -48,158 +50,171 @@ class SynthDataFormatterTestCase(TestBase):
# Pick some values and check that the basics work
self.runCmd("type filter add BagOfInts --child x --child z")
self.expect("frame variable int_bag",
- substrs = ['x = 6',
- 'z = 8'])
+ substrs=['x = 6',
+ 'z = 8'])
# Check we can still access the missing child by summary
- self.runCmd("type summary add BagOfInts --summary-string \"y=${var.y}\"")
+ self.runCmd(
+ "type summary add BagOfInts --summary-string \"y=${var.y}\"")
self.expect('frame variable int_bag',
- substrs = ['y=7'])
-
- # Even if we have synth children, the summary prevails
+ substrs=['y=7'])
+
+ # Even if we have synth children, the summary prevails
self.expect("frame variable int_bag", matching=False,
- substrs = ['x = 6',
- 'z = 8'])
-
+ substrs=['x = 6',
+ 'z = 8'])
+
# if we skip synth and summary show y
- self.expect("frame variable int_bag --synthetic-type false --no-summary-depth=1",
- substrs = ['x = 6',
- 'y = 7',
- 'z = 8'])
-
+ self.expect(
+ "frame variable int_bag --synthetic-type false --no-summary-depth=1",
+ substrs=[
+ 'x = 6',
+ 'y = 7',
+ 'z = 8'])
+
# if we ask for raw output same happens
self.expect("frame variable int_bag --raw-output",
- substrs = ['x = 6',
- 'y = 7',
- 'z = 8'])
-
+ substrs=['x = 6',
+ 'y = 7',
+ 'z = 8'])
+
# Summary+Synth must work together
- self.runCmd("type summary add BagOfInts --summary-string \"x=${var.x}\" -e")
+ self.runCmd(
+ "type summary add BagOfInts --summary-string \"x=${var.x}\" -e")
self.expect('frame variable int_bag',
- substrs = ['x=6',
- 'x = 6',
- 'z = 8'])
-
+ substrs=['x=6',
+ 'x = 6',
+ 'z = 8'])
+
# Same output, but using Python
- self.runCmd("type summary add BagOfInts --python-script \"return 'x=%s' % valobj.GetChildMemberWithName('x').GetValue()\" -e")
+ self.runCmd(
+ "type summary add BagOfInts --python-script \"return 'x=%s' % valobj.GetChildMemberWithName('x').GetValue()\" -e")
self.expect('frame variable int_bag',
- substrs = ['x=6',
- 'x = 6',
- 'z = 8'])
+ substrs=['x=6',
+ 'x = 6',
+ 'z = 8'])
# If I skip summaries, still give me the artificial children
self.expect("frame variable int_bag --no-summary-depth=1",
- substrs = ['x = 6',
- 'z = 8'])
+ substrs=['x = 6',
+ 'z = 8'])
# Delete synth and check that the view reflects it immediately
self.runCmd("type filter delete BagOfInts")
self.expect("frame variable int_bag",
- substrs = ['x = 6',
- 'y = 7',
- 'z = 8'])
+ substrs=['x = 6',
+ 'y = 7',
+ 'z = 8'])
- # Add the synth again and check that it's honored deeper in the hierarchy
+ # Add the synth again and check that it's honored deeper in the
+ # hierarchy
self.runCmd("type filter add BagOfInts --child x --child z")
self.expect('frame variable bag_bag',
- substrs = ['x = x=69 {',
- 'x = 69',
- 'z = 71',
- 'y = x=66 {',
- 'x = 66',
- 'z = 68'])
+ substrs=['x = x=69 {',
+ 'x = 69',
+ 'z = 71',
+ 'y = x=66 {',
+ 'x = 66',
+ 'z = 68'])
self.expect('frame variable bag_bag', matching=False,
- substrs = ['y = 70',
- 'y = 67'])
+ substrs=['y = 70',
+ 'y = 67'])
# Check that a synth can expand nested stuff
self.runCmd("type filter add BagOfBags --child x.y --child y.z")
self.expect('frame variable bag_bag',
- substrs = ['x.y = 70',
- 'y.z = 68'])
+ substrs=['x.y = 70',
+ 'y.z = 68'])
# ...even if we get -> and . wrong
self.runCmd("type filter add BagOfBags --child x.y --child \"y->z\"")
self.expect('frame variable bag_bag',
- substrs = ['x.y = 70',
- 'y->z = 68'])
+ substrs=['x.y = 70',
+ 'y->z = 68'])
# ...even bitfields
- self.runCmd("type filter add BagOfBags --child x.y --child \"y->z[1-2]\"")
+ self.runCmd(
+ "type filter add BagOfBags --child x.y --child \"y->z[1-2]\"")
self.expect('frame variable bag_bag --show-types',
- substrs = ['x.y = 70',
- '(int:2) y->z[1-2] = 2'])
+ substrs=['x.y = 70',
+ '(int:2) y->z[1-2] = 2'])
# ...even if we format the bitfields
- self.runCmd("type filter add BagOfBags --child x.y --child \"y->y[0-0]\"")
+ self.runCmd(
+ "type filter add BagOfBags --child x.y --child \"y->y[0-0]\"")
self.runCmd("type format add \"int:1\" -f bool")
self.expect('frame variable bag_bag --show-types',
- substrs = ['x.y = 70',
- '(int:1) y->y[0-0] = true'])
-
+ substrs=['x.y = 70',
+ '(int:1) y->y[0-0] = true'])
+
# ...even if we use one-liner summaries
self.runCmd("type summary add -c BagOfBags")
- self.expect('frame variable bag_bag',
- substrs = ['(BagOfBags) bag_bag = (x.y = 70, y->y[0-0] = true)'])
-
+ self.expect('frame variable bag_bag', substrs=[
+ '(BagOfBags) bag_bag = (x.y = 70, y->y[0-0] = true)'])
+
self.runCmd("type summary delete BagOfBags")
# now check we are dynamic (and arrays work)
- self.runCmd("type filter add Plenty --child bitfield --child array[0] --child array[2]")
+ self.runCmd(
+ "type filter add Plenty --child bitfield --child array[0] --child array[2]")
self.expect('frame variable plenty_of_stuff',
- substrs = ['bitfield = 1',
- 'array[0] = 5',
- 'array[2] = 3'])
-
+ substrs=['bitfield = 1',
+ 'array[0] = 5',
+ 'array[2] = 3'])
+
self.runCmd("n")
self.expect('frame variable plenty_of_stuff',
- substrs = ['bitfield = 17',
- 'array[0] = 5',
- 'array[2] = 3'])
-
+ substrs=['bitfield = 17',
+ 'array[0] = 5',
+ 'array[2] = 3'])
+
# skip synthetic children
self.expect('frame variable plenty_of_stuff --synthetic-type no',
- substrs = ['some_values = 0x',
- 'array = 0x',
- 'array_size = 5'])
+ substrs=['some_values = 0x',
+ 'array = 0x',
+ 'array_size = 5'])
-
# check flat printing with synthetic children
self.expect('frame variable plenty_of_stuff --flat',
- substrs = ['plenty_of_stuff.bitfield = 17',
- '*(plenty_of_stuff.array) = 5',
- '*(plenty_of_stuff.array) = 3'])
-
+ substrs=['plenty_of_stuff.bitfield = 17',
+ '*(plenty_of_stuff.array) = 5',
+ '*(plenty_of_stuff.array) = 3'])
+
# check that we do not lose location information for our children
self.expect('frame variable plenty_of_stuff --location',
- substrs = ['0x',
- ': bitfield = 17'])
+ substrs=['0x',
+ ': bitfield = 17'])
# check we work across pointer boundaries
self.expect('frame variable plenty_of_stuff.some_values --ptr-depth=1',
- substrs = ['(BagOfInts *) plenty_of_stuff.some_values',
- 'x = 5',
- 'z = 7'])
+ substrs=['(BagOfInts *) plenty_of_stuff.some_values',
+ 'x = 5',
+ 'z = 7'])
# but not if we don't want to
self.runCmd("type filter add BagOfInts --child x --child z -p")
self.expect('frame variable plenty_of_stuff.some_values --ptr-depth=1',
- substrs = ['(BagOfInts *) plenty_of_stuff.some_values',
- 'x = 5',
- 'y = 6',
- 'z = 7'])
+ substrs=['(BagOfInts *) plenty_of_stuff.some_values',
+ 'x = 5',
+ 'y = 6',
+ 'z = 7'])
# check we're dynamic even if nested
self.runCmd("type filter add BagOfBags --child x.z")
self.expect('frame variable bag_bag',
- substrs = ['x.z = 71'])
+ substrs=['x.z = 71'])
self.runCmd("n")
self.expect('frame variable bag_bag',
- substrs = ['x.z = 12'])
+ substrs=['x.z = 12'])
- self.runCmd('type summary add -e -s "I am always empty but have" EmptyStruct')
- self.expect('frame variable es', substrs = ["I am always empty but have {}"])
+ self.runCmd(
+ 'type summary add -e -s "I am always empty but have" EmptyStruct')
+ self.expect('frame variable es', substrs=[
+ "I am always empty but have {}"])
self.runCmd('type summary add -e -h -s "I am really empty" EmptyStruct')
- self.expect('frame variable es', substrs = ["I am really empty"])
- self.expect('frame variable es', substrs = ["I am really empty {}"], matching=False)
+ self.expect('frame variable es', substrs=["I am really empty"])
+ self.expect(
+ 'frame variable es',
+ substrs=["I am really empty {}"],
+ matching=False)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/TestDataFormatterSynthType.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/TestDataFormatterSynthType.py
index 6a03456e5c32..75d3b4e5f5c2 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/TestDataFormatterSynthType.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/TestDataFormatterSynthType.py
@@ -5,13 +5,14 @@ Test lldb data formatter subsystem.
from __future__ import print_function
-
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+
class DataFormatterSynthTypeTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@@ -22,20 +23,21 @@ class DataFormatterSynthTypeTestCase(TestBase):
# Find the line number to break at.
self.line = line_number('main.cpp', 'break here')
- @skipIfFreeBSD # llvm.org/pr20545 bogus output confuses buildbot parser
+ @skipIfFreeBSD # llvm.org/pr20545 bogus output confuses buildbot parser
def test_with_run_command(self):
"""Test using Python synthetic children provider to provide a typename."""
self.build()
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
self.runCmd("run", RUN_SUCCEEDED)
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/myIntSynthProvider.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/myIntSynthProvider.py
index 42737140b112..fa47ca2cfe69 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/myIntSynthProvider.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/myIntSynthProvider.py
@@ -1,22 +1,30 @@
class myIntSynthProvider(object):
- def __init__(self, valobj, dict):
- self.valobj = valobj;
- self.val = self.valobj.GetChildMemberWithName("theValue")
- def num_children(self):
- return 0;
- def get_child_at_index(self, index):
- return None
- def get_child_index(self, name):
- return None
- def update(self):
- return False
- def has_children(self):
- return False
- def get_type_name(self):
- return "ThisTestPasses"
+
+ def __init__(self, valobj, dict):
+ self.valobj = valobj
+ self.val = self.valobj.GetChildMemberWithName("theValue")
+
+ def num_children(self):
+ return 0
+
+ def get_child_at_index(self, index):
+ return None
+
+ def get_child_index(self, name):
+ return None
+
+ def update(self):
+ return False
+
+ def has_children(self):
+ return False
+
+ def get_type_name(self):
+ return "ThisTestPasses"
class myArraySynthProvider(object):
+
def __init__(self, valobj, dict):
self.valobj = valobj
self.array = self.valobj.GetChildMemberWithName("array")
@@ -27,10 +35,10 @@ class myArraySynthProvider(object):
return max_count
def get_child_at_index(self, index):
- return None # Keep it simple when this is not tested here.
+ return None # Keep it simple when this is not tested here.
def get_child_index(self, name):
- return None # Keep it simple when this is not tested here.
+ return None # Keep it simple when this is not tested here.
def has_children(self):
return True
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthval/TestDataFormatterSynthVal.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthval/TestDataFormatterSynthVal.py
index e7a34647a6de..6e7ac2c13f31 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthval/TestDataFormatterSynthVal.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthval/TestDataFormatterSynthVal.py
@@ -5,13 +5,14 @@ Test lldb data formatter subsystem.
from __future__ import print_function
-
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+
class DataFormatterSynthValueTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@@ -22,21 +23,24 @@ class DataFormatterSynthValueTestCase(TestBase):
# Find the line number to break at.
self.line = line_number('main.cpp', 'break here')
- @skipIfFreeBSD # llvm.org/pr20545 bogus output confuses buildbot parser
- @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24462, Data formatters have problems on Windows")
+ @skipIfFreeBSD # llvm.org/pr20545 bogus output confuses buildbot parser
+ @expectedFailureAll(
+ oslist=["windows"],
+ bugnumber="llvm.org/pr24462, Data formatters have problems on Windows")
def test_with_run_command(self):
"""Test using Python synthetic children provider to provide a value."""
self.build()
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
self.runCmd("run", RUN_SUCCEEDED)
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
@@ -48,43 +52,64 @@ class DataFormatterSynthValueTestCase(TestBase):
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
-
+
x = self.frame().FindVariable("x")
x.SetPreferSyntheticValue(True)
y = self.frame().FindVariable("y")
y.SetPreferSyntheticValue(True)
z = self.frame().FindVariable("z")
z.SetPreferSyntheticValue(True)
+ q = self.frame().FindVariable("q")
+ z.SetPreferSyntheticValue(True)
x_val = x.GetValueAsUnsigned
y_val = y.GetValueAsUnsigned
z_val = z.GetValueAsUnsigned
-
+ q_val = q.GetValueAsUnsigned
+
if self.TraceOn():
- print("x_val = %s; y_val = %s; z_val = %s" % (x_val(),y_val(),z_val()))
+ print(
+ "x_val = %s; y_val = %s; z_val = %s; q_val = %s" %
+ (x_val(), y_val(), z_val(), q_val()))
self.assertFalse(x_val() == 3, "x == 3 before synthetics")
self.assertFalse(y_val() == 4, "y == 4 before synthetics")
self.assertFalse(z_val() == 7, "z == 7 before synthetics")
+ self.assertFalse(q_val() == 8, "q == 8 before synthetics")
# now set up the synth
self.runCmd("script from myIntSynthProvider import *")
self.runCmd("type synth add -l myIntSynthProvider myInt")
self.runCmd("type synth add -l myArraySynthProvider myArray")
-
+ self.runCmd("type synth add -l myIntSynthProvider myIntAndStuff")
+
if self.TraceOn():
- print("x_val = %s; y_val = %s; z_val = %s" % (x_val(),y_val(),z_val()))
-
+ print(
+ "x_val = %s; y_val = %s; z_val = %s; q_val = %s" %
+ (x_val(), y_val(), z_val(), q_val()))
+
self.assertTrue(x_val() == 3, "x != 3 after synthetics")
self.assertTrue(y_val() == 4, "y != 4 after synthetics")
self.assertTrue(z_val() == 7, "z != 7 after synthetics")
-
+ self.assertTrue(q_val() == 8, "q != 8 after synthetics")
+
self.expect("frame variable x", substrs=['3'])
- self.expect("frame variable x", substrs=['theValue = 3'], matching=False)
-
- # check that an aptly defined synthetic provider does not affect one-lining
- self.expect("expression struct S { myInt theInt{12}; }; S()", substrs = ['(theInt = 12)'])
-
+ self.expect(
+ "frame variable x",
+ substrs=['theValue = 3'],
+ matching=False)
+ self.expect("frame variable q", substrs=['8'])
+ self.expect(
+ "frame variable q",
+ substrs=['theValue = 8'],
+ matching=False)
+
+ # check that an aptly defined synthetic provider does not affect
+ # one-lining
+ self.expect(
+ "expression struct S { myInt theInt{12}; }; S()",
+ substrs=['(theInt = 12)'])
+
# check that we can use a synthetic value in a summary
self.runCmd("type summary add hasAnInt -s ${var.theInt}")
hi = self.frame().FindVariable("hi")
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthval/main.cpp b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthval/main.cpp
index accbf0a5a578..1a5925a05a65 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthval/main.cpp
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthval/main.cpp
@@ -5,6 +5,16 @@ class myInt {
int val() { return theValue; }
};
+class myIntAndStuff {
+private:
+ int theValue;
+ double theExtraFluff;
+public:
+ myIntAndStuff() : theValue(0), theExtraFluff(1.25) {}
+ myIntAndStuff(int _x) : theValue(_x), theExtraFluff(1.25) {}
+ int val() { return theValue; }
+};
+
class myArray {
public:
int array[16];
@@ -17,11 +27,13 @@ class hasAnInt {
};
myInt operator + (myInt x, myInt y) { return myInt(x.val() + y.val()); }
+myInt operator + (myInt x, myIntAndStuff y) { return myInt(x.val() + y.val()); }
int main() {
myInt x{3};
myInt y{4};
myInt z {x+y};
+ myIntAndStuff q {z.val()+1};
hasAnInt hi;
myArray ma;
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthval/myIntSynthProvider.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthval/myIntSynthProvider.py
index c8517a442932..82da6f9da928 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthval/myIntSynthProvider.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthval/myIntSynthProvider.py
@@ -1,22 +1,30 @@
class myIntSynthProvider(object):
- def __init__(self, valobj, dict):
- self.valobj = valobj;
- self.val = self.valobj.GetChildMemberWithName("theValue")
- def num_children(self):
- return 0;
- def get_child_at_index(self, index):
- return None
- def get_child_index(self, name):
- return None
- def update(self):
- return False
- def has_children(self):
- return False
- def get_value(self):
- return self.val
+
+ def __init__(self, valobj, dict):
+ self.valobj = valobj
+ self.val = self.valobj.GetChildMemberWithName("theValue")
+
+ def num_children(self):
+ return 0
+
+ def get_child_at_index(self, index):
+ return None
+
+ def get_child_index(self, name):
+ return None
+
+ def update(self):
+ return False
+
+ def has_children(self):
+ return False
+
+ def get_value(self):
+ return self.val
class myArraySynthProvider(object):
+
def __init__(self, valobj, dict):
self.valobj = valobj
self.array = self.valobj.GetChildMemberWithName("array")
@@ -27,10 +35,10 @@ class myArraySynthProvider(object):
return max_count
def get_child_at_index(self, index):
- return None # Keep it simple when this is not tested here.
+ return None # Keep it simple when this is not tested here.
def get_child_index(self, name):
- return None # Keep it simple when this is not tested here.
+ return None # Keep it simple when this is not tested here.
def has_children(self):
return True
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/dump_dynamic/TestDumpDynamic.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/dump_dynamic/TestDumpDynamic.py
index 886d09fda456..734e711fb7fc 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/dump_dynamic/TestDumpDynamic.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/dump_dynamic/TestDumpDynamic.py
@@ -2,4 +2,7 @@ from __future__ import absolute_import
from lldbsuite.test import lldbinline
-lldbinline.MakeInlineTest(__file__, globals(), [lldbinline.expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24663")])
+lldbinline.MakeInlineTest(
+ __file__, globals(), [
+ lldbinline.expectedFailureAll(
+ oslist=["windows"], bugnumber="llvm.org/pr24663")])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/format-propagation/TestFormatPropagation.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/format-propagation/TestFormatPropagation.py
index 5cb7c82c9e09..0c15c793e1fe 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/format-propagation/TestFormatPropagation.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/format-propagation/TestFormatPropagation.py
@@ -5,12 +5,13 @@ Check if changing Format on an SBValue correctly propagates that new format to c
from __future__ import print_function
-
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.lldbtest import *
import lldbsuite.test.lldbutil as lldbutil
+
class FormatPropagationTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@@ -27,14 +28,15 @@ class FormatPropagationTestCase(TestBase):
self.build()
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
self.runCmd("run", RUN_SUCCEEDED)
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
@@ -47,18 +49,24 @@ class FormatPropagationTestCase(TestBase):
# extract the parent and the children
frame = self.frame()
parent = self.frame().FindVariable("f")
- self.assertTrue(parent != None and parent.IsValid(),"could not find f")
+ self.assertTrue(
+ parent is not None and parent.IsValid(),
+ "could not find f")
X = parent.GetChildMemberWithName("X")
- self.assertTrue(X != None and X.IsValid(),"could not find X")
+ self.assertTrue(X is not None and X.IsValid(), "could not find X")
Y = parent.GetChildMemberWithName("Y")
- self.assertTrue(Y != None and Y.IsValid(),"could not find Y")
+ self.assertTrue(Y is not None and Y.IsValid(), "could not find Y")
# check their values now
self.assertTrue(X.GetValue() == "1", "X has an invalid value")
self.assertTrue(Y.GetValue() == "2", "Y has an invalid value")
# set the format on the parent
parent.SetFormat(lldb.eFormatHex)
- self.assertTrue(X.GetValue() == "0x00000001", "X has not changed format")
- self.assertTrue(Y.GetValue() == "0x00000002", "Y has not changed format")
+ self.assertTrue(
+ X.GetValue() == "0x00000001",
+ "X has not changed format")
+ self.assertTrue(
+ Y.GetValue() == "0x00000002",
+ "Y has not changed format")
# Step and check if the values make sense still
self.runCmd("next")
self.assertTrue(X.GetValue() == "0x00000004", "X has not become 4")
@@ -71,5 +79,7 @@ class FormatPropagationTestCase(TestBase):
parent.SetFormat(lldb.eFormatDefault)
X.SetFormat(lldb.eFormatHex)
Y.SetFormat(lldb.eFormatDefault)
- self.assertTrue(X.GetValue() == "0x00000004", "X is not hex as it asked")
+ self.assertTrue(
+ X.GetValue() == "0x00000004",
+ "X is not hex as it asked")
self.assertTrue(Y.GetValue() == "2", "Y is not defaulted")
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/frameformat_smallstruct/TestFrameFormatSmallStruct.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/frameformat_smallstruct/TestFrameFormatSmallStruct.py
index 555351998c2d..d6303fe8b73d 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/frameformat_smallstruct/TestFrameFormatSmallStruct.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/frameformat_smallstruct/TestFrameFormatSmallStruct.py
@@ -5,12 +5,13 @@ Test that the user can input a format but it will not prevail over summary forma
from __future__ import print_function
-
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.lldbtest import *
import lldbsuite.test.lldbutil as lldbutil
+
class FrameFormatSmallStructTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@@ -26,13 +27,14 @@ class FrameFormatSmallStructTestCase(TestBase):
self.build()
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
self.runCmd("run", RUN_SUCCEEDED)
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
- self.expect("thread list", substrs = ['addPair(p=(x = 3, y = -3))'])
+ self.expect("thread list", substrs=['addPair(p=(x = 3, y = -3))'])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/hexcaps/TestDataFormatterHexCaps.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/hexcaps/TestDataFormatterHexCaps.py
index 3c28b68056f5..32fbf48dcc68 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/hexcaps/TestDataFormatterHexCaps.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/hexcaps/TestDataFormatterHexCaps.py
@@ -5,12 +5,13 @@ Test lldb data formatter subsystem.
from __future__ import print_function
-
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.lldbtest import *
import lldbsuite.test.lldbutil as lldbutil
+
class DataFormatterHexCapsTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@@ -26,14 +27,15 @@ class DataFormatterHexCapsTestCase(TestBase):
self.build()
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
self.runCmd("run", RUN_SUCCEEDED)
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
@@ -45,38 +47,43 @@ class DataFormatterHexCapsTestCase(TestBase):
self.addTearDownHook(cleanup)
self.runCmd("type format add -f uppercase int")
-
+
self.expect('frame variable mine',
- substrs = ['mine = ',
- 'first = 0x001122AA', 'second = 0x1122BB44'])
+ substrs=['mine = ',
+ 'first = 0x001122AA', 'second = 0x1122BB44'])
self.runCmd("type format add -f hex int")
self.expect('frame variable mine',
- substrs = ['mine = ',
- 'first = 0x001122aa', 'second = 0x1122bb44'])
+ substrs=['mine = ',
+ 'first = 0x001122aa', 'second = 0x1122bb44'])
self.runCmd("type format delete int")
- self.runCmd("type summary add -s \"${var.first%X} and ${var.second%x}\" foo")
+ self.runCmd(
+ "type summary add -s \"${var.first%X} and ${var.second%x}\" foo")
self.expect('frame variable mine',
- substrs = ['(foo) mine = 0x001122AA and 0x1122bb44'])
+ substrs=['(foo) mine = 0x001122AA and 0x1122bb44'])
- self.runCmd("type summary add -s \"${var.first%X} and ${var.second%X}\" foo")
+ self.runCmd(
+ "type summary add -s \"${var.first%X} and ${var.second%X}\" foo")
self.runCmd("next")
self.runCmd("next")
self.expect('frame variable mine',
- substrs = ['(foo) mine = 0xAABBCCDD and 0x1122BB44'])
+ substrs=['(foo) mine = 0xAABBCCDD and 0x1122BB44'])
- self.runCmd("type summary add -s \"${var.first%x} and ${var.second%X}\" foo")
+ self.runCmd(
+ "type summary add -s \"${var.first%x} and ${var.second%X}\" foo")
self.expect('frame variable mine',
- substrs = ['(foo) mine = 0xaabbccdd and 0x1122BB44'])
+ substrs=['(foo) mine = 0xaabbccdd and 0x1122BB44'])
self.runCmd("next")
self.runCmd("next")
- self.runCmd("type summary add -s \"${var.first%x} and ${var.second%x}\" foo")
+ self.runCmd(
+ "type summary add -s \"${var.first%x} and ${var.second%x}\" foo")
self.expect('frame variable mine',
- substrs = ['(foo) mine = 0xaabbccdd and 0xff00ff00'])
- self.runCmd("type summary add -s \"${var.first%X} and ${var.second%X}\" foo")
+ substrs=['(foo) mine = 0xaabbccdd and 0xff00ff00'])
+ self.runCmd(
+ "type summary add -s \"${var.first%X} and ${var.second%X}\" foo")
self.expect('frame variable mine',
- substrs = ['(foo) mine = 0xAABBCCDD and 0xFF00FF00'])
+ substrs=['(foo) mine = 0xAABBCCDD and 0xFF00FF00'])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/language_category_updates/TestDataFormatterLanguageCategoryUpdates.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/language_category_updates/TestDataFormatterLanguageCategoryUpdates.py
index f30733d2d81a..b7f60cfac41d 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/language_category_updates/TestDataFormatterLanguageCategoryUpdates.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/language_category_updates/TestDataFormatterLanguageCategoryUpdates.py
@@ -5,12 +5,13 @@ Test lldb data formatter subsystem.
from __future__ import print_function
-
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.lldbtest import *
import lldbsuite.test.lldbutil as lldbutil
+
class LanguageCategoryUpdatesTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@@ -26,7 +27,11 @@ class LanguageCategoryUpdatesTestCase(TestBase):
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
def cleanup():
- if hasattr(self, 'type_category') and hasattr(self, 'type_specifier'):
+ if hasattr(
+ self,
+ 'type_category') and hasattr(
+ self,
+ 'type_specifier'):
self.type_category.DeleteTypeSummary(self.type_specifier)
# Execute the cleanup function during test case tear down.
@@ -35,25 +40,47 @@ class LanguageCategoryUpdatesTestCase(TestBase):
self.build()
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
self.runCmd("run", RUN_SUCCEEDED)
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
-
- self.expect("frame variable", substrs = ['(S)', 'object', '123', '456'], matching=True)
-
- self.type_category = self.dbg.GetCategory(lldb.eLanguageTypeC_plus_plus)
- type_summary = lldb.SBTypeSummary.CreateWithSummaryString("this is an object of type S")
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
+
+ self.expect(
+ "frame variable",
+ substrs=[
+ '(S)',
+ 'object',
+ '123',
+ '456'],
+ matching=True)
+
+ self.type_category = self.dbg.GetCategory(
+ lldb.eLanguageTypeC_plus_plus)
+ type_summary = lldb.SBTypeSummary.CreateWithSummaryString(
+ "this is an object of type S")
self.type_specifier = lldb.SBTypeNameSpecifier('S')
self.type_category.AddTypeSummary(self.type_specifier, type_summary)
- self.expect("frame variable", substrs = ['this is an object of type S'], matching=True)
-
- self.type_category.DeleteTypeSummary(self.type_specifier)
- self.expect("frame variable", substrs = ['this is an object of type S'], matching=False)
- self.expect("frame variable", substrs = ['(S)', 'object', '123', '456'], matching=True)
+ self.expect(
+ "frame variable",
+ substrs=['this is an object of type S'],
+ matching=True)
+ self.type_category.DeleteTypeSummary(self.type_specifier)
+ self.expect(
+ "frame variable",
+ substrs=['this is an object of type S'],
+ matching=False)
+ self.expect(
+ "frame variable",
+ substrs=[
+ '(S)',
+ 'object',
+ '123',
+ '456'],
+ matching=True)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/nsarraysynth/TestNSArraySynthetic.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/nsarraysynth/TestNSArraySynthetic.py
index 871cc19373a4..87fc2d1802b7 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/nsarraysynth/TestNSArraySynthetic.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/nsarraysynth/TestNSArraySynthetic.py
@@ -5,14 +5,15 @@ Test lldb data formatter subsystem.
from __future__ import print_function
-
import datetime
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+
class NSArraySyntheticTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@@ -29,14 +30,15 @@ class NSArraySyntheticTestCase(TestBase):
self.build()
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_file_and_line (self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
self.runCmd("run", RUN_SUCCEEDED)
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
@@ -50,19 +52,59 @@ class NSArraySyntheticTestCase(TestBase):
# Now check that we are displaying Cocoa classes correctly
self.expect('frame variable arr',
- substrs = ['@"6 elements"'])
+ substrs=['@"6 elements"'])
self.expect('frame variable other_arr',
- substrs = ['@"4 elements"'])
- self.expect('frame variable arr --ptr-depth 1',
- substrs = ['@"6 elements"','[0] = 0x','[1] = 0x','[2] = 0x','[3] = 0x','[4] = 0x','[5] = 0x'])
- self.expect('frame variable other_arr --ptr-depth 1',
- substrs = ['@"4 elements"','[0] = 0x','[1] = 0x','[2] = 0x','[3] = 0x'])
- self.expect('frame variable arr --ptr-depth 1 -d no-run-target',
- substrs = ['@"6 elements"','@"hello"','@"world"','@"this"','@"is"','@"me"','@"http://www.apple.com'])
- self.expect('frame variable other_arr --ptr-depth 1 -d no-run-target',
- substrs = ['@"4 elements"','(int)5','@"a string"','@"6 elements"'])
- self.expect('frame variable other_arr --ptr-depth 2 -d no-run-target',
- substrs = ['@"4 elements"','@"6 elements" {','@"hello"','@"world"','@"this"','@"is"','@"me"','@"http://www.apple.com'])
+ substrs=['@"4 elements"'])
+ self.expect(
+ 'frame variable arr --ptr-depth 1',
+ substrs=[
+ '@"6 elements"',
+ '[0] = 0x',
+ '[1] = 0x',
+ '[2] = 0x',
+ '[3] = 0x',
+ '[4] = 0x',
+ '[5] = 0x'])
+ self.expect(
+ 'frame variable other_arr --ptr-depth 1',
+ substrs=[
+ '@"4 elements"',
+ '[0] = 0x',
+ '[1] = 0x',
+ '[2] = 0x',
+ '[3] = 0x'])
+ self.expect(
+ 'frame variable arr --ptr-depth 1 -d no-run-target',
+ substrs=[
+ '@"6 elements"',
+ '@"hello"',
+ '@"world"',
+ '@"this"',
+ '@"is"',
+ '@"me"',
+ '@"http://www.apple.com'])
+ self.expect(
+ 'frame variable other_arr --ptr-depth 1 -d no-run-target',
+ substrs=[
+ '@"4 elements"',
+ '(int)5',
+ '@"a string"',
+ '@"6 elements"'])
+ self.expect(
+ 'frame variable other_arr --ptr-depth 2 -d no-run-target',
+ substrs=[
+ '@"4 elements"',
+ '@"6 elements" {',
+ '@"hello"',
+ '@"world"',
+ '@"this"',
+ '@"is"',
+ '@"me"',
+ '@"http://www.apple.com'])
- self.assertTrue(self.frame().FindVariable("arr").MightHaveChildren(), "arr says it does not have children!")
- self.assertTrue(self.frame().FindVariable("other_arr").MightHaveChildren(), "arr says it does not have children!")
+ self.assertTrue(
+ self.frame().FindVariable("arr").MightHaveChildren(),
+ "arr says it does not have children!")
+ self.assertTrue(
+ self.frame().FindVariable("other_arr").MightHaveChildren(),
+ "arr says it does not have children!")
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/nsdictionarysynth/TestNSDictionarySynthetic.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/nsdictionarysynth/TestNSDictionarySynthetic.py
index 5ee54c3a2952..85675d211235 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/nsdictionarysynth/TestNSDictionarySynthetic.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/nsdictionarysynth/TestNSDictionarySynthetic.py
@@ -5,14 +5,15 @@ Test lldb data formatter subsystem.
from __future__ import print_function
-
import datetime
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+
class NSDictionarySyntheticTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@@ -29,14 +30,15 @@ class NSDictionarySyntheticTestCase(TestBase):
self.build()
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_file_and_line (self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
self.runCmd("run", RUN_SUCCEEDED)
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
@@ -50,21 +52,73 @@ class NSDictionarySyntheticTestCase(TestBase):
# Now check that we are displaying Cocoa classes correctly
self.expect('frame variable dictionary',
- substrs = ['3 key/value pairs'])
+ substrs=['3 key/value pairs'])
self.expect('frame variable mutabledict',
- substrs = ['4 key/value pairs'])
- self.expect('frame variable dictionary --ptr-depth 1',
- substrs = ['3 key/value pairs','[0] = ','key = 0x','value = 0x','[1] = ','[2] = '])
- self.expect('frame variable mutabledict --ptr-depth 1',
- substrs = ['4 key/value pairs','[0] = ','key = 0x','value = 0x','[1] = ','[2] = ','[3] = '])
- self.expect('frame variable dictionary --ptr-depth 1 --dynamic-type no-run-target',
- substrs = ['3 key/value pairs','@"bar"','@"2 elements"','@"baz"','2 key/value pairs'])
- self.expect('frame variable mutabledict --ptr-depth 1 --dynamic-type no-run-target',
- substrs = ['4 key/value pairs','(int)23','@"123"','@"http://www.apple.com"','@"sourceofstuff"','3 key/value pairs'])
- self.expect('frame variable mutabledict --ptr-depth 2 --dynamic-type no-run-target',
- substrs = ['4 key/value pairs','(int)23','@"123"','@"http://www.apple.com"','@"sourceofstuff"','3 key/value pairs','@"bar"','@"2 elements"'])
- self.expect('frame variable mutabledict --ptr-depth 3 --dynamic-type no-run-target',
- substrs = ['4 key/value pairs','(int)23','@"123"','@"http://www.apple.com"','@"sourceofstuff"','3 key/value pairs','@"bar"','@"2 elements"','(int)1','@"two"'])
+ substrs=['4 key/value pairs'])
+ self.expect(
+ 'frame variable dictionary --ptr-depth 1',
+ substrs=[
+ '3 key/value pairs',
+ '[0] = ',
+ 'key = 0x',
+ 'value = 0x',
+ '[1] = ',
+ '[2] = '])
+ self.expect(
+ 'frame variable mutabledict --ptr-depth 1',
+ substrs=[
+ '4 key/value pairs',
+ '[0] = ',
+ 'key = 0x',
+ 'value = 0x',
+ '[1] = ',
+ '[2] = ',
+ '[3] = '])
+ self.expect(
+ 'frame variable dictionary --ptr-depth 1 --dynamic-type no-run-target',
+ substrs=[
+ '3 key/value pairs',
+ '@"bar"',
+ '@"2 elements"',
+ '@"baz"',
+ '2 key/value pairs'])
+ self.expect(
+ 'frame variable mutabledict --ptr-depth 1 --dynamic-type no-run-target',
+ substrs=[
+ '4 key/value pairs',
+ '(int)23',
+ '@"123"',
+ '@"http://www.apple.com"',
+ '@"sourceofstuff"',
+ '3 key/value pairs'])
+ self.expect(
+ 'frame variable mutabledict --ptr-depth 2 --dynamic-type no-run-target',
+ substrs=[
+ '4 key/value pairs',
+ '(int)23',
+ '@"123"',
+ '@"http://www.apple.com"',
+ '@"sourceofstuff"',
+ '3 key/value pairs',
+ '@"bar"',
+ '@"2 elements"'])
+ self.expect(
+ 'frame variable mutabledict --ptr-depth 3 --dynamic-type no-run-target',
+ substrs=[
+ '4 key/value pairs',
+ '(int)23',
+ '@"123"',
+ '@"http://www.apple.com"',
+ '@"sourceofstuff"',
+ '3 key/value pairs',
+ '@"bar"',
+ '@"2 elements"',
+ '(int)1',
+ '@"two"'])
- self.assertTrue(self.frame().FindVariable("dictionary").MightHaveChildren(), "dictionary says it does not have children!")
- self.assertTrue(self.frame().FindVariable("mutabledict").MightHaveChildren(), "mutable says it does not have children!")
+ self.assertTrue(
+ self.frame().FindVariable("dictionary").MightHaveChildren(),
+ "dictionary says it does not have children!")
+ self.assertTrue(
+ self.frame().FindVariable("mutabledict").MightHaveChildren(),
+ "mutable says it does not have children!")
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/nssetsynth/TestNSSetSynthetic.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/nssetsynth/TestNSSetSynthetic.py
index d1680434d3b9..6affc5a71faf 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/nssetsynth/TestNSSetSynthetic.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/nssetsynth/TestNSSetSynthetic.py
@@ -5,14 +5,15 @@ Test lldb data formatter subsystem.
from __future__ import print_function
-
import datetime
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+
class NSSetSyntheticTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@@ -29,14 +30,15 @@ class NSSetSyntheticTestCase(TestBase):
self.build()
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_file_and_line (self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
self.runCmd("run", RUN_SUCCEEDED)
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
@@ -50,26 +52,64 @@ class NSSetSyntheticTestCase(TestBase):
# Now check that we are displaying Cocoa classes correctly
self.expect('frame variable set',
- substrs = ['4 elements'])
+ substrs=['4 elements'])
self.expect('frame variable mutable',
- substrs = ['9 elements'])
- self.expect('frame variable set --ptr-depth 1 -d run -T',
- substrs = ['4 elements','[0]','[1]','[2]','[3]','hello','world','(int)1','(int)2'])
- self.expect('frame variable mutable --ptr-depth 1 -d run -T',
- substrs = ['9 elements','(int)5','@"3 elements"','@"www.apple.com"','(int)3','@"world"','(int)4'])
+ substrs=['9 elements'])
+ self.expect(
+ 'frame variable set --ptr-depth 1 -d run -T',
+ substrs=[
+ '4 elements',
+ '[0]',
+ '[1]',
+ '[2]',
+ '[3]',
+ 'hello',
+ 'world',
+ '(int)1',
+ '(int)2'])
+ self.expect(
+ 'frame variable mutable --ptr-depth 1 -d run -T',
+ substrs=[
+ '9 elements',
+ '(int)5',
+ '@"3 elements"',
+ '@"www.apple.com"',
+ '(int)3',
+ '@"world"',
+ '(int)4'])
self.runCmd("next")
self.expect('frame variable mutable',
- substrs = ['0 elements'])
+ substrs=['0 elements'])
self.runCmd("next")
self.expect('frame variable mutable',
- substrs = ['4 elements'])
- self.expect('frame variable mutable --ptr-depth 1 -d run -T',
- substrs = ['4 elements','[0]','[1]','[2]','[3]','hello','world','(int)1','(int)2'])
+ substrs=['4 elements'])
+ self.expect(
+ 'frame variable mutable --ptr-depth 1 -d run -T',
+ substrs=[
+ '4 elements',
+ '[0]',
+ '[1]',
+ '[2]',
+ '[3]',
+ 'hello',
+ 'world',
+ '(int)1',
+ '(int)2'])
self.runCmd("next")
self.expect('frame variable mutable',
- substrs = ['4 elements'])
- self.expect('frame variable mutable --ptr-depth 1 -d run -T',
- substrs = ['4 elements','[0]','[1]','[2]','[3]','hello','world','(int)1','(int)2'])
+ substrs=['4 elements'])
+ self.expect(
+ 'frame variable mutable --ptr-depth 1 -d run -T',
+ substrs=[
+ '4 elements',
+ '[0]',
+ '[1]',
+ '[2]',
+ '[3]',
+ 'hello',
+ 'world',
+ '(int)1',
+ '(int)2'])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/ostypeformatting/TestFormattersOsType.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/ostypeformatting/TestFormattersOsType.py
index 4158ec8a661c..7ffddc5ec673 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/ostypeformatting/TestFormattersOsType.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/ostypeformatting/TestFormattersOsType.py
@@ -5,14 +5,15 @@ Test lldb data formatter subsystem.
from __future__ import print_function
-
import datetime
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+
class DataFormatterOSTypeTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@@ -29,14 +30,15 @@ class DataFormatterOSTypeTestCase(TestBase):
self.build()
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_file_and_line (self, "main.mm", self.line, num_expected_locations=1, loc_exact=True)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.mm", self.line, num_expected_locations=1, loc_exact=True)
self.runCmd("run", RUN_SUCCEEDED)
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
@@ -50,4 +52,4 @@ class DataFormatterOSTypeTestCase(TestBase):
# Now check that we use the right summary for OSType
self.expect('frame variable',
- substrs = ["'test'","'best'"])
+ substrs=["'test'", "'best'"])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/parray/TestPrintArray.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/parray/TestPrintArray.py
index 700b7418118a..49cda4ae6cc8 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/parray/TestPrintArray.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/parray/TestPrintArray.py
@@ -5,14 +5,15 @@ Test lldb data formatter subsystem.
from __future__ import print_function
-
import datetime
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+
class PrintArrayTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@@ -32,14 +33,15 @@ class PrintArrayTestCase(TestBase):
"""Test that expr -Z works"""
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
self.runCmd("run", RUN_SUCCEEDED)
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
@@ -50,21 +52,85 @@ class PrintArrayTestCase(TestBase):
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
-
- self.expect('expr --element-count 3 -- data', substrs=['[0] = 1', '[1] = 3', '[2] = 5'])
+
+ self.expect(
+ 'expr --element-count 3 -- data',
+ substrs=[
+ '[0] = 1',
+ '[1] = 3',
+ '[2] = 5'])
self.expect('expr data', substrs=['int *', '$', '0x'])
- self.expect('expr -f binary --element-count 0 -- data', substrs=['int *', '$', '0b'])
- self.expect('expr -f hex --element-count 3 -- data', substrs=['[0] = 0x', '1', '[1] = 0x', '3', '[2] = 0x', '5'])
- self.expect('expr -f binary --element-count 2 -- data', substrs=['int *', '$', '0x', '[0] = 0b', '1', '[1] = 0b', '11'])
+ self.expect(
+ 'expr -f binary --element-count 0 -- data',
+ substrs=[
+ 'int *',
+ '$',
+ '0b'])
+ self.expect(
+ 'expr -f hex --element-count 3 -- data',
+ substrs=[
+ '[0] = 0x',
+ '1',
+ '[1] = 0x',
+ '3',
+ '[2] = 0x',
+ '5'])
+ self.expect(
+ 'expr -f binary --element-count 2 -- data',
+ substrs=[
+ 'int *',
+ '$',
+ '0x',
+ '[0] = 0b',
+ '1',
+ '[1] = 0b',
+ '11'])
self.expect('parray 3 data', substrs=['[0] = 1', '[1] = 3', '[2] = 5'])
- self.expect('parray `1 + 1 + 1` data', substrs=['[0] = 1', '[1] = 3', '[2] = 5'])
- self.expect('parray `data[1]` data', substrs=['[0] = 1', '[1] = 3', '[2] = 5'])
- self.expect('parray/x 3 data', substrs=['[0] = 0x', '1', '[1] = 0x', '3', '[2] = 0x', '5'])
- self.expect('parray/x `data[1]` data', substrs=['[0] = 0x', '1', '[1] = 0x', '3', '[2] = 0x', '5'])
+ self.expect(
+ 'parray `1 + 1 + 1` data',
+ substrs=[
+ '[0] = 1',
+ '[1] = 3',
+ '[2] = 5'])
+ self.expect(
+ 'parray `data[1]` data',
+ substrs=[
+ '[0] = 1',
+ '[1] = 3',
+ '[2] = 5'])
+ self.expect(
+ 'parray/x 3 data',
+ substrs=[
+ '[0] = 0x',
+ '1',
+ '[1] = 0x',
+ '3',
+ '[2] = 0x',
+ '5'])
+ self.expect(
+ 'parray/x `data[1]` data',
+ substrs=[
+ '[0] = 0x',
+ '1',
+ '[1] = 0x',
+ '3',
+ '[2] = 0x',
+ '5'])
# check error conditions
- self.expect('expr --element-count 10 -- 123', error=True, substrs=['expression cannot be used with --element-count as it does not refer to a pointer'])
- self.expect('expr --element-count 10 -- (void*)123', error=True, substrs=['expression cannot be used with --element-count as it refers to a pointer to void'])
- self.expect('parray data', error=True, substrs=["invalid element count 'data'"])
- self.expect('parray data data', error=True, substrs=["invalid element count 'data'"])
- self.expect('parray', error=True, substrs=['Not enough arguments provided'])
+ self.expect(
+ 'expr --element-count 10 -- 123',
+ error=True,
+ substrs=['expression cannot be used with --element-count as it does not refer to a pointer'])
+ self.expect(
+ 'expr --element-count 10 -- (void*)123',
+ error=True,
+ substrs=['expression cannot be used with --element-count as it refers to a pointer to void'])
+ self.expect('parray data', error=True, substrs=[
+ "invalid element count 'data'"])
+ self.expect(
+ 'parray data data',
+ error=True,
+ substrs=["invalid element count 'data'"])
+ self.expect('parray', error=True, substrs=[
+ 'Not enough arguments provided'])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/poarray/TestPrintObjectArray.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/poarray/TestPrintObjectArray.py
index 7eb26a569867..83408e7b456e 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/poarray/TestPrintObjectArray.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/poarray/TestPrintObjectArray.py
@@ -5,14 +5,15 @@ Test lldb data formatter subsystem.
from __future__ import print_function
-
import datetime
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+
class PrintObjectArrayTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@@ -33,14 +34,15 @@ class PrintObjectArrayTestCase(TestBase):
"""Test that expr -O -Z works"""
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_file_and_line (self, "main.mm", self.line, num_expected_locations=1, loc_exact=True)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.mm", self.line, num_expected_locations=1, loc_exact=True)
self.runCmd("run", RUN_SUCCEEDED)
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
@@ -52,9 +54,59 @@ class PrintObjectArrayTestCase(TestBase):
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
- self.expect('expr --element-count 3 --object-description -- objects', substrs=['3735928559', '4276993775', '3203398366', 'Hello', 'World', 'Two =', '1 ='])
- self.expect('poarray 3 objects', substrs=['3735928559', '4276993775', '3203398366', 'Hello', 'World', 'Two =', '1 ='])
- self.expect('expr --element-count 3 --object-description --description-verbosity=full -- objects', substrs=['[0] =', '3735928559', '4276993775', '3203398366', '[1] =', 'Hello', 'World', '[2] =', 'Two =', '1 ='])
- self.expect('parray 3 objects', substrs=['[0] = 0x', '[1] = 0x', '[2] = 0x'])
- self.expect('expr --element-count 3 -d run -- objects', substrs=['3 elements', '2 elements', '2 key/value pairs'])
- self.expect('expr --element-count 3 -d run --ptr-depth=1 -- objects', substrs=['3 elements', '2 elements', '2 key/value pairs', '3735928559', '4276993775', '3203398366', '"Hello"', '"World"'])
+ self.expect(
+ 'expr --element-count 3 --object-description -- objects',
+ substrs=[
+ '3735928559',
+ '4276993775',
+ '3203398366',
+ 'Hello',
+ 'World',
+ 'Two =',
+ '1 ='])
+ self.expect(
+ 'poarray 3 objects',
+ substrs=[
+ '3735928559',
+ '4276993775',
+ '3203398366',
+ 'Hello',
+ 'World',
+ 'Two =',
+ '1 ='])
+ self.expect(
+ 'expr --element-count 3 --object-description --description-verbosity=full -- objects',
+ substrs=[
+ '[0] =',
+ '3735928559',
+ '4276993775',
+ '3203398366',
+ '[1] =',
+ 'Hello',
+ 'World',
+ '[2] =',
+ 'Two =',
+ '1 ='])
+ self.expect(
+ 'parray 3 objects',
+ substrs=[
+ '[0] = 0x',
+ '[1] = 0x',
+ '[2] = 0x'])
+ self.expect(
+ 'expr --element-count 3 -d run -- objects',
+ substrs=[
+ '3 elements',
+ '2 elements',
+ '2 key/value pairs'])
+ self.expect(
+ 'expr --element-count 3 -d run --ptr-depth=1 -- objects',
+ substrs=[
+ '3 elements',
+ '2 elements',
+ '2 key/value pairs',
+ '3735928559',
+ '4276993775',
+ '3203398366',
+ '"Hello"',
+ '"World"'])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/ptr_ref_typedef/TestPtrRef2Typedef.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/ptr_ref_typedef/TestPtrRef2Typedef.py
index bf98559cd0c1..69b9dd048871 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/ptr_ref_typedef/TestPtrRef2Typedef.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/ptr_ref_typedef/TestPtrRef2Typedef.py
@@ -5,12 +5,13 @@ Test lldb data formatter subsystem.
from __future__ import print_function
-
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.lldbtest import *
import lldbsuite.test.lldbutil as lldbutil
+
class PtrRef2TypedefTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@@ -20,20 +21,21 @@ class PtrRef2TypedefTestCase(TestBase):
TestBase.setUp(self)
# Find the line number to break at.
self.line = line_number('main.cpp', '// Set breakpoint here')
-
+
def test_with_run_command(self):
"""Test that a pointer/reference to a typedef is formatted as we want."""
self.build()
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
self.runCmd("run", RUN_SUCCEEDED)
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
@@ -48,10 +50,18 @@ class PtrRef2TypedefTestCase(TestBase):
self.runCmd('type summary add --cascade true -s "IntLRef" "int &"')
self.runCmd('type summary add --cascade true -s "IntRRef" "int &&"')
- self.expect("frame variable x", substrs = ['(Foo *) x = 0x','IntPointer'])
+ self.expect(
+ "frame variable x",
+ substrs=[
+ '(Foo *) x = 0x',
+ 'IntPointer'])
# note: Ubuntu 12.04 x86_64 build with gcc 4.8.2 is getting a
# const after the ref that isn't showing up on FreeBSD. This
# tweak changes the behavior so that the const is not part of
# the match.
- self.expect("frame variable y", substrs = ['(Foo &', ') y = 0x','IntLRef'])
- self.expect("frame variable z", substrs = ['(Foo &&', ') z = 0x','IntRRef'])
+ self.expect(
+ "frame variable y", substrs=[
+ '(Foo &', ') y = 0x', 'IntLRef'])
+ self.expect(
+ "frame variable z", substrs=[
+ '(Foo &&', ') z = 0x', 'IntRRef'])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/pyobjsynthprovider/Makefile b/packages/Python/lldbsuite/test/functionalities/data-formatter/pyobjsynthprovider/Makefile
new file mode 100644
index 000000000000..314f1cb2f077
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/pyobjsynthprovider/Makefile
@@ -0,0 +1,5 @@
+LEVEL = ../../../make
+
+CXX_SOURCES := main.cpp
+
+include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/pyobjsynthprovider/TestPyObjSynthProvider.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/pyobjsynthprovider/TestPyObjSynthProvider.py
new file mode 100644
index 000000000000..01271b443d17
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/pyobjsynthprovider/TestPyObjSynthProvider.py
@@ -0,0 +1,73 @@
+"""
+Test lldb data formatter subsystem.
+"""
+
+from __future__ import print_function
+
+
+import datetime
+import os
+import time
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class PyObjectSynthProviderTestCase(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+ NO_DEBUG_INFO_TESTCASE = True
+
+ @expectedFailureAll(oslist=["windows"])
+ def test_print_array(self):
+ """Test that expr -Z works"""
+ self.build()
+ self.provider_data_formatter_commands()
+
+ def setUp(self):
+ # Call super's setUp().
+ TestBase.setUp(self)
+ # Find the line number to break at.
+ self.line = line_number('main.cpp', 'break here')
+
+ def provider_data_formatter_commands(self):
+ """Test that the PythonObjectSyntheticChildProvider helper class works"""
+ self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
+
+ self.runCmd("run", RUN_SUCCEEDED)
+
+ # The stop reason of the thread should be breakpoint.
+ self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
+
+ # This is the function to remove the custom formats in order to have a
+ # clean slate for the next test case.
+ def cleanup():
+ self.runCmd('type format clear', check=False)
+ self.runCmd('type summary clear', check=False)
+ self.runCmd('type synth clear', check=False)
+
+ # Execute the cleanup function during test case tear down.
+ self.addTearDownHook(cleanup)
+
+ self.runCmd('command script import provider.py')
+ self.runCmd(
+ 'type synthetic add Foo --python-class provider.SyntheticChildrenProvider')
+ self.expect('frame variable f.Name', substrs=['"Enrico"'])
+ self.expect(
+ 'frame variable f',
+ substrs=[
+ 'ID = 123456',
+ 'Name = "Enrico"',
+ 'Rate = 1.25'])
+ self.expect(
+ 'expression f',
+ substrs=[
+ 'ID = 123456',
+ 'Name = "Enrico"',
+ 'Rate = 1.25'])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/pyobjsynthprovider/main.cpp b/packages/Python/lldbsuite/test/functionalities/data-formatter/pyobjsynthprovider/main.cpp
new file mode 100644
index 000000000000..6745366fb121
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/pyobjsynthprovider/main.cpp
@@ -0,0 +1,20 @@
+//===-- main.cpp -------------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+struct Foo
+{
+ double x;
+ int y;
+ Foo() : x(3.1415), y(1234) {}
+};
+
+int main() {
+ Foo f;
+ return 0; // break here
+}
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/pyobjsynthprovider/provider.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/pyobjsynthprovider/provider.py
new file mode 100644
index 000000000000..c263190c1028
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/pyobjsynthprovider/provider.py
@@ -0,0 +1,16 @@
+import lldb
+import lldb.formatters
+import lldb.formatters.synth
+
+
+class SyntheticChildrenProvider(
+ lldb.formatters.synth.PythonObjectSyntheticChildProvider):
+
+ def __init__(self, value, internal_dict):
+ lldb.formatters.synth.PythonObjectSyntheticChildProvider.__init__(
+ self, value, internal_dict)
+
+ def make_children(self):
+ return [("ID", 123456),
+ ("Name", "Enrico"),
+ ("Rate", 1.25)]
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/refpointer-recursion/TestDataFormatterRefPtrRecursion.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/refpointer-recursion/TestDataFormatterRefPtrRecursion.py
index 13b84e9f74c7..0a039107d842 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/refpointer-recursion/TestDataFormatterRefPtrRecursion.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/refpointer-recursion/TestDataFormatterRefPtrRecursion.py
@@ -5,12 +5,13 @@ Test that ValueObjectPrinter does not cause an infinite loop when a reference to
from __future__ import print_function
-
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.lldbtest import *
import lldbsuite.test.lldbutil as lldbutil
+
class DataFormatterRefPtrRecursionTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@@ -26,16 +27,17 @@ class DataFormatterRefPtrRecursionTestCase(TestBase):
self.build()
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
self.runCmd("run", RUN_SUCCEEDED)
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
- self.expect("frame variable foo", substrs = []);
- self.expect("frame variable foo --ptr-depth=1", substrs = ['ID = 1']);
- self.expect("frame variable foo --ptr-depth=2", substrs = ['ID = 1']);
- self.expect("frame variable foo --ptr-depth=3", substrs = ['ID = 1']);
+ self.expect("frame variable foo", substrs=[])
+ self.expect("frame variable foo --ptr-depth=1", substrs=['ID = 1'])
+ self.expect("frame variable foo --ptr-depth=2", substrs=['ID = 1'])
+ self.expect("frame variable foo --ptr-depth=3", substrs=['ID = 1'])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/setvaluefromcstring/TestSetValueFromCString.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/setvaluefromcstring/TestSetValueFromCString.py
index 791ce27dad00..804905106dfc 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/setvaluefromcstring/TestSetValueFromCString.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/setvaluefromcstring/TestSetValueFromCString.py
@@ -1,4 +1,6 @@
from lldbsuite.test import lldbinline
from lldbsuite.test import decorators
-lldbinline.MakeInlineTest(__file__, globals(), [decorators.skipIfFreeBSD,decorators.skipIfLinux,decorators.skipIfWindows])
+lldbinline.MakeInlineTest(
+ __file__, globals(), [
+ decorators.skipIfFreeBSD, decorators.skipIfLinux, decorators.skipIfWindows])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/stringprinter/TestStringPrinter.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/stringprinter/TestStringPrinter.py
index e26344f2711a..c76b421a1ea8 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/stringprinter/TestStringPrinter.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/stringprinter/TestStringPrinter.py
@@ -1,4 +1,7 @@
from lldbsuite.test import lldbinline
from lldbsuite.test import decorators
-lldbinline.MakeInlineTest(__file__, globals(), [decorators.expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24772")])
+lldbinline.MakeInlineTest(
+ __file__, globals(), [
+ decorators.expectedFailureAll(
+ oslist=["windows"], bugnumber="llvm.org/pr24772")])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/summary-string-onfail/Test-rdar-9974002.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/summary-string-onfail/Test-rdar-9974002.py
index 2873e35368fb..d7862d2327cf 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/summary-string-onfail/Test-rdar-9974002.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/summary-string-onfail/Test-rdar-9974002.py
@@ -5,12 +5,13 @@ Test lldb data formatter subsystem.
from __future__ import print_function
-
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.lldbtest import *
import lldbsuite.test.lldbutil as lldbutil
+
class Radar9974002DataFormatterTestCase(TestBase):
# test for rdar://problem/9974002 ()
@@ -26,18 +27,20 @@ class Radar9974002DataFormatterTestCase(TestBase):
"""Test that that file and class static variables display correctly."""
self.build()
if "clang" in self.getCompiler() and "3.4" in self.getCompilerVersion():
- self.skipTest("llvm.org/pr16214 -- clang emits partial DWARF for structures referenced via typedef")
+ self.skipTest(
+ "llvm.org/pr16214 -- clang emits partial DWARF for structures referenced via typedef")
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
self.runCmd("run", RUN_SUCCEEDED)
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
@@ -47,87 +50,98 @@ class Radar9974002DataFormatterTestCase(TestBase):
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
- self.runCmd("type summary add -s \"${var.scalar} and ${var.pointer.first}\" container")
-
+ self.runCmd(
+ "type summary add -s \"${var.scalar} and ${var.pointer.first}\" container")
+
self.expect('frame variable mine',
- substrs = ['mine = ',
- '1', '<parent is NULL>'])
+ substrs=['mine = ',
+ '1', '<parent is NULL>'])
- self.runCmd("type summary add -s \"${var.scalar} and ${var.pointer}\" container")
+ self.runCmd(
+ "type summary add -s \"${var.scalar} and ${var.pointer}\" container")
self.expect('frame variable mine',
- substrs = ['mine = ',
- '1', '0x000000'])
+ substrs=['mine = ',
+ '1', '0x000000'])
- self.runCmd("type summary add -s \"${var.scalar} and ${var.pointer%S}\" container")
+ self.runCmd(
+ "type summary add -s \"${var.scalar} and ${var.pointer%S}\" container")
self.expect('frame variable mine',
- substrs = ['mine = ',
- '1', '0x000000'])
+ substrs=['mine = ',
+ '1', '0x000000'])
self.runCmd("type summary add -s foo contained")
self.expect('frame variable mine',
- substrs = ['mine = ',
- '1', 'foo'])
+ substrs=['mine = ',
+ '1', 'foo'])
- self.runCmd("type summary add -s \"${var.scalar} and ${var.pointer}\" container")
+ self.runCmd(
+ "type summary add -s \"${var.scalar} and ${var.pointer}\" container")
self.expect('frame variable mine',
- substrs = ['mine = ',
- '1', 'foo'])
+ substrs=['mine = ',
+ '1', 'foo'])
- self.runCmd("type summary add -s \"${var.scalar} and ${var.pointer%V}\" container")
+ self.runCmd(
+ "type summary add -s \"${var.scalar} and ${var.pointer%V}\" container")
self.expect('frame variable mine',
- substrs = ['mine = ',
- '1', '0x000000'])
+ substrs=['mine = ',
+ '1', '0x000000'])
- self.runCmd("type summary add -s \"${var.scalar} and ${var.pointer.first}\" container")
+ self.runCmd(
+ "type summary add -s \"${var.scalar} and ${var.pointer.first}\" container")
self.expect('frame variable mine',
- substrs = ['mine = ',
- '1', '<parent is NULL>'])
+ substrs=['mine = ',
+ '1', '<parent is NULL>'])
self.runCmd("type summary delete contained")
self.runCmd("n")
self.expect('frame variable mine',
- substrs = ['mine = ',
- '1', '<parent is NULL>'])
+ substrs=['mine = ',
+ '1', '<parent is NULL>'])
- self.runCmd("type summary add -s \"${var.scalar} and ${var.pointer}\" container")
+ self.runCmd(
+ "type summary add -s \"${var.scalar} and ${var.pointer}\" container")
self.expect('frame variable mine',
- substrs = ['mine = ',
- '1', '0x000000'])
+ substrs=['mine = ',
+ '1', '0x000000'])
- self.runCmd("type summary add -s \"${var.scalar} and ${var.pointer%S}\" container")
+ self.runCmd(
+ "type summary add -s \"${var.scalar} and ${var.pointer%S}\" container")
self.expect('frame variable mine',
- substrs = ['mine = ',
- '1', '0x000000'])
+ substrs=['mine = ',
+ '1', '0x000000'])
self.runCmd("type summary add -s foo contained")
self.expect('frame variable mine',
- substrs = ['mine = ',
- '1', 'foo'])
+ substrs=['mine = ',
+ '1', 'foo'])
- self.runCmd("type summary add -s \"${var.scalar} and ${var.pointer}\" container")
+ self.runCmd(
+ "type summary add -s \"${var.scalar} and ${var.pointer}\" container")
self.expect('frame variable mine',
- substrs = ['mine = ',
- '1', 'foo'])
+ substrs=['mine = ',
+ '1', 'foo'])
- self.runCmd("type summary add -s \"${var.scalar} and ${var.pointer%V}\" container")
+ self.runCmd(
+ "type summary add -s \"${var.scalar} and ${var.pointer%V}\" container")
self.expect('frame variable mine',
- substrs = ['mine = ',
- '1', '0x000000'])
+ substrs=['mine = ',
+ '1', '0x000000'])
- self.runCmd("type summary add -s \"${var.scalar} and ${var.pointer.first}\" container")
+ self.runCmd(
+ "type summary add -s \"${var.scalar} and ${var.pointer.first}\" container")
self.expect('frame variable mine',
- substrs = ['mine = ',
- '1', '<parent is NULL>'])
+ substrs=['mine = ',
+ '1', '<parent is NULL>'])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py
index e8b6c1ad95f5..6d519761b7bb 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py
@@ -5,13 +5,14 @@ Check for an issue where capping does not work because the Target pointer appear
from __future__ import print_function
-
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+
class SyntheticCappingTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@@ -27,7 +28,8 @@ class SyntheticCappingTestCase(TestBase):
self.build()
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
self.runCmd("run", RUN_SUCCEEDED)
@@ -35,8 +37,8 @@ class SyntheticCappingTestCase(TestBase):
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
@@ -45,7 +47,9 @@ class SyntheticCappingTestCase(TestBase):
self.runCmd('type summary clear', check=False)
self.runCmd('type filter clear', check=False)
self.runCmd('type synth clear', check=False)
- self.runCmd("settings set target.max-children-count 256", check=False)
+ self.runCmd(
+ "settings set target.max-children-count 256",
+ check=False)
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
@@ -60,25 +64,25 @@ class SyntheticCappingTestCase(TestBase):
else:
fake_a_val = 0x00000100
- # check that the synthetic children work, so we know we are doing the right thing
+ # check that the synthetic children work, so we know we are doing the
+ # right thing
self.expect("frame variable f00_1",
- substrs = ['r = 34',
- 'fake_a = %d' % fake_a_val,
- 'a = 1']);
+ substrs=['r = 34',
+ 'fake_a = %d' % fake_a_val,
+ 'a = 1'])
# check that capping works
self.runCmd("settings set target.max-children-count 2", check=False)
-
+
self.expect("frame variable f00_1",
- substrs = ['...',
- 'fake_a = %d' % fake_a_val,
- 'a = 1']);
-
+ substrs=['...',
+ 'fake_a = %d' % fake_a_val,
+ 'a = 1'])
+
self.expect("frame variable f00_1", matching=False,
- substrs = ['r = 34']);
+ substrs=['r = 34'])
-
self.runCmd("settings set target.max-children-count 256", check=False)
self.expect("frame variable f00_1", matching=True,
- substrs = ['r = 34']);
+ substrs=['r = 34'])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/fooSynthProvider.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/fooSynthProvider.py
index 1a7e5679c0b8..124eb5d31bac 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/fooSynthProvider.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/fooSynthProvider.py
@@ -1,21 +1,27 @@
import lldb
+
+
class fooSynthProvider:
+
def __init__(self, valobj, dict):
- self.valobj = valobj;
+ self.valobj = valobj
self.int_type = valobj.GetType().GetBasicType(lldb.eBasicTypeInt)
+
def num_children(self):
- return 3;
+ return 3
+
def get_child_at_index(self, index):
if index == 0:
- child = self.valobj.GetChildMemberWithName('a');
+ child = self.valobj.GetChildMemberWithName('a')
if index == 1:
- child = self.valobj.CreateChildAtOffset ('fake_a', 1, self.int_type);
+ child = self.valobj.CreateChildAtOffset('fake_a', 1, self.int_type)
if index == 2:
- child = self.valobj.GetChildMemberWithName('r');
- return child;
+ child = self.valobj.GetChildMemberWithName('r')
+ return child
+
def get_child_index(self, name):
if name == 'a':
- return 0;
+ return 0
if name == 'fake_a':
- return 1;
- return 2;
+ return 1
+ return 2
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/synthupdate/TestSyntheticFilterRecompute.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/synthupdate/TestSyntheticFilterRecompute.py
index 23a31da685de..29c1214564d8 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/synthupdate/TestSyntheticFilterRecompute.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/synthupdate/TestSyntheticFilterRecompute.py
@@ -5,14 +5,15 @@ Test lldb data formatter subsystem.
from __future__ import print_function
-
import datetime
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+
class SyntheticFilterRecomputingTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@@ -29,14 +30,15 @@ class SyntheticFilterRecomputingTestCase(TestBase):
self.build()
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_file_and_line (self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
self.runCmd("run", RUN_SUCCEEDED)
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
@@ -49,27 +51,37 @@ class SyntheticFilterRecomputingTestCase(TestBase):
self.addTearDownHook(cleanup)
# Now run the bulk of the test
- id_x = self.dbg.GetSelectedTarget().GetProcess().GetSelectedThread().GetSelectedFrame().FindVariable("x")
+ id_x = self.dbg.GetSelectedTarget().GetProcess(
+ ).GetSelectedThread().GetSelectedFrame().FindVariable("x")
id_x.SetPreferDynamicValue(lldb.eDynamicCanRunTarget)
id_x.SetPreferSyntheticValue(True)
-
+
if self.TraceOn():
self.runCmd("expr --dynamic-type run-target --ptr-depth 1 -- x")
- self.assertTrue(id_x.GetSummary() == '@"5 elements"', "array does not get correct summary")
+ self.assertTrue(
+ id_x.GetSummary() == '@"5 elements"',
+ "array does not get correct summary")
self.runCmd("next")
self.runCmd("frame select 0")
- id_x = self.dbg.GetSelectedTarget().GetProcess().GetSelectedThread().GetSelectedFrame().FindVariable("x")
+ id_x = self.dbg.GetSelectedTarget().GetProcess(
+ ).GetSelectedThread().GetSelectedFrame().FindVariable("x")
id_x.SetPreferDynamicValue(lldb.eDynamicCanRunTarget)
id_x.SetPreferSyntheticValue(True)
if self.TraceOn():
self.runCmd("expr --dynamic-type run-target --ptr-depth 1 -- x")
- self.assertTrue(id_x.GetNumChildren() == 7, "dictionary does not have 7 children")
+ self.assertTrue(
+ id_x.GetNumChildren() == 7,
+ "dictionary does not have 7 children")
id_x.SetPreferSyntheticValue(False)
- self.assertFalse(id_x.GetNumChildren() == 7, "dictionary still looks synthetic")
+ self.assertFalse(
+ id_x.GetNumChildren() == 7,
+ "dictionary still looks synthetic")
id_x.SetPreferSyntheticValue(True)
- self.assertTrue(id_x.GetSummary() == "7 key/value pairs", "dictionary does not get correct summary")
+ self.assertTrue(
+ id_x.GetSummary() == "7 key/value pairs",
+ "dictionary does not get correct summary")
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_arg/TestTypeSummaryListArg.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_arg/TestTypeSummaryListArg.py
index 6568056f761b..1cc2a0e431ad 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_arg/TestTypeSummaryListArg.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_arg/TestTypeSummaryListArg.py
@@ -5,13 +5,14 @@ Test lldb data formatter subsystem.
from __future__ import print_function
-
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+
class TypeSummaryListArgumentTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@@ -23,9 +24,28 @@ class TypeSummaryListArgumentTestCase(TestBase):
@no_debug_info_test
def test_type_summary_list_with_arg(self):
"""Test that the 'type summary list' command handles command line arguments properly"""
- self.expect('type summary list Foo', substrs=['Category: default', 'Category: system'])
- self.expect('type summary list char', substrs=['char *', 'unsigned char'])
-
- self.expect('type summary list -w default', substrs=['system'], matching=False)
- self.expect('type summary list -w system unsigned', substrs=['default', '0-9'], matching=False)
- self.expect('type summary list -w system char', substrs=['unsigned char *'], matching=True)
+ self.expect(
+ 'type summary list Foo',
+ substrs=[
+ 'Category: default',
+ 'Category: system'])
+ self.expect(
+ 'type summary list char',
+ substrs=[
+ 'char *',
+ 'unsigned char'])
+
+ self.expect(
+ 'type summary list -w default',
+ substrs=['system'],
+ matching=False)
+ self.expect(
+ 'type summary list -w system unsigned',
+ substrs=[
+ 'default',
+ '0-9'],
+ matching=False)
+ self.expect(
+ 'type summary list -w system char',
+ substrs=['unsigned char *'],
+ matching=True)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_script/TestTypeSummaryListScript.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_script/TestTypeSummaryListScript.py
index 63a4a3a4ba8c..2e66b800b15e 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_script/TestTypeSummaryListScript.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_script/TestTypeSummaryListScript.py
@@ -5,13 +5,14 @@ Test lldb data formatter subsystem.
from __future__ import print_function
-
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+
class TypeSummaryListScriptTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@@ -31,14 +32,15 @@ class TypeSummaryListScriptTestCase(TestBase):
"""Test printing out Python summary formatters."""
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
self.runCmd("run", RUN_SUCCEEDED)
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
@@ -53,9 +55,11 @@ class TypeSummaryListScriptTestCase(TestBase):
self.runCmd("command script import tslsformatters.py")
- self.expect("frame variable myStruct", substrs=['A data formatter at work'])
-
- self.expect('type summary list', substrs=['Struct_SummaryFormatter'])
- self.expect('type summary list Struct', substrs=['Struct_SummaryFormatter'])
-
+ self.expect(
+ "frame variable myStruct",
+ substrs=['A data formatter at work'])
+ self.expect('type summary list', substrs=['Struct_SummaryFormatter'])
+ self.expect(
+ 'type summary list Struct',
+ substrs=['Struct_SummaryFormatter'])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_script/tslsformatters.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_script/tslsformatters.py
index d1ce8b7db17a..03fe17bfe761 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_script/tslsformatters.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_script/tslsformatters.py
@@ -1,10 +1,12 @@
import lldb
+
def Struct_SummaryFormatter(valobj, internal_dict):
return 'A data formatter at work'
category = lldb.debugger.CreateCategory("TSLSFormatters")
category.SetEnabled(True)
-summary = lldb.SBTypeSummary.CreateWithFunctionName("tslsformatters.Struct_SummaryFormatter", lldb.eTypeOptionCascade)
+summary = lldb.SBTypeSummary.CreateWithFunctionName(
+ "tslsformatters.Struct_SummaryFormatter", lldb.eTypeOptionCascade)
spec = lldb.SBTypeNameSpecifier("Struct", False)
category.AddTypeSummary(spec, summary)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/typedef_array/TestTypedefArray.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/typedef_array/TestTypedefArray.py
index 41b8c3499ccd..7e67f73b7092 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/typedef_array/TestTypedefArray.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/typedef_array/TestTypedefArray.py
@@ -1,4 +1,7 @@
from lldbsuite.test import lldbinline
from lldbsuite.test import decorators
-lldbinline.MakeInlineTest(__file__, globals(), [decorators.expectedFailureAll(compiler="gcc")])
+lldbinline.MakeInlineTest(
+ __file__, globals(), [
+ decorators.expectedFailureAll(
+ compiler="gcc")])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/user-format-vs-summary/TestUserFormatVsSummary.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/user-format-vs-summary/TestUserFormatVsSummary.py
index dba2816d2647..d970d11a2bab 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/user-format-vs-summary/TestUserFormatVsSummary.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/user-format-vs-summary/TestUserFormatVsSummary.py
@@ -5,12 +5,13 @@ Test that the user can input a format but it will not prevail over summary forma
from __future__ import print_function
-
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.lldbtest import *
import lldbsuite.test.lldbutil as lldbutil
+
class UserFormatVSSummaryTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@@ -26,16 +27,18 @@ class UserFormatVSSummaryTestCase(TestBase):
self.build()
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
self.runCmd("run", RUN_SUCCEEDED)
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
- self.expect("frame variable p1", substrs = ['(Pair) p1 = (x = 3, y = -3)']);
+ self.expect("frame variable p1", substrs=[
+ '(Pair) p1 = (x = 3, y = -3)'])
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
@@ -48,12 +51,24 @@ class UserFormatVSSummaryTestCase(TestBase):
self.runCmd('type summary add Pair -s "x=${var.x%d},y=${var.y%u}"')
- self.expect("frame variable p1", substrs = ['(Pair) p1 = x=3,y=4294967293']);
- self.expect("frame variable -f x p1", substrs = ['(Pair) p1 = x=0x00000003,y=0xfffffffd'], matching=False);
- self.expect("frame variable -f d p1", substrs = ['(Pair) p1 = x=3,y=-3'], matching=False);
- self.expect("frame variable p1", substrs = ['(Pair) p1 = x=3,y=4294967293']);
+ self.expect("frame variable p1", substrs=[
+ '(Pair) p1 = x=3,y=4294967293'])
+ self.expect(
+ "frame variable -f x p1",
+ substrs=['(Pair) p1 = x=0x00000003,y=0xfffffffd'],
+ matching=False)
+ self.expect(
+ "frame variable -f d p1",
+ substrs=['(Pair) p1 = x=3,y=-3'],
+ matching=False)
+ self.expect("frame variable p1", substrs=[
+ '(Pair) p1 = x=3,y=4294967293'])
self.runCmd('type summary add Pair -s "x=${var.x%x},y=${var.y%u}"')
- self.expect("frame variable p1", substrs = ['(Pair) p1 = x=0x00000003,y=4294967293']);
- self.expect("frame variable -f d p1", substrs = ['(Pair) p1 = x=3,y=-3'],matching=False);
+ self.expect("frame variable p1", substrs=[
+ '(Pair) p1 = x=0x00000003,y=4294967293'])
+ self.expect(
+ "frame variable -f d p1",
+ substrs=['(Pair) p1 = x=3,y=-3'],
+ matching=False)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/var-in-aggregate-misuse/TestVarInAggregateMisuse.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/var-in-aggregate-misuse/TestVarInAggregateMisuse.py
index 5899469651d3..53073f6d910a 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/var-in-aggregate-misuse/TestVarInAggregateMisuse.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/var-in-aggregate-misuse/TestVarInAggregateMisuse.py
@@ -5,12 +5,13 @@ Test lldb data formatter subsystem.
from __future__ import print_function
-
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.lldbtest import *
import lldbsuite.test.lldbutil as lldbutil
+
class VarInAggregateMisuseTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@@ -26,14 +27,15 @@ class VarInAggregateMisuseTestCase(TestBase):
self.build()
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
self.runCmd("run", RUN_SUCCEEDED)
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
@@ -43,32 +45,36 @@ class VarInAggregateMisuseTestCase(TestBase):
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
- self.runCmd("type summary add --summary-string \"SUMMARY SUCCESS ${var}\" Summarize")
-
+ self.runCmd(
+ "type summary add --summary-string \"SUMMARY SUCCESS ${var}\" Summarize")
+
self.expect('frame variable mine_ptr',
- substrs = ['SUMMARY SUCCESS summarize_ptr_t @ '])
+ substrs=['SUMMARY SUCCESS summarize_ptr_t @ '])
self.expect('frame variable *mine_ptr',
- substrs = ['SUMMARY SUCCESS summarize_t @'])
+ substrs=['SUMMARY SUCCESS summarize_t @'])
- self.runCmd("type summary add --summary-string \"SUMMARY SUCCESS ${var.first}\" Summarize")
+ self.runCmd(
+ "type summary add --summary-string \"SUMMARY SUCCESS ${var.first}\" Summarize")
self.expect('frame variable mine_ptr',
- substrs = ['SUMMARY SUCCESS 10'])
+ substrs=['SUMMARY SUCCESS 10'])
self.expect('frame variable *mine_ptr',
- substrs = ['SUMMARY SUCCESS 10'])
+ substrs=['SUMMARY SUCCESS 10'])
self.runCmd("type summary add --summary-string \"${var}\" Summarize")
- self.runCmd("type summary add --summary-string \"${var}\" -e TwoSummarizes")
-
+ self.runCmd(
+ "type summary add --summary-string \"${var}\" -e TwoSummarizes")
+
self.expect('frame variable',
- substrs = ['(TwoSummarizes) twos = TwoSummarizes @ ',
- 'first = summarize_t @ ',
- 'second = summarize_t @ '])
-
- self.runCmd("type summary add --summary-string \"SUMMARY SUCCESS ${var.first}\" Summarize")
+ substrs=['(TwoSummarizes) twos = TwoSummarizes @ ',
+ 'first = summarize_t @ ',
+ 'second = summarize_t @ '])
+
+ self.runCmd(
+ "type summary add --summary-string \"SUMMARY SUCCESS ${var.first}\" Summarize")
self.expect('frame variable',
- substrs = ['(TwoSummarizes) twos = TwoSummarizes @ ',
- 'first = SUMMARY SUCCESS 1',
- 'second = SUMMARY SUCCESS 3'])
+ substrs=['(TwoSummarizes) twos = TwoSummarizes @ ',
+ 'first = SUMMARY SUCCESS 1',
+ 'second = SUMMARY SUCCESS 3'])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/varscript_formatting/TestDataFormatterVarScriptFormatting.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/varscript_formatting/TestDataFormatterVarScriptFormatting.py
index f3eced625898..cde0ef409621 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/varscript_formatting/TestDataFormatterVarScriptFormatting.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/varscript_formatting/TestDataFormatterVarScriptFormatting.py
@@ -5,14 +5,15 @@ Test lldb data formatter subsystem.
from __future__ import print_function
-
-import os, time
+import os
+import time
import os.path
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+
class PythonSynthDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@@ -23,20 +24,21 @@ class PythonSynthDataFormatterTestCase(TestBase):
# Find the line number to break at.
self.line = line_number('main.cpp', ' // Set breakpoint here.')
- @skipIfFreeBSD # llvm.org/pr20545 bogus output confuses buildbot parser
+ @skipIfFreeBSD # llvm.org/pr20545 bogus output confuses buildbot parser
def test_with_run_command(self):
"""Test using Python synthetic children provider."""
self.build()
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
self.runCmd("run", RUN_SUCCEEDED)
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
@@ -48,10 +50,11 @@ class PythonSynthDataFormatterTestCase(TestBase):
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
-
+
self.runCmd("command script import helperfunc.py")
- self.runCmd('type summary add -x "^something<.*>$" -s "T is a ${script.var:helperfunc.f}"')
+ self.runCmd(
+ 'type summary add -x "^something<.*>$" -s "T is a ${script.var:helperfunc.f}"')
+
+ self.expect("frame variable x", substrs=['T is a non-pointer type'])
- self.expect("frame variable x", substrs = ['T is a non-pointer type']);
-
- self.expect("frame variable y", substrs = ['T is a pointer type']);
+ self.expect("frame variable y", substrs=['T is a pointer type'])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/varscript_formatting/helperfunc.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/varscript_formatting/helperfunc.py
index 01562c5baa8d..75654e4b4ed7 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/varscript_formatting/helperfunc.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/varscript_formatting/helperfunc.py
@@ -1,5 +1,6 @@
import lldb
-def f(value,d):
- return "pointer type" if value.GetType().GetTemplateArgumentType(0).IsPointerType() else "non-pointer type"
+def f(value, d):
+ return "pointer type" if value.GetType().GetTemplateArgumentType(
+ 0).IsPointerType() else "non-pointer type"
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py
index 365ddff3c7e8..2d4cd5782fdd 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py
@@ -5,13 +5,14 @@ Check that vector types format properly
from __future__ import print_function
-
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+
class VectorTypesFormattingTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@@ -23,20 +24,21 @@ class VectorTypesFormattingTestCase(TestBase):
self.line = line_number('main.cpp', '// break here')
# rdar://problem/14035604
- @skipIf(compiler='gcc') # gcc don't have ext_vector_type extension
+ @skipIf(compiler='gcc') # gcc don't have ext_vector_type extension
def test_with_run_command(self):
"""Check that vector types format properly"""
self.build()
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
- lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
self.runCmd("run", RUN_SUCCEEDED)
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs = ['stopped',
- 'stop reason = breakpoint'])
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
@@ -46,29 +48,43 @@ class VectorTypesFormattingTestCase(TestBase):
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
- pass # my code never fails
-
+ pass # my code never fails
+
v = self.frame().FindVariable("v")
v.SetPreferSyntheticValue(True)
v.SetFormat(lldb.eFormatVectorOfFloat32)
-
- if self.TraceOn(): print(v)
-
- self.assertTrue(v.GetNumChildren() == 4, "v as float32[] has 4 children")
- self.assertTrue(v.GetChildAtIndex(0).GetData().float[0] == 1.25, "child 0 == 1.25")
- self.assertTrue(v.GetChildAtIndex(1).GetData().float[0] == 1.25, "child 1 == 1.25")
- self.assertTrue(v.GetChildAtIndex(2).GetData().float[0] == 2.50, "child 2 == 2.50")
- self.assertTrue(v.GetChildAtIndex(3).GetData().float[0] == 2.50, "child 3 == 2.50")
-
- self.expect("expr -f int16_t[] -- v", substrs=['(0, 16288, 0, 16288, 0, 16416, 0, 16416)'])
- self.expect("expr -f uint128_t[] -- v", substrs=['(85236745249553456609335044694184296448)'])
- self.expect("expr -f float32[] -- v", substrs=['(1.25, 1.25, 2.5, 2.5)'])
-
+
+ if self.TraceOn():
+ print(v)
+
+ self.assertTrue(
+ v.GetNumChildren() == 4,
+ "v as float32[] has 4 children")
+ self.assertTrue(v.GetChildAtIndex(0).GetData().float[
+ 0] == 1.25, "child 0 == 1.25")
+ self.assertTrue(v.GetChildAtIndex(1).GetData().float[
+ 0] == 1.25, "child 1 == 1.25")
+ self.assertTrue(v.GetChildAtIndex(2).GetData().float[
+ 0] == 2.50, "child 2 == 2.50")
+ self.assertTrue(v.GetChildAtIndex(3).GetData().float[
+ 0] == 2.50, "child 3 == 2.50")
+
+ self.expect("expr -f int16_t[] -- v",
+ substrs=['(0, 16288, 0, 16288, 0, 16416, 0, 16416)'])
+ self.expect("expr -f uint128_t[] -- v",
+ substrs=['(85236745249553456609335044694184296448)'])
+ self.expect(
+ "expr -f float32[] -- v",
+ substrs=['(1.25, 1.25, 2.5, 2.5)'])
+
oldValue = v.GetChildAtIndex(0).GetValue()
v.SetFormat(lldb.eFormatHex)
newValue = v.GetChildAtIndex(0).GetValue()
- self.assertFalse(oldValue == newValue, "values did not change along with format")
-
+ self.assertFalse(oldValue == newValue,
+ "values did not change along with format")
+
v.SetFormat(lldb.eFormatVectorOfFloat32)
oldValueAgain = v.GetChildAtIndex(0).GetValue()
- self.assertTrue(oldValue == oldValueAgain, "same format but different values")
+ self.assertTrue(
+ oldValue == oldValueAgain,
+ "same format but different values")