Fixed issues with ptr_refs:

- If there is only 1 frame ptr_refs now works (fixed issue with stack detection)
- Fixed test for result now that it isn't a pointer anymore

llvm-svn: 198712
This commit is contained in:
Greg Clayton 2014-01-07 21:55:00 +00:00
parent a63f229509
commit 966c6f6ddf
1 changed files with 129 additions and 129 deletions

View File

@ -154,6 +154,7 @@ if (KERN_SUCCESS == err)
if options.search_stack:
expr += '''
#ifdef NUM_STACKS
// Call the callback for the thread stack ranges
for (uint32_t i=0; i<NUM_STACKS; ++i) {
range_callback(task, &baton, 8, stacks[i].base, stacks[i].size);
@ -161,13 +162,15 @@ for (uint32_t i=0; i<NUM_STACKS; ++i) {
range_callback(task, &baton, 16, stacks[i].base - STACK_RED_ZONE_SIZE, STACK_RED_ZONE_SIZE);
}
}
'''
#endif'''
if options.search_segments:
expr += '''
#ifdef NUM_SEGMENTS
// Call the callback for all segments
for (uint32_t i=0; i<NUM_SEGMENTS; ++i)
range_callback(task, &baton, 32, segments[i].base, segments[i].size);'''
range_callback(task, &baton, 32, segments[i].base, segments[i].size);
#endif'''
if user_return_code:
expr += "\n%s" % (user_return_code,)
@ -447,7 +450,6 @@ def display_match_results (result, options, arg_str_description, expr, print_no_
print "expression result:"
print expr_sbvalue
if expr_sbvalue.error.Success():
if expr_sbvalue.unsigned:
match_value = lldb.value(expr_sbvalue)
i = 0
match_idx = 0
@ -572,8 +574,6 @@ def display_match_results (result, options, arg_str_description, expr, print_no_
elif options.stack:
dump_stack_history_entries(options, result, malloc_addr, 0)
return i
elif print_no_matches:
result.AppendMessage('no matches found for %s' % (arg_str_description))
else:
result.AppendMessage(str(expr_sbvalue.error))
return 0
@ -871,7 +871,7 @@ stacks[%(index)u].base = 0x%(base)x;
stacks[%(index)u].size = 0x%(size)x;''' % stack_dict
return result
else:
return None
return ''
def get_sections_ranges_struct (process):
'''Create code that defines a structure that represents all segments that
@ -903,7 +903,7 @@ segments[%(index)u].base = 0x%(base)x;
segments[%(index)u].size = 0x%(size)x;''' % segment_dict
return result
else:
return None
return ''
def section_ptr_refs(debugger, command, result, dict):
command_args = shlex.split(command)