1
1
mirror of https://github.com/rui314/mold.git synced 2024-10-04 08:37:28 +03:00

Merge pull request #470 from llunak/gdb-index-address-size

Gdb index address size
This commit is contained in:
Rui Ueyama 2022-04-26 18:48:56 +08:00 committed by GitHub
commit 1b5735543f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 11 additions and 5 deletions

View File

@ -119,10 +119,16 @@ find_compunit(Context<E> &ctx, ObjectFile<E> &file, i64 offset) {
case 3:
case 4:
abbrev_offset = *(u32 *)(cu + 6);
if (u32 address_size = cu[10]; address_size != E::word_size)
Fatal(ctx) << file << ": --gdb-index: unsupported address size "
<< address_size;
cu += 11;
break;
case 5: {
abbrev_offset = *(u32 *)(cu + 8);
if (u32 address_size = cu[7]; address_size != E::word_size)
Fatal(ctx) << file << ": --gdb-index: unsupported address size "
<< address_size;
switch (u32 unit_type = cu[6]; unit_type) {
case DW_UT_compile:

View File

@ -49,7 +49,7 @@ readelf -WS $t/exe 2> /dev/null | fgrep -q .gdb_index
$QEMU $t/exe | grep -q 'Hello world'
DEBUGINFOD_URLS= gdb $t/exe -batch -ex 'b main' -ex r -ex 'b trap' \
DEBUGINFOD_URLS= gdb $t/exe -nx -batch -ex 'b main' -ex r -ex 'b trap' \
-ex c -ex bt -ex quit >& $t/log
grep -Pq 'hello \(\) at .*<stdin>:7' $t/log

View File

@ -60,7 +60,7 @@ readelf -WS $t/exe 2> /dev/null | fgrep -q .gdb_index
$QEMU $t/exe | grep -q 'Hello world'
DEBUGINFOD_URLS= gdb $t/exe -batch -ex 'b main' -ex r -ex 'b trap' \
DEBUGINFOD_URLS= gdb $t/exe -nx -batch -ex 'b main' -ex r -ex 'b trap' \
-ex c -ex bt -ex quit >& $t/log
grep -Pq 'hello2 \(\) at .*<stdin>:7' $t/log

View File

@ -60,7 +60,7 @@ readelf -WS $t/exe 2> /dev/null | fgrep -q .gdb_index
$QEMU $t/exe | grep -q 'Hello world'
DEBUGINFOD_URLS= gdb $t/exe -batch -ex 'b main' -ex r -ex 'b trap' \
DEBUGINFOD_URLS= gdb $t/exe -nx -batch -ex 'b main' -ex r -ex 'b trap' \
-ex c -ex bt -ex quit >& $t/log
grep -Pq 'hello2 \(\) at .*<stdin>:7' $t/log

View File

@ -60,7 +60,7 @@ readelf -WS $t/exe 2> /dev/null | fgrep -q .gdb_index
$QEMU $t/exe | grep -q 'Hello world'
DEBUGINFOD_URLS= gdb $t/exe -batch -ex 'b main' -ex r -ex 'b trap' \
DEBUGINFOD_URLS= gdb $t/exe -nx -batch -ex 'b main' -ex r -ex 'b trap' \
-ex c -ex bt -ex quit >& $t/log
grep -Pq 'hello2 \(\) at .*<stdin>:7' $t/log

View File

@ -92,7 +92,7 @@ readelf -WS $t/exe 2> /dev/null | fgrep -q .gdb_index
$QEMU $t/exe | grep -q 'Hello world'
DEBUGINFOD_URLS= gdb $t/exe -batch -ex 'b main' -ex r -ex 'b trap' \
DEBUGINFOD_URLS= gdb $t/exe -nx -batch -ex 'b main' -ex r -ex 'b trap' \
-ex c -ex bt -ex quit >& $t/log
grep -Pq 'fn8 \(\) at .*/d.c:6' $t/log