This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[commit/6.2] Print the frame ID predicates


FYI,

This tweaks the ``set debug frame 1'' output so that it includes the recently added predicate vis:

	id={!stack,!code,!special}
	id={stack=0x7fffe4b0,code=0x41bc2b54,!special}

Committed to mainline and 6.2 branch.
Andrew
2004-07-16  Andrew Cagney  <cagney@gnu.org>

	* frame.c (fprint_field): New function.
	(fprint_frame_id): Use fprint_field.

Index: frame.c
===================================================================
RCS file: /cvs/src/src/gdb/frame.c,v
retrieving revision 1.183
diff -p -u -r1.183 frame.c
--- frame.c	27 Jun 2004 20:45:05 -0000	1.183
+++ frame.c	16 Jul 2004 18:58:49 -0000
@@ -139,14 +139,25 @@ static int frame_debug;
 static int backtrace_past_main;
 static unsigned int backtrace_limit = UINT_MAX;
 
+static void
+fprint_field (struct ui_file *file, const char *name, int p, CORE_ADDR addr)
+{
+  if (p)
+    fprintf_unfiltered (file, "%s=0x%s", name, paddr_nz (addr));
+  else
+    fprintf_unfiltered (file, "!%s", name);
+}
 
 void
 fprint_frame_id (struct ui_file *file, struct frame_id id)
 {
-  fprintf_unfiltered (file, "{stack=0x%s,code=0x%s,special=0x%s}",
-		      paddr_nz (id.stack_addr),
-		      paddr_nz (id.code_addr),
-		      paddr_nz (id.special_addr));
+  fprintf_unfiltered (file, "{");
+  fprint_field (file, "stack", id.stack_addr_p, id.stack_addr);
+  fprintf_unfiltered (file, ",");
+  fprint_field (file, "code", id.code_addr_p, id.code_addr);
+  fprintf_unfiltered (file, ",");
+  fprint_field (file, "special", id.special_addr_p, id.special_addr);
+  fprintf_unfiltered (file, "}");
 }
 
 static void

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]