2004-07-16 Andrew Cagney <cagney@gnu.org>
authorAndrew Cagney <cagney@redhat.com>
Fri, 16 Jul 2004 19:00:12 +0000 (19:00 +0000)
committerAndrew Cagney <cagney@redhat.com>
Fri, 16 Jul 2004 19:00:12 +0000 (19:00 +0000)
* frame.c (fprint_field): New function.
(fprint_frame_id): Use fprint_field.

gdb/ChangeLog
gdb/frame.c

index 95b6569eeeefe069bf298ab8775f12f2e6b92552..c63ad0a48eda6957a431386f525b84cc524ebc89 100644 (file)
@@ -1,3 +1,8 @@
+2004-07-16  Andrew Cagney  <cagney@gnu.org>
+
+       * frame.c (fprint_field): New function.
+       (fprint_frame_id): Use fprint_field.
+
 2004-07-15  Joel Brobecker  <brobecker@gnat.com>
 
        * ada-lang.c (ada_language_defn): Remove commented out code.
index 0e3531aceafec7a421a717fbc6c5bfe30aa5711a..c164d727369539f57727cfba90e67a00654d47ac 100644 (file)
@@ -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