Skip to content

Commit c9a9dd4

Browse files
committed
gdb: dwarf: hack in 24-bit address support
1 parent be028fb commit c9a9dd4

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

gdb/dwarf2/unit-head.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,12 @@ unit_head::read_address (bfd *abfd, const gdb_byte *buf,
202202
case 2:
203203
retval = bfd_get_signed_16 (abfd, buf);
204204
break;
205+
case 3:
206+
{
207+
ULONGEST u = bfd_get_24 (abfd, buf);
208+
retval = (u & 0x800000) ? (ULONGEST) (u | ~((ULONGEST) 0xffffff)) : u;
209+
break;
210+
}
205211
case 4:
206212
retval = bfd_get_signed_32 (abfd, buf);
207213
break;
@@ -220,6 +226,9 @@ unit_head::read_address (bfd *abfd, const gdb_byte *buf,
220226
case 2:
221227
retval = bfd_get_16 (abfd, buf);
222228
break;
229+
case 3:
230+
retval = bfd_get_24 (abfd, buf);
231+
break;
223232
case 4:
224233
retval = bfd_get_32 (abfd, buf);
225234
break;

0 commit comments

Comments
 (0)