a-v-s / riscv_gcc_debug_issue

1 stars 0 forks source link

Got same issue, different GCC 13.2.0 #1

Open kingsumos opened 6 months ago

kingsumos commented 6 months ago

Just reporting that I have the same issue but using GCC 13.2.0 ;) GDB sometimes complains about: "Call Frame Instruction op 28 in vendor extension space is not handled on this architecture"

Removing the assembly listing generation (which was passed to linker with: "-Wa,-ahlms=$*.lst") fixes the issue!

The toolchain was created using https://github.com/riscv-collab/riscv-gnu-toolchain project, details below:

Using built-in specs.
COLLECT_GCC=/opt/riscv/bin/riscv64-unknown-elf-gcc
COLLECT_LTO_WRAPPER=/opt/riscv/libexec/gcc/riscv64-unknown-elf/13.2.0/lto-wrapper
Target: riscv64-unknown-elf
Configured with: /home/lxuser/git/riscv-gnu-toolchain/build_new/../gcc/configure --target=riscv64-unknown-elf --prefix=/opt/riscv --disable-shared --disable-threads --enable-languages=c,c++ --with-pkgversion=gc891d8dc23e --with-system-zlib --enable-tls --with-newlib --with-sysroot=/opt/riscv/riscv64-unknown-elf --with-native-system-header-dir=/include --disable-libmudflap --disable-libssp --disable-libquadmath --disable-libgomp --disable-nls --disable-tm-clone-registry --src=../../gcc --enable-multilib --with-abi=lp64d --with-arch=rv64imafdc --with-tune=rocket --with-isa-spec=20191213 'CFLAGS_FOR_TARGET=-Os    -mcmodel=medlow' 'CXXFLAGS_FOR_TARGET=-Os    -mcmodel=medlow'
Thread model: single
Supported LTO compression algorithms: zlib
gcc version 13.2.0 (gc891d8dc23e)

GDB version:

2af3791f44d9:/vol/template # /opt/riscv/bin/riscv64-unknown-elf-gdb -v
GNU gdb (GDB) 14.1
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
2af3791f44d9:/vol/template # /opt/riscv/bin/riscv64-unknown-elf-gdb --configuration
This GDB was configured as follows:
   configure --host=x86_64-pc-linux-gnu --target=riscv64-unknown-elf
             --with-auto-load-dir=$debugdir:$datadir/auto-load
             --with-auto-load-safe-path=$debugdir:$datadir/auto-load
             --with-expat
             --with-gdb-datadir=/opt/riscv/share/gdb (relocatable)
             --with-jit-reader-dir=/opt/riscv/lib/gdb (relocatable)
             --without-libunwind-ia64
             --without-lzma
             --without-babeltrace
             --without-intel-pt
             --without-xxhash
             --without-python
             --without-python-libdir
             --without-debuginfod
             --with-curses
             --without-guile
             --without-amd-dbgapi
             --disable-source-highlight
             --enable-threading
             --enable-tui
             --without-system-readline
             --with-separate-debug-dir=/opt/riscv/lib/debug (relocatable)

("Relocatable" means the directory can be moved with the GDB installation
tree, and GDB will still find it.)
kingsumos commented 6 months ago

BTW, below are the errors shown by dwarfdump for the broken elf file:

ERROR: on getting fde details for fde row for address 0x800010cc: DW_DLE_DF_FRAME_DECODING_ERROR:  instr opcode 0x3c unknown
ERROR: Printing fde 129 fails. Error DW_DLE_DF_FRAME_DECODING_ERROR:  instr opcode 0x3c unknown
ERROR: printing fdes fails. DW_DLE_DF_FRAME_DECODING_ERROR:  instr opcode 0x3c unknown  Attempting to continue.