Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] PR backtrace/9786
@ 2009-02-22 19:37 Nick Roberts
  2009-02-23  0:51 ` Joel Brobecker
  2009-04-18  0:43 ` Nick Roberts
  0 siblings, 2 replies; 9+ messages in thread
From: Nick Roberts @ 2009-02-22 19:37 UTC (permalink / raw)
  To: gdb-patches


This patch prevents the assertion error reported in:

http://sourceware.org/bugzilla/show_bug.cgi?id=9786

Output from "info frame" after connecting to a remote target now looks like:

    (gdb) info frame
    Stack level 0, frame at 0x0:
     eip = 0xb7f7d810; saved eip none
     Outermost frame: unwinder did not report frame ID
     Arglist at unknown address.
     Locals at unknown address, Previous frame's sp in esp

With native targets "info frame" works as before and there are no regressions
in the testsuite.  I don't understand the last line of output but I think
this is better than having Gdb throw an assertion error.

-- 
Nick                                           http://www.inet.net.nz/~nickrob


2009-02-23  Nick Roberts  <nickrob@snap.net.nz>

	PR backtrace/9786
	* stack.c (frame_info): Avoid assertion error when there
        is no saved pc.


--- stack.c	12 Feb 2009 19:33:27 +1300	1.185
+++ stack.c	23 Feb 2009 00:09:02 +1300	
@@ -894,6 +894,7 @@ frame_info (char *addr_exp, int from_tty
   int selected_frame_p;
   struct gdbarch *gdbarch;
   struct cleanup *back_to = make_cleanup (null_cleanup, NULL);
+  struct value *value;
 
   fi = parse_frame_specification_1 (addr_exp, "No stack.", &selected_frame_p);
   gdbarch = get_frame_arch (fi);
@@ -976,7 +977,12 @@ frame_info (char *addr_exp, int from_tty
   puts_filtered ("; ");
   wrap_here ("    ");
   printf_filtered ("saved %s ", pc_regname);
-  fputs_filtered (paddress (frame_pc_unwind (fi)), gdb_stdout);
+  value = frame_unwind_register_value (fi, gdbarch_pc_regnum (gdbarch));
+  if (VALUE_LVAL (value)  == lval_register
+      && !(frame_id_p (VALUE_FRAME_ID (value))))
+    printf_filtered ("none");
+  else
+    fputs_filtered (paddress (frame_pc_unwind (fi)), gdb_stdout);
   printf_filtered ("\n");
 
   if (calling_frame_info == NULL)


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-06-23 18:46 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-22 19:37 [PATCH] PR backtrace/9786 Nick Roberts
2009-02-23  0:51 ` Joel Brobecker
2009-02-23  1:08   ` Pedro Alves
2009-02-23  2:08     ` Daniel Jacobowitz
2009-04-18  0:43 ` Nick Roberts
2009-04-20 17:19   ` Tom Tromey
2009-04-21  8:28     ` Nick Roberts
2009-06-23 18:39   ` Joel Brobecker
2009-06-23 18:46     ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox