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 :3333
   (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 <cmd_uname+0>:    entry   a1, 0x170
      0x4201a237 <cmd_uname+3>:    movi.n  a6, 0
      0x4201a239 <cmd_uname+5>:    s32i    a3, a1, 0x140
      0x4201a23c <cmd_uname+8>:    mov.n   a5, a2
      0x4201a23e <cmd_uname+10>:   mov.n   a3, a6
      0x4201a240 <cmd_uname+12>:   j       0x4201a290 <cmd_uname+92>
      0x4201a243 <cmd_uname+15>:   quou    a2, a2, a0
      0x4201a246 <cmd_uname+18>:   ee.vmulas.s8.accx.ld.ip.qup     q6, a9, 
0x1c0, q4, q2, q5, q7
      0x4201a24a <cmd_uname+22>:   bltu    a0, a3, 0x4201a2bf <cmd_uname+139>
      0x4201a24d <cmd_uname+25>:   call12  0x4208afe4
      0x4201a250 <cmd_uname+28>:   movi    a2, 40
      0x4201a253 <cmd_uname+31>:   movi    a0, 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

Reply via email to