Debugging OpenSSL in CLion - cannot find symbols

I've successfully built a debug version of OpenSSL on Ubuntu 16. I'm using CLion and am testing certificate validation. After rebuilding and re-linking the C project and stepping to the OpenSSL API calls (ex X509_verify_cert), the code jumps to disassembly, not source level debugging.

I'm not sure what other config options I need to set for the debugger to find the symbols.

0
1 comment
Avatar
Permanently deleted user

Happened to me also. Here's what I've done:

  1. Don't forget to build your OpenSSL with '-g3' option in CFLAGS, CCFLAGS, CXXFLAGS and CPPFLAGS if you're using gcc.
  2. Don't move around your OpenSSL source code. The source code path is hardcoded into the debug symbols.
  3. Debug your project in CLion with LD_LIBRARY_PATH environment variable set to the path (containing directory) of your OpenSSL debug build (the one that has '.so' files inside). If it is a dynamically loaded library, it doesn't matter if you link your project with the system/release version of the lib. You have to set the LD_LIBRARY_PATH.
  4. 'Step into' and 'breakpoint' the OpenSSL's C source code from your project should now works.
1

Please sign in to leave a comment.