Skip to content

Commit

Permalink
Disable optimizations and keep frame pointer when debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
amadio committed Nov 10, 2022
1 parent 3220bc9 commit b3193eb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions interpreter/cling/lib/Interpreter/CIFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1329,6 +1329,10 @@ namespace {
argvCompile.push_back("-fno-omit-frame-pointer");
#endif

// Disable optimizations and keep frame pointer when debugging
if (std::getenv("CLING_DEBUG"))
argvCompile.push_back("-O0 -fno-omit-frame-pointer");

// argv[0] already inserted, get the rest
argvCompile.insert(argvCompile.end(), argv+1, argv + argc);

Expand Down

0 comments on commit b3193eb

Please sign in to comment.