aboutsummaryrefslogtreecommitdiff
path: root/gdb/breakpoint.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@ericsson.com>2017-10-27 09:01:36 -0400
committerSimon Marchi <simon.marchi@ericsson.com>2017-10-27 09:01:36 -0400
commit32ef30002cee3661eb645cd14bcc4ff77ea10f45 (patch)
treed80954cc6034f9922c28c1a628473bf1c1137a5c /gdb/breakpoint.c
parent7453e6b2ea451dfba68cf4442e58706d51f88411 (diff)
downloadbinutils-32ef30002cee3661eb645cd14bcc4ff77ea10f45.zip
binutils-32ef30002cee3661eb645cd14bcc4ff77ea10f45.tar.gz
binutils-32ef30002cee3661eb645cd14bcc4ff77ea10f45.tar.bz2
dwarf: Read register number as unsigned in DW_CFA_def_cfa*
When displaying the .debug_frame section, the register numbers in the DW_CFA_def_cfa* statements are read as signed numbers. I have come across a target that has register 121, encoded as 0x79 in unsigned LEB128. Interpreting this as signed results in -7, which makes readelf display "r-7". The DWARF5 standard (6.4.2.2) states that the register numbers should be treated as unsigned LEB128. Simply replacing READ_SLEB with READ_ULEB resulted in warnings like these: /home/emaisin/src/binutils-gdb/binutils/dwarf.c: In function ‘display_debug_frames’: /home/emaisin/src/binutils-gdb/binutils/dwarf.c:355:17: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] if ((var) != _val) \ ^ /home/emaisin/src/binutils-gdb/binutils/dwarf.c:7866:8: note: in expansion of macro ‘READ_ULEB’ READ_ULEB (fc->cfa_reg); ^ ... so I also changed Frame_Chunk::cfa_reg to an unsigned int. binutils/ChangeLog: * dwarf.c (struct Frame_Chunk) <cfa_reg>: Change type to unsigned int. (display_debug_frames): Read CFA reg as an unsigned number.
Diffstat (limited to 'gdb/breakpoint.c')
0 files changed, 0 insertions, 0 deletions