TriCore: writing to registers is not working (as it's supposed to)
Host environment
- Operating system: Windows 10
- QEMU flavor: qemu-system-tricore
- QEMU emulator version: 7.1.90 (v7.2.0-rc0-11935-gffa732b268-dirty)
- QEMU command line:
qemu-system-tricore.exe -gdb tcp::2013 -kernel sample.elf -M KIT_AURIX_TC277_TRB -cpu tc27x -S -singlestep
- sample.elf
Emulated/Virtualized environment
- Operating system: None; bare-metal application.
- Architecture: Tricore
Description of problem
Reading the tricore register list from QEMU works just fine. However, writing this registers is not working as expected. It looks like the bug is on QEMU's side, since third party gdb client faces the same issues.
Additional information/bug reproduction
Example of "bug" that I have observed:
I 003 GDB:-> $G78563412888888880000000000000000000000000000000000000000000000000000000000000000085000D0F00300A0000000000000000000000000001000D00000000000000000100000A000000000000000000000000000000000000000000000000000000000085000D0F00300A0000000000000000000000000001000D000000D003E000D003F004D0081090000E40400A000000000085400D0001001A0000001A0000000000000000000000000#78
I 003 GDB:<- +$OK#9a
I 003 GDB:-> +
I 003 GDB:-> $g#67
I 003 GDB:<- +$0000000000000000100000a000000000000000000000000000000000000000000000000000000000085000d0f00300a0000000000000000000000000001000d00000000000000000100000a000000000000000000000000000000000000000000000000000000000085000d0f00300a0000000000000000000000000001000
I 003 GDB:<- d000000d003e000d003f004d0081090000e40400a000000000085400d0001001a0000001a0000000000000000000000000#5f
I 003 GDB:-> +
In the example above I send to gdb command "G" + data which is a command to write all registers(general purpose), and right after that command I read registers back with "g" command. This data should match one to one, but as we can see, response from qemu is different. Furthermore, if I write to register A0, register D0 will be assigned with that value, if I then write to any other register, D0 will have the original value again. In case you are wondering why I am using "G" command to write all registers instead of "P"(write only one register) it is because write to single register is not supported:
I 003 GDB:-> $P10=7856341200000000#12
I 003 GDB:<- +$#00