aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2021-06-30 12:11:54 +0100
committerNick Clifton <nickc@redhat.com>2021-06-30 12:11:54 +0100
commit280c57ff58f8cb7c70d47ffbfeb446ca9b562c96 (patch)
tree5de97dd6cba8f139cef2b2b72bfe54c3a3d256c4
parentd8b04da736be0c8781e1067ee26e06fdd3b4c63c (diff)
downloadgdb-280c57ff58f8cb7c70d47ffbfeb446ca9b562c96.zip
gdb-280c57ff58f8cb7c70d47ffbfeb446ca9b562c96.tar.gz
gdb-280c57ff58f8cb7c70d47ffbfeb446ca9b562c96.tar.bz2
Fix signedness of def_cfa_sf and def_cfa_offset_sf
* dwarf.c (display_debug_frames): Both DW_CFA_def_cfa_sf and DW_CFA_def_cfa_offset_sf have a signed offset.
-rw-r--r--binutils/ChangeLog5
-rw-r--r--binutils/dwarf.c16
2 files changed, 14 insertions, 7 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index c6a05ca..b5dedef 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,8 @@
+2021-06-30 Richard Henderson <richard.henderson@linaro.org>
+
+ * dwarf.c (display_debug_frames): Both DW_CFA_def_cfa_sf
+ and DW_CFA_def_cfa_offset_sf have a signed offset.
+
2021-06-19 Alan Modra <amodra@gmail.com>
* dwarf.c (display_debug_lines_decoded): Use memcpy rather than
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index a57f0da..a61f099 100644
--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -9432,19 +9432,21 @@ display_debug_frames (struct dwarf_section *section,
case DW_CFA_def_cfa_sf:
READ_ULEB (fc->cfa_reg, start, block_end);
- READ_ULEB (fc->cfa_offset, start, block_end);
- fc->cfa_offset = fc->cfa_offset * fc->data_factor;
+ READ_SLEB (l, start, block_end);
+ l *= fc->data_factor;
+ fc->cfa_offset = l;
fc->cfa_exp = 0;
if (! do_debug_frames_interp)
- printf (" DW_CFA_def_cfa_sf: %s ofs %d\n",
- regname (fc->cfa_reg, 0), (int) fc->cfa_offset);
+ printf (" DW_CFA_def_cfa_sf: %s ofs %ld\n",
+ regname (fc->cfa_reg, 0), (long) l);
break;
case DW_CFA_def_cfa_offset_sf:
- READ_ULEB (fc->cfa_offset, start, block_end);
- fc->cfa_offset *= fc->data_factor;
+ READ_SLEB (l, start, block_end);
+ l *= fc->data_factor;
+ fc->cfa_offset = l;
if (! do_debug_frames_interp)
- printf (" DW_CFA_def_cfa_offset_sf: %d\n", (int) fc->cfa_offset);
+ printf (" DW_CFA_def_cfa_offset_sf: %ld\n", (long) l);
break;
case DW_CFA_MIPS_advance_loc8: