CoreNeuron icon indicating copy to clipboard operation
CoreNeuron copied to clipboard

debug symbols not properly resolved in libcorenrnmech.dylib

Open ohm314 opened this issue 1 year ago • 0 comments

Describe the issue

While trying to debug a coreneuron (debug) build on macos I noticed that for symbols inside libcorenrnmech.dylib I could not see associated source code, neither could I set breakpoints to source lines. It seems that ld producing the dylib file partially strips the object files and relies on them still being available for the debugger to find source code information.

To Reproduce

  • Build NEURON and CoreNEURON:
  • Run the debugger and try to set a breakpoint on a source line.

Expected behavior The source annotation for the symbols should be at least in the debug build available

System (please complete the following information)

  • OS: macos
  • Compiler: LLVM 13
  • Version: master branch

A possible workaround

--- a/extra/nrnivmodl_core_makefile.in
+++ b/extra/nrnivmodl_core_makefile.in
@@ -227,7 +227,7 @@ coremech_lib_shared: $(ALL_OBJS) $(ENGINEMECH_OBJ) build_always
                $(LDFLAGS) ${SONAME_OPTION} \
                -Wl,-rpath,$(CORENRN_LIB_DIR) -L$(CORENRN_LIB_DIR)
        # cleanup
-       rm $(MOD_OBJS_DIR)/libcoreneuron-core/*.o
+       #rm $(MOD_OBJS_DIR)/libcoreneuron-core/*.o

 # build static library of mechanisms
 coremech_lib_static: $(ALL_OBJS) $(ENGINEMECH_OBJ) build_always

ohm314 avatar Oct 19 '22 09:10 ohm314