You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "xiaotailang (via GitHub)" <gi...@apache.org> on 2023/06/29 06:56:23 UTC

[GitHub] [nuttx] xiaotailang opened a new issue, #9645: how to debug elf

xiaotailang opened a new issue, #9645:
URL: https://github.com/apache/nuttx/issues/9645

   Hello everyone,
   
   I have compiled my application into an ELF file, for example, "myapp_elf", following the instructions in this [issue.](https://github.com/apache/nuttx/issues/2323), After downloading it to the development board, I want to debug this "myapp_elf" file. What configuration options should I add to support debugging ELF files? I have referred to this link for debugging [methods,](https://cwiki.apache.org/confluence/display/NUTTX/Debugging+ELF+Loadable+Modules) but it is not very convenient to use and sometimes results in errors. Are there any other better alternatives?


-- 
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-unsubscribe@nuttx.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nuttx] acassis commented on issue #9645: how to debug elf

Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis commented on issue #9645:
URL: https://github.com/apache/nuttx/issues/9645#issuecomment-1613097066

   Hi @xiaotailang please use these debug options:
   
   ```
   Build Setup  --->
       Debug Options  --->
       [*] Enable Debug Features
       [*]   Enable Error Output
       [*]     Enable Warnings Output
       [*]       Enable Informational Debug Output
   
   [*]   Binary Loader Debug Features
   [*]     Binary Loader Error Output
   [*]     Binary Loader Warnings Output
   [*]     Binary Loader Informational Output
   ```


-- 
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-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nuttx] xiaotailang commented on issue #9645: how to debug elf

Posted by "xiaotailang (via GitHub)" <gi...@apache.org>.
xiaotailang commented on issue #9645:
URL: https://github.com/apache/nuttx/issues/9645#issuecomment-1639163369

    Hi @acassis I followed the previous advice and enabled the debug configuration. After tracing, I discovered the issue causing my ELF file to fail loading. It was because I used global variables in my code, and the compilation options lacked "-fno-common". Later, when I used GDB to debug the ELF file "myapp_elf", I found that in most cases, breakpoints couldn't be triggered, and the "step" command couldn't enter function internals. However, I'm not sure if it's a problem with GDB or the compiled ELF file itself. The compilation options I used were "-Os" and "-g". I also tried the "-O0" and "-g" options, but if I compile the ELF with the "-O0" option, it results in an error when loading the ELF. Is there a complete method for debugging ELF files using 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-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nuttx] xiaotailang commented on issue #9645: how to debug elf

Posted by "xiaotailang (via GitHub)" <gi...@apache.org>.
xiaotailang commented on issue #9645:
URL: https://github.com/apache/nuttx/issues/9645#issuecomment-1617127081

   @acassis okay thank you very much !


-- 
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-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org