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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to