Skip to content

Commit

Permalink
Respect compileFlags.debug even if debugger is not compiled in
Browse files Browse the repository at this point in the history
Summary:
Currently, we ignore compileFlags.debug if the debugger is compiled out.

This is a problem for `emhermesc`, which sets the flag and serializes
the bundle. If debugger support is not built in, the resulting bundle
does not contain complete debug info. When loaded in a different
Hermes instance that *does* have debugger built in, it can't inspect
local variables due to missing lexical debug data.

Reviewed By: dulinriley

Differential Revision: D24524133

fbshipit-source-id: bf6320740881b4922ea0116951247582a997bde8
  • Loading branch information
willholen authored and facebook-github-bot committed Oct 30, 2020
1 parent 99ba680 commit 6058e22
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions lib/BCGen/HBC/BytecodeProviderFromSrc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,8 @@ BCProviderFromSrc::createBCProviderFromSrc(
context->setAllowFunctionToStringWithRuntimeSource(
compileFlags.allowFunctionToStringWithRuntimeSource);
context->setGeneratorEnabled(compileFlags.enableGenerator);
#ifdef HERMES_ENABLE_DEBUGGER
context->setDebugInfoSetting(
compileFlags.debug ? DebugInfoSetting::ALL : DebugInfoSetting::THROWING);
#else
context->setDebugInfoSetting(DebugInfoSetting::THROWING);
#endif
context->setEmitAsyncBreakCheck(compileFlags.emitAsyncBreakCheck);

// Populate the declFileList.
Expand Down

0 comments on commit 6058e22

Please sign in to comment.