Debugging 'apps' with gdb

87 views
Skip to first unread message

Michał Łyszczek

unread,
Mar 24, 2018, 4:46:50 PM3/24/18
to NuttX
Hi

I have nuttx up and running. I can start session with openocd + gdb and I can
step through kernel code with no problems. Now I have written an app and put
it inside "../apps" directory and of course I made a bug(s) in there. I wanted
to debug it with gdb and while I can add breakpoint to my foo_main() function
and gdb indeed stops there I cannot see the source file. The only thing I see
in gdb is "[ No Source Available ]". I have debug symbols enabled in Kconfig,
my 'nuttx' binary is 1.6M in size.

Am I missing something? Should I somehow enable debug for apps in different
way than for kernel itself? Has anyone managed to step through 'apps' code? Or
maybe it works out of box and my environment is somehow screwed up?

Thanks for any suggestions.

--
Best Regards
Michal Lyszczek
signature.asc

David Alessio

unread,
Mar 24, 2018, 5:30:15 PM3/24/18
to NuttX
Hi Michal,

You can examine the dir path GDB is using with:

show directories

and set the path with:

set directories path-list

where path-list is a list of ':' separated absolute paths

Cheers,
-david

patacongo

unread,
Mar 24, 2018, 5:35:31 PM3/24/18
to NuttX
I have never experienced anything like that.  I have always had symbols for code in apps/

I suspect this has something to do with how you added your application to the apps/ directory, but you provide no information.  What development platform are you using?  What kind of toolchain are you using?  How did you add the code to the apps/ directory?  Via a symbolic link?  Can GDB follow the symbolic links?

Michał Łyszczek

unread,
Mar 24, 2018, 6:29:38 PM3/24/18
to nu...@googlegroups.com, patacongo
sobota, 24 marca 2018 22:35:31 CET patacongo:
Well... this is embarrassing. I've checked another apps like 'hello' and they
do indeed work properly. I played with the building and tools a little bit and
that problem magically disappeared and unfortunately I don't know what really
caused this issue. I couldn't reproduce this anymore. Anyway, not a problem
with nuttx.
signature.asc
Reply all
Reply to author
Forward
0 new messages