Open
Description
Environment:
uname -a
Linux ubuntu 5.15.0-25-generic #25-Ubuntu SMP Wed Mar 30 15:54:22 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Reproduce steps:
- Install tricore gcc:
sudo apt install 7zip
git clone https://github.com/volumit/tricore_gcc940_linux_bins.git
cd tricore_gcc940_linux_bins
7z x tricore_940_linux.zip.001
chmod -R 777 tricore_940_linux
echo "export TRICORE_GCC_PATH=$(pwd)/tricore_940_linux/bin" >> ~/.profile
- Build tricore qemu from source:
git clone https://github.com/volumit/qemu.git
cd qemu
git submodule update --init --progress
mkdir build
cd build
CC=gcc-9 CFLAGS=-Wno-error ../configure
make -j $(nproc)
echo "export TRICORE_QEMU_PATH=$(pwd)/build" >> ~/.profile
- Build tricore gdb
git clone https://github.com/volumit/gdb-tricore.git
cd gdb-tricore
CC=gcc-9 CFLAGS=-Wno-error ./configure --target=tricore-unknown-elf x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
make -j $(nproc)
echo "export TRICORE_GDB_PATH=$(pwd)/gdb" >> ~/.profile
- Build follow code with tricore gcc:
$TRICORE_GCC_PATH/tricore-elf-gcc -g -Wall -o build/c_demo.elf c_demo.c
#include <stdio.h>
int main(){
FILE* f = fopen("", "rb");
return f==NULL;
}
- Launch tricore qemu:
$TRICORE_QEMU_PATH/qemu-system-tricore -display none -M tricore_tsim161 -semihosting -S -s -kernel build/c_demo.elf
- Connect tricore gdb to qemu:
$TRICORE_GDB_PATH/gdb -data-directory $TRICORE_GDB_PATH/data-directory ./build/c_demo.elf
- Tricore gdb abort when continue debug:
Reading symbols from ./build/c_demo.elf...
(gdb) target remote :1234
Remote debugging using :1234
0x80000000 in _start ()
(gdb) run
The "remote" target does not support "run". Try "help target" or "continue".
(gdb) continue
Continuing.
Aborted (core dumped)
Metadata
Metadata
Assignees
Labels
No labels