[HELP] disassemble output of xtensa gdb is not understandable
- Dominant language
- C
- Stars
- 4k
- Forks
- 1.7k
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 237
Description
### Description
This might be an esp32 toolchain issue, but I don't know where to post bug report for it, so record it here first.
After build a config such as `esp32s3-devkit:nsh`, and then use gdb to open the elf file,
`xtensa-esp32s3-elf-gdb nuttx`, and disassemble a function like `cmd_uname`:
```
(gdb) disassemble /r cmd_uname
Dump of assembler code for function cmd_uname:
0x4201a234 <+0>: 02e136 entry a1, 0x170
0x4201a237 <+3>: 060c movi.n a6, 0
0x4201a239 <+5>: 506132 s32i a3, a1, 0x140
0x4201a23c <+8>: 025d mov.n a5, a2
0x4201a23e <+10>: 063d mov.n a3, a6
0x4201a240 <+12>: 001306 j 0x4201a290
0x4201a243 <+15>: c22200 quou a2, a2, a0
0x4201a246 <+18>: 27571c9f ee.vmulas.s8.accx.ld.ip.qup q6, a9, 0x1c0, q4, q2, q5, q7
0x4201a24a <+22>: 713037 bltu a0, a3, 0x4201a2bf
0x4201a24d <+25>: 70d975 call12 0x4208afe4
...
```
You will find that some assemble instruction such as the `ee.vmulas.s8.accx.ld.ip.qup` above is not correct. The function `cmd_uname` just only deals with string operation, so it should only involve instructions to load, store, etc.
I believe this is related to a technology named **FLIX (Flexible Length Instruction Xtensions)**, which the esp32 toolchain doesnot handled properly. But it did it correctly from source to object, so the function can get right result.
The only problem here is from object to source, this will introduce trouble when debugging.
For the FLIX tech, you can find some info here: https://www.cadence.com/content/dam/cadence-www/global/en_US/documents/tools/silicon-solutions/compute-ip/tip-flix-wp.pdf
Update 04/24: from the current findings, it appears that the ESP32 case here is not FLIX instruction, but caused by padding in code section.
### Verification
- [x] I have verified before submitting the report.
Contributor guide
Assessment
This issue has not been assessed yet.