sdk-ng icon indicating copy to clipboard operation
sdk-ng copied to clipboard

[GDB Client/Server] Coredump.bin decoding error

Open Kwangbaek opened this issue 4 months ago • 0 comments

Hi folks,

This problem(the script, 'scripts/coredump/coredump_gdbserver.py', seems to have difficulty in decoding a coredump.bin, especially for riscv64 architecture.) happened when I tried to run a gdb client and it doesn't show any information(no stack, the program is not being run.).

My environment and reproduction steps are as follows.

*. Environments - OS : Ubuntu_22.04.4 - Zephyr : 3.6.99 - Zephyr SDK : 0.16.5-1

*. Reproduction steps

  1. Modify source code "$ZEPHYR_BASE/samples/hello_world/src/main.c" image

  2. enable COREDUMP "$ZEPHYR_BASE/samples/hello_world/prj.conf" image

  3. build the example and run it on QEMU $ cd $ZEPHYR_BASE $ mkdir build-example $ cd build-example $ cmake -DBOARD=qemu_riscv32 $ZEPHYR_BASE/samples/hello_world $ make $ make run

  4. save the output from serial("coredump.txt") and convert it into a coredump binary("coredump.bin") by runnig a coredump parser script

    1. $ZEPHYR_BASE/scripts/coredump/coredump_serial_log_parser.py coredump.txt coredump.bin
  5. run a coredump gdb server on one terminal & a gdb client on the other terminal

  • on one terminsl, $ZEPHYR_BASE/scripts/coredump/coredump_gdbserver.py zephyr/zephyr.elf coredump.bin
  • on the other terminal, $ZEPHYR_SDK_BASE/riscv64-zephyr-elf/bin/riscv64-zephyr-elf-gdb zephyr/zephyr.elf
  1. GDB client screen shot image

Kind regards,

Kevin

Kwangbaek avatar Apr 04 '24 05:04 Kwangbaek