summaryrefslogtreecommitdiffstats
path: root/gdb/frame.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2003-09-08 18:56:03 +0000
committerDaniel Jacobowitz <drow@false.org>2003-09-08 18:56:03 +0000
commit7dd889867037abfa8f239f9f65f9606294e0be8d (patch)
tree26f82f5b8170f23254243c62fcc2c7e9df1a913e /gdb/frame.c
parenta6fc177898b33d6eb3154e93ace5d24272a9eb70 (diff)
downloadppe42-binutils-7dd889867037abfa8f239f9f65f9606294e0be8d.tar.gz
ppe42-binutils-7dd889867037abfa8f239f9f65f9606294e0be8d.zip
* frame.c (deprecated_safe_get_selected_frame): New function.
* frame.h (deprecated_safe_get_selected_frame): Add prototype. * findvar.c (read_var_value): Call it.
Diffstat (limited to 'gdb/frame.c')
-rw-r--r--gdb/frame.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gdb/frame.c b/gdb/frame.c
index efcee75ddd..31cb6c5fd9 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -917,6 +917,18 @@ get_selected_frame (void)
return deprecated_selected_frame;
}
+/* This is a variant of get_selected_frame which can be called when
+ the inferior does not have a frame; in that case it will return
+ NULL instead of calling error (). */
+
+struct frame_info *
+deprecated_safe_get_selected_frame (void)
+{
+ if (!target_has_registers || !target_has_stack || !target_has_memory)
+ return NULL;
+ return get_selected_frame ();
+}
+
/* Select frame FI (or NULL - to invalidate the current frame). */
void
OpenPOWER on IntegriCloud