stack: check frame_unwind_caller_id

Callers of frame_unwind_caller_* functions are supposed to check
frame_unwind_caller_id.

Add such a check to frame_info and treat an invalid caller ID as if the caller
PC were not available.

gdb/
	* stack.c (frame_info): Check frame_unwind_caller_id.
This commit is contained in:
Markus Metzger 2016-02-11 11:07:09 +01:00
parent 2f3ef606b9
commit a038fa3e14
2 changed files with 26 additions and 17 deletions

View file

@ -1,3 +1,7 @@
2016-02-12 Markus Metzger <markus.t.metzger@intel.com>
* stack.c (frame_info): Check frame_unwind_caller_id.
2016-02-12 Markus Metzger <markus.t.metzger@intel.com>
* frame.h (skip_tailcall_frames): New.

View file

@ -1509,6 +1509,10 @@ frame_info (char *addr_exp, int from_tty)
wrap_here (" ");
printf_filtered ("saved %s = ", pc_regname);
if (!frame_id_p (frame_unwind_caller_id (fi)))
val_print_unavailable (gdb_stdout);
else
{
TRY
{
caller_pc = frame_unwind_caller_pc (fi);
@ -1530,6 +1534,7 @@ frame_info (char *addr_exp, int from_tty)
}
}
END_CATCH
}
if (caller_pc_p)
fputs_filtered (paddress (gdbarch, caller_pc), gdb_stdout);