diff options
author | Cary Coutant <ccoutant@google.com> | 2013-05-15 16:36:38 +0000 |
---|---|---|
committer | Cary Coutant <ccoutant@google.com> | 2013-05-15 16:36:38 +0000 |
commit | 87bc83b328c32e82623df4c7689304c277106a3e (patch) | |
tree | b1b0463d19c323acd605597f68bf1d09ad4b3aba /binutils/dwarf.c | |
parent | af880d85b8ba82c4cd3bfc987df6f8ae85ebb917 (diff) | |
download | gdb-87bc83b328c32e82623df4c7689304c277106a3e.zip gdb-87bc83b328c32e82623df4c7689304c277106a3e.tar.gz gdb-87bc83b328c32e82623df4c7689304c277106a3e.tar.bz2 |
binutils/
* dwarf.c (SAFE_BYTE_GET64): Correct end-of-buffer check;
don't increment PTR.
(decode_location_expression): DW_OP_const2u should read 2 bytes.
(display_debug_lines_decoded): Adjust formatting.
* elfcomm.c (byte_get_little_endian): Add cases for 5-, 6-, and
7-byte reads.
(byte_get_big_endian): Likewise.
(byte_get_signed): Likewise.
Diffstat (limited to 'binutils/dwarf.c')
-rw-r--r-- | binutils/dwarf.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/binutils/dwarf.c b/binutils/dwarf.c index 774904c..862a060 100644 --- a/binutils/dwarf.c +++ b/binutils/dwarf.c @@ -337,13 +337,12 @@ read_uleb128 (unsigned char * data, #define SAFE_BYTE_GET64(PTR, HIGH, LOW, END) \ do \ { \ - if (((PTR) + 8) < (END)) \ + if (((PTR) + 8) <= (END)) \ { \ byte_get_64 ((PTR), (HIGH), (LOW)); \ } \ else \ { \ - PTR = END; \ * (LOW) = * (HIGH) = 0; \ } \ } \ @@ -883,7 +882,7 @@ decode_location_expression (unsigned char * data, printf ("DW_OP_const1s: %ld", (long) svalue); break; case DW_OP_const2u: - SAFE_BYTE_GET_AND_INC (uvalue, data, 1, end); + SAFE_BYTE_GET_AND_INC (uvalue, data, 2, end); printf ("DW_OP_const2u: %lu", (unsigned long) uvalue); break; case DW_OP_const2s: @@ -3184,7 +3183,8 @@ display_debug_lines_decoded (struct dwarf_section *section, break; case DW_LNE_set_address: SAFE_BYTE_GET_AND_INC (state_machine_regs.address, - op_code_data, ext_op_code_len - bytes_read - 1, + op_code_data, + ext_op_code_len - bytes_read - 1, end); state_machine_regs.op_index = 0; break; |