grisp-software icon indicating copy to clipboard operation
grisp-software copied to clipboard

Debugging symbols missing when trying to debug the beam with gdb and supports script.

Open sylane opened this issue 8 years ago • 4 comments

I was trying to debug using openocd and using the gdb commands provided by OTP: erts/etc/unix/etp-commands.

The commands require a set of symbols to be defined (the etp_XXX defined in erts/emulator/beam/erl_init.c) but they are not. I wonder if the issue is due to the compiler optimizing them out or any special cross-build issue.

sylane avatar Dec 07 '17 19:12 sylane

Hmm, depends what etp_XXX is for. It might also be part of a build that uses threads or supports smp which we don´t do for default at the moment.

peerst avatar Dec 07 '17 19:12 peerst

They are defined in erts/emulator/beam/erl_ini.c, with the entry point of the beam... I don't see why we wouldn't have it.

sylane avatar Dec 07 '17 20:12 sylane

And looking at the generated object symbols, it contains a erl_init one...

sylane avatar Dec 07 '17 20:12 sylane

RTEMS uses a method where the compiler puts every function into its own section and then at the linking phase garbage collects sections that are not referenced. This could cause functions to be removed if they are not referenced from the program.

peerst avatar Dec 08 '17 16:12 peerst