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 second break point at this line.')
def data_formatter_commands(self):
"""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)
- lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line2, num_expected_locations=-1)
+ lldbutil.run_break_set_by_source_regexp (self, regexp="break here")
self.runCmd("run", RUN_SUCCEEDED)
self.expect("frame variable numbers",
substrs = ['numbers = size=0'])
- self.runCmd("n")
+ self.runCmd("continue")
# first value added
self.expect("frame variable numbers",
'}'])
# add some more data
- self.runCmd("n");self.runCmd("n");self.runCmd("n");
+ self.runCmd("continue");
self.expect("frame variable numbers",
substrs = ['numbers = size=4',
self.runCmd("type summary delete int_vect")
# add some more data
- self.runCmd("n");self.runCmd("n");self.runCmd("n");
+ self.runCmd("continue");
self.expect("frame variable numbers",
substrs = ['numbers = size=7',
substrs = ['1234']);
# clear out the vector and see that we do the right thing once again
- self.runCmd("n")
+ self.runCmd("continue")
self.expect("frame variable numbers",
substrs = ['numbers = size=0'])
- self.runCmd("n")
+ self.runCmd("continue")
# first value added
self.expect("frame variable numbers",
'}'])
# check if we can display strings
- self.runCmd("c")
-
self.expect("frame variable strings",
substrs = ['goofy',
'is',
'is',
'smart'])
- self.runCmd("n")
+ self.runCmd("continue")
self.expect("frame variable strings",
substrs = ['vector has 4 items'])
self.expect("frame variable strings[1]",
substrs = ['is']);
- self.runCmd("n")
+ self.runCmd("continue")
self.expect("frame variable strings",
substrs = ['vector has 0 items'])
int main()
{
int_vect numbers;
- (numbers.push_back(1)); // Set break point at this line.
- (numbers.push_back(12));
+ (numbers.push_back(1)); // break here
+ (numbers.push_back(12)); // break here
(numbers.push_back(123));
(numbers.push_back(1234));
- (numbers.push_back(12345));
+ (numbers.push_back(12345)); // break here
(numbers.push_back(123456));
(numbers.push_back(1234567));
- numbers.clear();
+ numbers.clear(); // break here
- (numbers.push_back(7));
+ (numbers.push_back(7)); // break here
string_vect strings;
(strings.push_back(std::string("goofy")));
(strings.push_back(std::string("is")));
(strings.push_back(std::string("smart")));
- (strings.push_back(std::string("!!!"))); // Set second break point at this line.
+ (strings.push_back(std::string("!!!"))); // break here
- strings.clear();
+ strings.clear(); // break here
- return 0;
+ return 0; // break here
}