Re: [I] [HELP] disassemble output of xtensa gdb is not understandable [nuttx]
chirping78 commented on issue #16235: URL: https://github.com/apache/nuttx/issues/16235#issuecomment-2829258858 > [@chirping78](https://github.com/chirping78) , regarding [#16255 (comment)](https://github.com/apache/nuttx/pull/16255#issuecomment-2826294591), can you please share which ESP-IDF version you are using? > > I couldn't reproduce the exact behavior: both gdb and objdump output show the same output (the same of `gdb` in your example). @tmedicci I have tried two versions of `objdump` (`xtensa-esp32s3-elf-objdump --version`). One is installed by idf, with version `GNU objdump (crosstool-NG esp-13.2.0_20240305) 2.41`. Another is same from the NuttX CI, version `GNU objdump (crosstool-NG esp-12.2.0_20230208) 2.39.0.20220915`. Both can disassemble correctly the `call_start_cpu1` function of the hello world project. And checked the script `hello_world/build/esp-idf/esp_system/ld/sections.ld`, it has the section you added in PR https://github.com/apache/nuttx/pull/16255 ``` 707 /** 708* This section will be used by the debugger and disassembler to get more 709* information about raw data present in the code. 710* Indeed, it may be required to add some padding at some points in the code 711* in order to align a branch/jump destination on a particular bound. 712* Padding these instructions will generate null bytes that shall be 713* interpreted as data, and not code by the debugger or disassembler. 714* This section will only be present in the ELF file, not in the final binary 715* For more details, check GCC-212 716*/ 717 .xt.prop 0 : 718 { 719 KEEP (*(.xt.prop .gnu.linkonce.prop.*)) 720 } 721 .xt.lit 0 : 722 { 723 KEEP (*(.xt.lit .gnu.linkonce.p.*)) 724 } ``` you can check you idf project to see whether it has this part. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [I] [HELP] disassemble output of xtensa gdb is not understandable [nuttx]
tmedicci commented on issue #16235: URL: https://github.com/apache/nuttx/issues/16235#issuecomment-2827603273 @chirping78 , regarding https://github.com/apache/nuttx/pull/16255#issuecomment-2826294591, can you please share which ESP-IDF version you are using? I couldn't reproduce the exact behavior: both gdb and objdump output show the same output (the same of `gdb` in your example). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [I] [HELP] disassemble output of xtensa gdb is not understandable [nuttx]
tmedicci commented on issue #16235: URL: https://github.com/apache/nuttx/issues/16235#issuecomment-2827597867 Reopening the issue because the issue is still valid for gdb. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [I] [HELP] disassemble output of xtensa gdb is not understandable [nuttx]
acassis closed issue #16235: [HELP] disassemble output of xtensa gdb is not understandable URL: https://github.com/apache/nuttx/issues/16235 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [I] [HELP] disassemble output of xtensa gdb is not understandable [nuttx]
chirping78 commented on issue #16235: URL: https://github.com/apache/nuttx/issues/16235#issuecomment-2826136441 > Can you please evaluate [#16255](https://github.com/apache/nuttx/pull/16255)? @tmedicci, my test shows that `objdump` is OK now, but `gdb` still has problem. This has already made great progress, but if gdb doesn't work, people who using gdb needs to open two windows to debug. Please check details at PR #16255 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [I] [HELP] disassemble output of xtensa gdb is not understandable [nuttx]
tmedicci commented on issue #16235: URL: https://github.com/apache/nuttx/issues/16235#issuecomment-2824545639 > [@tmedicci](https://github.com/tmedicci) Could you reproduce the issue I reported here? If yes, could you direct this problem to some one working on esp toolchain? Can you please evaluate https://github.com/apache/nuttx/pull/16255? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [I] [HELP] disassemble output of xtensa gdb is not understandable [nuttx]
tmedicci commented on issue #16235: URL: https://github.com/apache/nuttx/issues/16235#issuecomment-2824221202 Hi @chirping78, thanks for reporting it. I'll forward this issue and keep checking it. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [I] [HELP] disassemble output of xtensa gdb is not understandable [nuttx]
chirping78 commented on issue #16235: URL: https://github.com/apache/nuttx/issues/16235#issuecomment-2822950412 @tmedicci Could you reproduce the issue I reported here? If yes, could you direct this problem to some one working on esp toolchain? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [I] [HELP] disassemble output of xtensa gdb is not understandable [nuttx]
chirping78 commented on issue #16235: URL: https://github.com/apache/nuttx/issues/16235#issuecomment-2814404279 As a comparison, here is the disassemble output of xt-clang/xt-gdb, toolchain from cadence, used in a product embedded a hifi4 dsp (which is also LX7 arch based): ``` (xt-gdb) disassemble /r cmd_uname Dump of assembler code for function cmd_uname: 0x2cd0f1d4 <+0>: 36 21 03entry a1, 0x190 0x2cd0f1d7 <+3>: 2e c1 00 0f 19 e0 { s32i a2, a1, 48; movi a15, 0 } 0x2cd0f1dd <+9>: 2e 4d 03 15 07 fd { l32r a2, 0x2cceb714 <_stext+5756> (0x2ce95ac0); mov.na5, a3 } 0x2cd0f1e3 <+15>:6e 50 00 18 07 e0 { l32r a6, 0x2cceb724 <_stext+5772> (0x2ce959d0 <__switchjump_table_xp_temp_9_0>); movia8, 0 } 0x2cd0f1e9 <+21>:fe d1 6c 07 19 e0 { s32i a15, a1, 52; movi a7, 108 } 0x2cd0f1ef <+27>:ae 95 04 0b 26 fd { mov.n a10, a5; mov.n a11, a4 } 0x2cd0f1f5 <+33>:3e 98 02 0c 26 fd { mov.n a3, a8; mov.n a12, a2 } 0x2cd0f1fb <+39>:65 cc f4call8 0x2cd03ec0 ... ``` You can see from the disassemble that: - the instructions between curly brace is the so-called FLIX instruction mentioned above - after set some registers, `cmd_uname` calls `getopt` first, which match with the source code -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [I] [HELP] disassemble output of xtensa gdb is not understandable [nuttx]
chirping78 commented on issue #16235: URL: https://github.com/apache/nuttx/issues/16235#issuecomment-2814452848 Here is the 3rd evidence (recall that the 1st is disassemble of esp32 gdb and objdump, and 2nd is disassemble of cadence toolchain), this is more serious than first twos. Open three terminals: 1. use minicom to access nsh 2. use openocd to setup gdbserver `openocd -c 'set ESP_RTOS none;set ESP_FLASH_SIZE 0' -f board/esp32s3-builtin.cfg` 3. use gdb to debug `xtensa-esp32s3-elf-gdb nuttx` ``` (gdb) target remote : (gdb) b cmd_uname (gdb) c ``` run `uname -a` to trigger the breakpoint set bp at `getopt` then finish from `getopt` ``` (gdb) tb getopt (gdb) c (gdb) finish ``` step two instructions, show pc is `0x4201a244` ``` (gdb) si (gdb) si (gdb) p/x $pc $17 = 0x4201a244 ``` But, ***you can find `0x4201a244` does not match with disassemble***, there is no instruction at `0x4201a244` ``` (gdb) disassemble cmd_uname, cmd_uname+32 Dump of assembler code from 0x4201a234 to 0x4201a254: 0x4201a234 :entry a1, 0x170 0x4201a237 :movi.n a6, 0 0x4201a239 :s32ia3, a1, 0x140 0x4201a23c :mov.n a5, a2 0x4201a23e : mov.n a3, a6 0x4201a240 : j 0x4201a290 0x4201a243 : quoua2, a2, a0 0x4201a246 : ee.vmulas.s8.accx.ld.ip.qup q6, a9, 0x1c0, q4, q2, q5, q7 0x4201a24a : bltua0, a3, 0x4201a2bf 0x4201a24d : call12 0x4208afe4 0x4201a250 : movia2, 40 0x4201a253 : movia0, 2 End of assembler dump. (gdb) ``` This means the gdb can't be used to do serious debugging. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [I] [HELP] disassemble output of xtensa gdb is not understandable [nuttx]
chirping78 commented on issue #16235: URL: https://github.com/apache/nuttx/issues/16235#issuecomment-2814381183 > What is the opcode after disassemble? Are the instructions after using xtensa-esp32s3-elf-objdump consistent with those shown in gdb? @anchao updated the main post with `disassemble /r` which shows the opcode. Here is the objdump output, you can see that it shows the same result as gdb: ``` 4201a234 : 4201a234: 02e136 entry a1, 0x170 4201a237: 060cmovi.n a6, 0 4201a239: 506132 s32ia3, a1, 0x140 4201a23c: 025dmov.n a5, a2 4201a23e: 063dmov.n a3, a6 4201a240: 001306 j 4201a290 4201a243: c22200 quoua2, a2, a0 4201a246: 27571c9fee.vmulas.s8.accx.ld.ip.qup q6, a9, 0x1c0, q4, q2, q5, q7 4201a24a: 713037 bltua0, a3, 4201a2bf 4201a24d: 70d975 call12 4208afe4 <_etext+0x68137> ... ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [I] [HELP] disassemble output of xtensa gdb is not understandable [nuttx]
anchao commented on issue #16235: URL: https://github.com/apache/nuttx/issues/16235#issuecomment-2813386204 What is the opcode after disassemble? Are the instructions after using xtensa-esp32s3-elf-objdump consistent with those shown in gdb? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org