Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
Introduce COMPlus_GDBJitEmitDebugFrame (#13515)
Browse files Browse the repository at this point in the history
* Introduce COMPlus_GDBJitEmitDebugFrame

* Use a proper #ifdef macro
  • Loading branch information
parjong authored and janvorli committed Aug 22, 2017
1 parent f0e8660 commit aed0665
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/inc/clrconfigvalues.h
Original file line number Diff line number Diff line change
Expand Up @@ -1059,6 +1059,9 @@ RETAIL_CONFIG_DWORD_INFO(INTERNAL_PerformanceTracing, W("PerformanceTracing"), 0
// GDBJIT
//
CONFIG_STRING_INFO(INTERNAL_GDBJitElfDump, W("GDBJitElfDump"), "Dump ELF for specified method")
#ifdef FEATURE_GDBJIT_FRAME
RETAIL_CONFIG_DWORD_INFO(INTERNAL_GDBJitEmitDebugFrame, W("GDBJitEmitDebugFrame"), TRUE, "Enable .debug_frame generation")
#endif
#endif

//
Expand Down
7 changes: 7 additions & 0 deletions src/vm/eeconfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,10 @@ HRESULT EEConfig::Init()
pszGDBJitElfDump = NULL;
#endif // FEATURE_GDBJIT && _DEBUG

#if defined(FEATURE_GDBJIT_FRAME)
fGDBJitEmitDebugFrame = false;
#endif

// After initialization, register the code:#GetConfigValueCallback method with code:CLRConfig to let
// CLRConfig access config files. This is needed because CLRConfig lives outside the VM and can't
// statically link to EEConfig.
Expand Down Expand Up @@ -1248,6 +1252,9 @@ HRESULT EEConfig::sync()
}
#endif // FEATURE_GDBJIT && _DEBUG

#if defined(FEATURE_GDBJIT_FRAME)
fGDBJitEmitDebugFrame = CLRConfig::GetConfigValue(CLRConfig::INTERNAL_GDBJitEmitDebugFrame) != 0;
#endif
return hr;
}

Expand Down
6 changes: 6 additions & 0 deletions src/vm/eeconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,9 @@ class EEConfig
}
#endif // FEATURE_GDBJIT && _DEBUG

#if defined(FEATURE_GDBJIT_FRAME)
inline bool ShouldEmitDebugFrame(void) const {LIMITED_METHOD_CONTRACT; return fGDBJitEmitDebugFrame;}
#endif // FEATURE_GDBJIT_FRAME
BOOL PInvokeRestoreEsp(BOOL fDefault) const
{
LIMITED_METHOD_CONTRACT;
Expand Down Expand Up @@ -1114,6 +1117,9 @@ class EEConfig
LPCUTF8 pszGDBJitElfDump;
#endif // FEATURE_GDBJIT && _DEBUG

#if defined(FEATURE_GDBJIT_FRAME)
bool fGDBJitEmitDebugFrame;
#endif
public:

HRESULT GetConfiguration_DontUse_(__in_z LPCWSTR pKey, ConfigSearch direction, __deref_out_opt LPCWSTR* value);
Expand Down
1 change: 1 addition & 0 deletions src/vm/gdbjit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2468,6 +2468,7 @@ void NotifyGdb::OnMethodPrepared(MethodDesc* methodDescPtr)
elfBuilder.Initialize(pCode, codeSize);

#ifdef FEATURE_GDBJIT_FRAME
if (g_pConfig->ShouldEmitDebugFrame())
{
bool bEmitted = EmitFrameInfo(elfBuilder, pCode, codeSize);
bNotify = bNotify || bEmitted;
Expand Down

0 comments on commit aed0665

Please sign in to comment.