Skip to content
This repository has been archived by the owner on Nov 1, 2020. It is now read-only.

Commit

Permalink
FuncEval #1 - Introduce a DAC accessible global variable in the runti…
Browse files Browse the repository at this point in the history
…me to store the address of the method to be called in a FuncEval.

[tfs-changeset: 1645909]
  • Loading branch information
cshung committed Jan 27, 2017
1 parent 90ff87d commit c5fb9d4
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Native/Runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ set(COMMON_RUNTIME_SOURCES
CachedInterfaceDispatch.cpp
Crst.cpp
DebugEventSource.cpp
DebugFuncEval.cpp
dllmain.cpp
eetype.cpp
EHHelpers.cpp
Expand Down
18 changes: 18 additions & 0 deletions src/Native/Runtime/DebugFuncEval.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

#include "common.h"
#include "CommonTypes.h"
#include "DebugFuncEval.h"

GVAL_IMPL_INIT(UInt64, g_FuncEvalTarget, 0);

#ifndef DACCESS_COMPILE

void* DebugFuncEval::GetFuncEvalTarget()
{
return (void*)g_FuncEvalTarget;
}

#endif //!DACCESS_COMPILE
36 changes: 36 additions & 0 deletions src/Native/Runtime/DebugFuncEval.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
// -----------------------------------------------------------------------------------------------------------
// Support for evaluating expression in the debuggee during debugging
// -----------------------------------------------------------------------------------------------------------

#ifndef __DEBUG_FUNC_EVAL_H__
#define __DEBUG_FUNC_EVAL_H__

#include "common.h"
#include "CommonTypes.h"
#include "CommonMacros.h"
#include "daccess.h"

#ifndef DACCESS_COMPILE

class DebugFuncEval
{
public:
/// <summary>
/// Retrieve the global FuncEval target address
/// </summary>
/// <remarks>
/// During debugging, if a FuncEval is requested,
/// The func eval infrastructure needs to know which function to call, and
/// It will call this API to obtain the target address.
/// By the time, the value should have been set through the UpdateFuncEvalTarget() method
/// on the ISosRedhawk7 interface.
/// </remarks>
static void* GetFuncEvalTarget();
};

#endif //!DACCESS_COMPILE

#endif // __DEBUG_FUNC_EVAL_H__

0 comments on commit c5fb9d4

Please sign in to comment.