summaryrefslogtreecommitdiff
path: root/gdb/frame.h
diff options
context:
space:
mode:
authorPedro Alves <pedro@codesourcery.com>2011-03-18 18:44:33 +0000
committerPedro Alves <pedro@codesourcery.com>2011-03-18 18:44:33 +0000
commitf86b56bf0dbd0ae8442aadc67aa63d3c78c57c1f (patch)
tree2a45f347e49c35662fc6eb32f446ef716511ba3e /gdb/frame.h
parent50c1f7174d688df6a3e1590b666b14d17efc5000 (diff)
downloadgdb-f86b56bf0dbd0ae8442aadc67aa63d3c78c57c1f.tar.gz
gdb/
* frame.c (frame_unwind_pc): Rename to ... (frame_unwind_pc_if_available): ... this. New `pc' output parameter. Change return type to int. Gracefully handle gdbarch_unwind_pc throwing NOT_AVAILABLE_ERROR. Return 0 if that happened, or 1 otherwise. (frame_unwind_pc): Reimplement on top of frame_unwind_pc_if_available. (get_frame_func): Rename to ... (get_frame_func_if_available): New `pc' output parameter. Change return type to int. Gracefully handle the PC not being available. (get_frame_func): Reimplement on top of get_frame_func_if_available. (select_frame): Handle the PC being unavailable. (get_prev_frame): Handle the PC being unavailable. (get_frame_pc_if_available): New. (get_frame_address_in_block_if_available): New. (find_frame_sal): Handle the frame PC not being available. * frame.h (get_frame_pc_if_available): Declare. (get_frame_address_in_block_if_available): Declare. (get_frame_func_if_available): Declare. * stack.c (print_frame_info): Handle the PC being unavailable. (find_frame_funname): Ditto. (print_frame): Handle the PC being unavailable. (get_frame_language): Ditto. * blockframe.c (get_frame_block): Ditto. * macroscope.c (default_macro_scope): Ditto. * tui/tui-stack.c (tui_show_frame_info): Ditto.
Diffstat (limited to 'gdb/frame.h')
-rw-r--r--gdb/frame.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/gdb/frame.h b/gdb/frame.h
index e7053a8e7f5..25f20a944f7 100644
--- a/gdb/frame.h
+++ b/gdb/frame.h
@@ -284,6 +284,12 @@ extern struct frame_info *frame_find_by_id (struct frame_id id);
This replaced: frame->pc; */
extern CORE_ADDR get_frame_pc (struct frame_info *);
+/* Same as get_frame_pc, but return a boolean indication of whether
+ the PC is actually available, instead of throwing an error. */
+
+extern int get_frame_pc_if_available (struct frame_info *frame,
+ CORE_ADDR *pc);
+
/* An address (not necessarily aligned to an instruction boundary)
that falls within THIS frame's code block.
@@ -299,6 +305,15 @@ extern CORE_ADDR get_frame_pc (struct frame_info *);
extern CORE_ADDR get_frame_address_in_block (struct frame_info *this_frame);
+/* Same as get_frame_address_in_block, but returns a boolean
+ indication of whether the frame address is determinable (when the
+ PC is unavailable, it will not be), instead of possibly throwing an
+ error trying to read an unavailable PC. */
+
+extern int
+ get_frame_address_in_block_if_available (struct frame_info *this_frame,
+ CORE_ADDR *pc);
+
/* The frame's inner-most bound. AKA the stack-pointer. Confusingly
known as top-of-stack. */
@@ -309,6 +324,13 @@ extern CORE_ADDR get_frame_sp (struct frame_info *);
that function isn't known. */
extern CORE_ADDR get_frame_func (struct frame_info *fi);
+/* Same as get_frame_func, but returns a boolean indication of whether
+ the frame function is determinable (when the PC is unavailable, it
+ will not be), instead of possibly throwing an error trying to read
+ an unavailable PC. */
+
+extern int get_frame_func_if_available (struct frame_info *fi, CORE_ADDR *);
+
/* Closely related to the resume address, various symbol table
attributes that are determined by the PC. Note that for a normal
frame, the PC refers to the resume address after the return, and