summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/source/Core/Module.cpp1
-rw-r--r--lldb/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py18
-rw-r--r--lldb/test/functionalities/data-formatter/data-formatter-advanced/main.cpp2
3 files changed, 20 insertions, 1 deletions
diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp
index 0e5f67a0ba6..f35e36e26e3 100644
--- a/lldb/source/Core/Module.cpp
+++ b/lldb/source/Core/Module.cpp
@@ -700,7 +700,6 @@ Module::IsLoadedInTarget (Target *target)
if (sections != NULL)
{
size_t num_sections = sections->GetSize();
- bool loaded = false;
for (size_t sect_idx = 0; sect_idx < num_sections; sect_idx++)
{
SectionSP section_sp = sections->GetSectionAtIndex(sect_idx);
diff --git a/lldb/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py b/lldb/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py
index 6c91fc47140..37c2ef14c0a 100644
--- a/lldb/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py
+++ b/lldb/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py
@@ -171,6 +171,24 @@ class DataFormatterTestCase(TestBase):
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
+ self.runCmd("type format add -f hex int")
+ self.runCmd("type summary add -f \"x=${var.x%i}\" Simple")
+
+ self.expect("frame variable a_simple_object",
+ substrs = ['x=3'])
+
+ self.expect("frame variable a_simple_object", matching=False,
+ substrs = ['0x0'])
+
+ # now check that the default is applied if we do not hand out a format
+ self.runCmd("type summary add -f \"x=${var.x}\" Simple")
+
+ self.expect("frame variable a_simple_object", matching=False,
+ substrs = ['x=3'])
+
+ self.expect("frame variable a_simple_object", matching=True,
+ substrs = ['x=0x00000003'])
if __name__ == '__main__':
diff --git a/lldb/test/functionalities/data-formatter/data-formatter-advanced/main.cpp b/lldb/test/functionalities/data-formatter/data-formatter-advanced/main.cpp
index 28b544dc741..9e22d174610 100644
--- a/lldb/test/functionalities/data-formatter/data-formatter-advanced/main.cpp
+++ b/lldb/test/functionalities/data-formatter/data-formatter-advanced/main.cpp
@@ -106,5 +106,7 @@ int main (int argc, const char * argv[])
SimpleWithPointers(-4,-5,'6'),
SimpleWithPointers(-7,-8,'9')};
+ Simple a_simple_object(3,0.14,'E');
+
return 0; // Set break point at this line.
} \ No newline at end of file
OpenPOWER on IntegriCloud