aboutsummaryrefslogtreecommitdiff
path: root/gdb/frame.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2003-03-12 22:39:16 +0000
committerAndrew Cagney <cagney@redhat.com>2003-03-12 22:39:16 +0000
commit0a1e1ca1f645fe9728ae8fa5d5f20f11572285db (patch)
treebb116688837e5870629f1203aa134157c8b34e4c /gdb/frame.c
parenta66a9c23319105b23198e91be27a2e2f442f4671 (diff)
downloadgdb-0a1e1ca1f645fe9728ae8fa5d5f20f11572285db.zip
gdb-0a1e1ca1f645fe9728ae8fa5d5f20f11572285db.tar.gz
gdb-0a1e1ca1f645fe9728ae8fa5d5f20f11572285db.tar.bz2
2003-03-12 Andrew Cagney <cagney@redhat.com>
* frame.c (get_current_frame): Check target_has_registers before checking target_has_stack. * eval.c (evaluate_subexp_standard): Use get_selected_frame, instead of deprecated_selected_frame. * findvar.c (value_of_register): Pass "frame", not deprecated_selected_frame, to value_of_builtin_reg.
Diffstat (limited to 'gdb/frame.c')
-rw-r--r--gdb/frame.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gdb/frame.c b/gdb/frame.c
index d5f052b..7975090 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -566,10 +566,15 @@ unwind_to_current_frame (struct ui_out *ui_out, void *args)
struct frame_info *
get_current_frame (void)
{
- if (!target_has_stack)
- error ("No stack.");
+ /* First check, and report, the lack of registers. Having GDB
+ report "No stack!" or "No memory" when the target doesn't even
+ have registers is very confusing. Besides, "printcmd.exp"
+ explicitly checks that ``print $pc'' with no registers prints "No
+ registers". */
if (!target_has_registers)
error ("No registers.");
+ if (!target_has_stack)
+ error ("No stack.");
if (!target_has_memory)
error ("No memory.");
if (current_frame == NULL)