int x;
int y;
char padding[0];
- }; //% self.expect("frame variable pt.padding[0]", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["pt.padding[0] = "]); self.expect("frame variable pt.padding[1]", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["pt.padding[1] = "]); self.expect("expression -- (pt.padding[0])", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["(char)", " = "]); self.expect("image lookup -t point_tag", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ['padding[]']) # Once rdar://problem/12566646 is fixed, this should display correctly
+ }; //% self.expect("frame variable pt.padding[0]", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["pt.padding[0] = "])
+ //% self.expect("frame variable pt.padding[1]", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["pt.padding[1] = "])
+ //% self.expect("expression -- (pt.padding[0])", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["(char)", " = "])
+ //% self.expect("image lookup -t point_tag", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ['padding[]']) # Once rdar://problem/12566646 is fixed, this should display correctly
struct rect_tag {
struct point_tag bottom_left;
struct point_tag top_right;
};
- struct point_tag pt = { 2, 3, {} }; //% self.
+ struct point_tag pt = { 2, 3, {} };
struct rect_tag rect = {{1, 2, {}}, {3, 4, {}}};
return 0; //% self.expect("expression -- &pt == (struct point_tag*)0", substrs = ['false'])
}
def parse_one_command(self, line):
parts = line.split('//%')
- if len(parts) != 2:
- return None
- else:
- return parts[1].strip() # take off trailing whitespace
+
+ command = None
+ new_breakpoint = True
+
+ if len(parts) == 2:
+ command = parts[1].strip() # take off whitespace
+ new_breakpoint = parts[0].strip() != ""
+
+ return (command, new_breakpoint)
def parse_source_files(self, source_files):
for source_file in source_files:
file_handle = open(source_file)
lines = file_handle.readlines()
line_number = 0
+ current_breakpoint = None # non-NULL means we're looking through whitespace to find additional commands
for line in lines:
line_number = line_number + 1 # 1-based, so we do this first
- command = self.parse_one_command(line)
+ (command, new_breakpoint) = self.parse_one_command(line)
+
+ if new_breakpoint:
+ current_breakpoint = None
+
if command != None:
- breakpoint = {}
- breakpoint['file_name'] = source_file
- breakpoint['line_number'] = line_number
- breakpoint['command'] = command
- self.breakpoints.append(breakpoint)
+ if current_breakpoint == None:
+ current_breakpoint = {}
+ current_breakpoint['file_name'] = source_file
+ current_breakpoint['line_number'] = line_number
+ current_breakpoint['command'] = command
+ self.breakpoints.append(current_breakpoint)
+ else:
+ current_breakpoint['command'] = current_breakpoint['command'] + "\n" + command
+ print self.breakpoints
def set_breakpoints(self, target):
for breakpoint in self.breakpoints: