A stepi in a function without debug info with "set debug infrun 1"
crashes GDB since commit
c8353d682f69 (gdb/infrun: some extra infrun
debug print statements), due to a reference to
"tp->current_symtab->filename" when tp->current_symtab is null.
This commit adds the missing null check. The output in this case
becomes:
[infrun] set_step_info: symtab = <null>, line = 0, step_frame_id = {stack=0x7fffffffd980,code=0x0000000000456c30,!special}, step_stack_frame_id = {stack=0x7fffffffd980,code=0x0000000000456c30,!special}
Change-Id: I5171a9d222bc7e15b9dba2feaba7d55c7acd99f8
infrun_debug_printf
("symtab = %s, line = %d, step_frame_id = %s, step_stack_frame_id = %s",
- tp->current_symtab->filename, tp->current_line,
+ tp->current_symtab != nullptr ? tp->current_symtab->filename : "<null>",
+ tp->current_line,
tp->control.step_frame_id.to_string ().c_str (),
tp->control.step_stack_frame_id.to_string ().c_str ());
}