* [PATCH] Add DW_CFA_val_* support in readelf -wf
@ 2006-03-03 13:16 Jakub Jelinek
2006-03-03 14:40 ` Nick Clifton
0 siblings, 1 reply; 2+ messages in thread
From: Jakub Jelinek @ 2006-03-03 13:16 UTC (permalink / raw)
To: binutils
Hi!
DW_CFA_val_{offset,offset_sf,expression} are CFA ops added recently in
DWARF 3. Ok for trunk?
2006-03-03 Jakub Jelinek <jakub@redhat.com>
* dwarf.c (frame_display_row, display_debug_frames): Handle
DW_CFA_val_offset, DW_CFA_val_offset_sf and DW_CFA_val_expression.
--- binutils/dwarf.c.jj 2005-09-30 16:57:52.000000000 +0200
+++ binutils/dwarf.c 2006-03-02 00:21:49.000000000 +0100
@@ -1,5 +1,5 @@
/* dwarf.c -- display DWARF contents of a BFD binary file
- Copyright 2005
+ Copyright 2005, 2006
Free Software Foundation, Inc.
This file is part of GNU Binutils.
@@ -2904,12 +2904,18 @@ frame_display_row (Frame_Chunk *fc, int
case DW_CFA_offset:
sprintf (tmp, "c%+d", fc->col_offset[r]);
break;
+ case DW_CFA_val_offset:
+ sprintf (tmp, "v%+d", fc->col_offset[r]);
+ break;
case DW_CFA_register:
sprintf (tmp, "r%d", fc->col_offset[r]);
break;
case DW_CFA_expression:
strcpy (tmp, "exp");
break;
+ case DW_CFA_val_expression:
+ strcpy (tmp, "vexp");
+ break;
default:
strcpy (tmp, "n/a");
break;
@@ -3252,6 +3258,7 @@ display_debug_frames (struct dwarf_secti
start += 4;
break;
case DW_CFA_offset_extended:
+ case DW_CFA_val_offset:
reg = LEB (); LEB ();
frame_need_space (fc, reg);
fc->col_type[reg] = DW_CFA_undefined;
@@ -3290,6 +3297,7 @@ display_debug_frames (struct dwarf_secti
start += tmp;
break;
case DW_CFA_expression:
+ case DW_CFA_val_expression:
reg = LEB ();
tmp = LEB ();
start += tmp;
@@ -3297,6 +3305,7 @@ display_debug_frames (struct dwarf_secti
fc->col_type[reg] = DW_CFA_undefined;
break;
case DW_CFA_offset_extended_sf:
+ case DW_CFA_val_offset_sf:
reg = LEB (); SLEB ();
frame_need_space (fc, reg);
fc->col_type[reg] = DW_CFA_undefined;
@@ -3426,6 +3435,16 @@ display_debug_frames (struct dwarf_secti
fc->col_offset[reg] = roffs * fc->data_factor;
break;
+ case DW_CFA_val_offset:
+ reg = LEB ();
+ roffs = LEB ();
+ if (! do_debug_frames_interp)
+ printf (" DW_CFA_val_offset: r%ld at cfa%+ld\n",
+ reg, roffs * fc->data_factor);
+ fc->col_type[reg] = DW_CFA_val_offset;
+ fc->col_offset[reg] = roffs * fc->data_factor;
+ break;
+
case DW_CFA_restore_extended:
reg = LEB ();
if (! do_debug_frames_interp)
@@ -3543,6 +3562,19 @@ display_debug_frames (struct dwarf_secti
start += ul;
break;
+ case DW_CFA_val_expression:
+ reg = LEB ();
+ ul = LEB ();
+ if (! do_debug_frames_interp)
+ {
+ printf (" DW_CFA_val_expression: r%ld (", reg);
+ decode_location_expression (start, eh_addr_size, ul, 0);
+ printf (")\n");
+ }
+ fc->col_type[reg] = DW_CFA_val_expression;
+ start += ul;
+ break;
+
case DW_CFA_offset_extended_sf:
reg = LEB ();
l = SLEB ();
@@ -3554,6 +3586,17 @@ display_debug_frames (struct dwarf_secti
fc->col_offset[reg] = l * fc->data_factor;
break;
+ case DW_CFA_val_offset_sf:
+ reg = LEB ();
+ l = SLEB ();
+ frame_need_space (fc, reg);
+ if (! do_debug_frames_interp)
+ printf (" DW_CFA_val_offset_sf: r%ld at cfa%+ld\n",
+ reg, l * fc->data_factor);
+ fc->col_type[reg] = DW_CFA_val_offset;
+ fc->col_offset[reg] = l * fc->data_factor;
+ break;
+
case DW_CFA_def_cfa_sf:
fc->cfa_reg = LEB ();
fc->cfa_offset = SLEB ();
Jakub
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Add DW_CFA_val_* support in readelf -wf
2006-03-03 13:16 [PATCH] Add DW_CFA_val_* support in readelf -wf Jakub Jelinek
@ 2006-03-03 14:40 ` Nick Clifton
0 siblings, 0 replies; 2+ messages in thread
From: Nick Clifton @ 2006-03-03 14:40 UTC (permalink / raw)
To: Jakub Jelinek; +Cc: binutils
Hi Jakub,
> 2006-03-03 Jakub Jelinek <jakub@redhat.com>
>
> * dwarf.c (frame_display_row, display_debug_frames): Handle
> DW_CFA_val_offset, DW_CFA_val_offset_sf and DW_CFA_val_expression.
Approved - please apply.
Cheers
Nick
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-03-03 14:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-03 13:16 [PATCH] Add DW_CFA_val_* support in readelf -wf Jakub Jelinek
2006-03-03 14:40 ` Nick Clifton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).