diff options
author | Andrew Cagney <cagney@redhat.com> | 2004-07-16 19:02:45 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2004-07-16 19:02:45 +0000 |
commit | f1840399c32d5cf89d8e1d3bfae3ff3078be240e (patch) | |
tree | 9f335e9d892f756c7f4971deec733f80f6b4b845 | |
parent | 39a8fd53cdb8df9c70438695079a75ef635575e4 (diff) | |
download | gdb-f1840399c32d5cf89d8e1d3bfae3ff3078be240e.tar.gz |
2004-07-16 Andrew Cagney <cagney@gnu.org>
* frame.c (fprint_field): New function.
(fprint_frame_id): Use fprint_field.
-rw-r--r-- | gdb/frame.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/gdb/frame.c b/gdb/frame.c index 0e3531aceaf..c164d727369 100644 --- a/gdb/frame.c +++ b/gdb/frame.c @@ -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 |