testing for a previous issue where formats in summaries where not enforced in all cases ; removed an unused local variable

llvm-svn: 136785
This commit is contained in:
Enrico Granata 2011-08-03 16:23:33 +00:00
parent a789aa770e
commit 7823ee3307
3 changed files with 20 additions and 1 deletions

View File

@ -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);

View File

@ -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__':

View File

@ -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.
}