Skip to content

Commit c68d1f2

Browse files
committed
decoupled the native side from DI/ER env vars to support HandsOff Config
1 parent f25ccc4 commit c68d1f2

File tree

4 files changed

+1
-45
lines changed

4 files changed

+1
-45
lines changed

tracer/src/Datadog.Tracer.Native/debugger_environment_variables.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,6 @@ namespace environment
1616
const WSTRING internal_instrument_all_lines_enabled = WStr("DD_INTERNAL_DEBUGGER_INSTRUMENT_ALL_LINES");
1717
const WSTRING internal_instrument_all_lines_path = WStr("DD_INTERNAL_DEBUGGER_INSTRUMENT_ALL_LINES_PATH");
1818

19-
// Determines if the Dynamic Instrumentation (aka live debugger) is enabled.
20-
const WSTRING dynamic_instrumentation_enabled = WStr("DD_DYNAMIC_INSTRUMENTATION_ENABLED");
21-
22-
// Determines if the Exception Replay product is enabled.
23-
const WSTRING exception_debugging_enabled = WStr("DD_EXCEPTION_DEBUGGING_ENABLED"); // Old name
24-
const WSTRING exception_replay_enabled = WStr("DD_EXCEPTION_REPLAY_ENABLED");
25-
2619
} // namespace environment
2720
} // namespace debugger
2821

tracer/src/Datadog.Tracer.Native/debugger_environment_variables_util.cpp

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,6 @@
44
namespace debugger
55
{
66

7-
bool IsDynamicInstrumentationEnabled()
8-
{
9-
CheckIfTrue(GetEnvironmentValue(environment::dynamic_instrumentation_enabled));
10-
}
11-
12-
bool IsExceptionReplayEnabled()
13-
{
14-
static int sValue = -1;
15-
if (sValue == -1)
16-
{
17-
const auto old_exception_replay_flag = GetEnvironmentValue(environment::exception_debugging_enabled);
18-
const auto new_exception_replay_flag = GetEnvironmentValue(environment::exception_replay_enabled);
19-
sValue = (IsTrue(old_exception_replay_flag) || IsTrue(new_exception_replay_flag)) ? 1 : 0;
20-
}
21-
22-
return sValue == 1;
23-
}
24-
257
bool IsDebuggerInstrumentAllEnabled()
268
{
279
CheckIfTrue(GetEnvironmentValue(environment::internal_instrument_all_enabled));

tracer/src/Datadog.Tracer.Native/debugger_probes_instrumentation_requester.cpp

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -330,19 +330,6 @@ DebuggerProbesInstrumentationRequester::DebuggerProbesInstrumentationRequester(
330330
m_work_offloader(work_offloader),
331331
m_fault_tolerant_method_duplicator(fault_tolerant_method_duplicator)
332332
{
333-
auto diEnabled = IsDynamicInstrumentationEnabled();
334-
if (diEnabled == false)
335-
{
336-
Logger::Debug("Dynamic Instrumentation is disabled");
337-
}
338-
339-
auto erEnabled = IsExceptionReplayEnabled();
340-
if (erEnabled == false)
341-
{
342-
Logger::Debug("Exception Replay is explicitly disabled");
343-
}
344-
345-
is_debugger_or_exception_debugging_enabled = diEnabled || erEnabled;
346333
}
347334

348335
void DebuggerProbesInstrumentationRequester::RemoveProbes(debugger::DebuggerRemoveProbesDefinition* removeProbes,
@@ -1027,13 +1014,8 @@ void DebuggerProbesInstrumentationRequester::ModuleLoadFinished_AddMetadataToMod
10271014

10281015
HRESULT STDMETHODCALLTYPE DebuggerProbesInstrumentationRequester::ModuleLoadFinished(const ModuleID moduleId)
10291016
{
1030-
if (!is_debugger_or_exception_debugging_enabled)
1031-
{
1032-
return S_OK;
1033-
}
1034-
10351017
// IMPORTANT: The call to `ModuleLoadFinished_AddMetadataToModule` must be in `ModuleLoadFinished` as mutating the
1036-
// layout of types is only feasible prior the type is loaded.s
1018+
// layout of types is only feasible prior the type is loaded.
10371019
ModuleLoadFinished_AddMetadataToModule(moduleId);
10381020
RequestRejitForLoadedModule(moduleId);
10391021
return S_OK;

tracer/src/Datadog.Tracer.Native/debugger_probes_instrumentation_requester.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ class DebuggerProbesInstrumentationRequester
4040
std::shared_ptr<RejitHandler> m_rejit_handler = nullptr;
4141
std::shared_ptr<RejitWorkOffloader> m_work_offloader = nullptr;
4242
std::shared_ptr<fault_tolerant::FaultTolerantMethodDuplicator> m_fault_tolerant_method_duplicator = nullptr;
43-
bool is_debugger_or_exception_debugging_enabled = false;
4443
std::unordered_map<std::pair<std::string, mdToken>, std::vector<int>, pair_hash> explorationLineProbes;
4544
std::once_flag explorationLinesInitFlag;
4645

0 commit comments

Comments
 (0)