Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start tracking debug info for inlined statements #61220

Merged
merged 7 commits into from
Nov 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/coreclr/inc/cordebuginfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class ICorDebugInfo
struct OffsetMapping
{
uint32_t nativeOffset;
uint32_t ilOffset;
uint32_t ilOffset; // IL offset or one of the special values in MappingTypes
SourceTypes source; // The debugger needs this so that
// we don't put Edit and Continue breakpoints where
// the stack isn't empty. We can put regular breakpoints
Expand Down
2 changes: 2 additions & 0 deletions src/coreclr/jit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ set( JIT_SOURCES
codegenlinear.cpp
compiler.cpp
copyprop.cpp
debuginfo.cpp
disasm.cpp
earlyprop.cpp
ee_il_dll.cpp
Expand Down Expand Up @@ -178,6 +179,7 @@ if (CLR_CMAKE_TARGET_WIN32)
compmemkind.h
compphases.h
dataflow.h
debuginfo.h
decomposelongs.h
disasm.h
emit.h
Expand Down
17 changes: 9 additions & 8 deletions src/coreclr/jit/codegen.h
Original file line number Diff line number Diff line change
Expand Up @@ -434,10 +434,10 @@ class CodeGen final : public CodeGenInterface
CORINFO_METHOD_HANDLE methHnd,
INDEBUG_LDISASM_COMMA(CORINFO_SIG_INFO* sigInfo)
void* addr
X86_ARG(int argSize),
X86_ARG(int argSize),
emitAttr retSize
MULTIREG_HAS_SECOND_GC_RET_ONLY_ARG(emitAttr secondRetSize),
IL_OFFSETX ilOffset,
const DebugInfo& di,
regNumber base,
bool isJump);
// clang-format on
Expand All @@ -447,10 +447,10 @@ class CodeGen final : public CodeGenInterface
CORINFO_METHOD_HANDLE methHnd,
INDEBUG_LDISASM_COMMA(CORINFO_SIG_INFO* sigInfo)
GenTreeIndir* indir
X86_ARG(int argSize),
X86_ARG(int argSize),
emitAttr retSize
MULTIREG_HAS_SECOND_GC_RET_ONLY_ARG(emitAttr secondRetSize),
IL_OFFSETX ilOffset,
const DebugInfo& di,
bool isJump);
// clang-format on

Expand Down Expand Up @@ -552,15 +552,16 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
*/

#ifdef DEBUG
void genIPmappingDisp(unsigned mappingNum, Compiler::IPmappingDsc* ipMapping);
void genIPmappingDisp(unsigned mappingNum, IPmappingDsc* ipMapping);
void genIPmappingListDisp();
#endif // DEBUG

void genIPmappingAdd(IL_OFFSETX offset, bool isLabel);
void genIPmappingAddToFront(IL_OFFSETX offset);
IPmappingDsc* genCreateIPMapping(IPmappingDscKind kind, const DebugInfo& di, bool isLabel);
void genIPmappingAdd(IPmappingDscKind kind, const DebugInfo& di, bool isLabel);
void genIPmappingAddToFront(IPmappingDscKind kind, const DebugInfo& di, bool isLabel);
void genIPmappingGen();

void genEnsureCodeEmitted(IL_OFFSETX offsx);
void genEnsureCodeEmitted(const DebugInfo& di);

//-------------------------------------------------------------------------
// scope info for the variables
Expand Down
5 changes: 2 additions & 3 deletions src/coreclr/jit/codegenarm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1632,8 +1632,7 @@ void CodeGen::genEmitHelperCall(unsigned helper, int argSize, emitAttr retSize,
GetEmitter()->emitIns_Call(emitter::EC_INDIR_R, compiler->eeFindHelper(helper),
INDEBUG_LDISASM_COMMA(nullptr) NULL, // addr
argSize, retSize, gcInfo.gcVarPtrSetCur, gcInfo.gcRegGCrefSetCur,
gcInfo.gcRegByrefSetCur,
BAD_IL_OFFSET, // ilOffset
gcInfo.gcRegByrefSetCur, DebugInfo(),
callTargetReg, // ireg
REG_NA, 0, 0, // xreg, xmul, disp
false // isJump
Expand All @@ -1643,7 +1642,7 @@ void CodeGen::genEmitHelperCall(unsigned helper, int argSize, emitAttr retSize,
{
GetEmitter()->emitIns_Call(emitter::EC_FUNC_TOKEN, compiler->eeFindHelper(helper),
INDEBUG_LDISASM_COMMA(nullptr) addr, argSize, retSize, gcInfo.gcVarPtrSetCur,
gcInfo.gcRegGCrefSetCur, gcInfo.gcRegByrefSetCur, BAD_IL_OFFSET, REG_NA, REG_NA, 0,
gcInfo.gcRegGCrefSetCur, gcInfo.gcRegByrefSetCur, DebugInfo(), REG_NA, REG_NA, 0,
0, /* ilOffset, ireg, xreg, xmul, disp */
false /* isJump */
);
Expand Down
7 changes: 3 additions & 4 deletions src/coreclr/jit/codegenarm64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3846,10 +3846,9 @@ void CodeGen::genEmitHelperCall(unsigned helper, int argSize, emitAttr retSize,

GetEmitter()->emitIns_Call(callType, compiler->eeFindHelper(helper), INDEBUG_LDISASM_COMMA(nullptr) addr, argSize,
retSize, EA_UNKNOWN, gcInfo.gcVarPtrSetCur, gcInfo.gcRegGCrefSetCur,
gcInfo.gcRegByrefSetCur, BAD_IL_OFFSET, /* IL offset */
callTarget, /* ireg */
REG_NA, 0, 0, /* xreg, xmul, disp */
false /* isJump */
gcInfo.gcRegByrefSetCur, DebugInfo(), callTarget, /* ireg */
REG_NA, 0, 0, /* xreg, xmul, disp */
false /* isJump */
);

regMaskTP killMask = compiler->compHelperCallKillSet((CorInfoHelpFunc)helper);
Expand Down
18 changes: 8 additions & 10 deletions src/coreclr/jit/codegenarmarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2463,16 +2463,14 @@ void CodeGen::genCallInstruction(GenTreeCall* call)
}
}

// We need to propagate the IL offset information to the call instruction, so we can emit
DebugInfo di;
// We need to propagate the debug information to the call instruction, so we can emit
// an IL to native mapping record for the call, to support managed return value debugging.
// We don't want tail call helper calls that were converted from normal calls to get a record,
// so we skip this hash table lookup logic in that case.

IL_OFFSETX ilOffset = BAD_IL_OFFSET;

if (compiler->opts.compDbgInfo && compiler->genCallSite2ILOffsetMap != nullptr && !call->IsTailCall())
if (compiler->opts.compDbgInfo && compiler->genCallSite2DebugInfoMap != nullptr && !call->IsTailCall())
{
(void)compiler->genCallSite2ILOffsetMap->Lookup(call, &ilOffset);
(void)compiler->genCallSite2DebugInfoMap->Lookup(call, &di);
}

CORINFO_SIG_INFO* sigInfo = nullptr;
Expand Down Expand Up @@ -2512,7 +2510,7 @@ void CodeGen::genCallInstruction(GenTreeCall* call)
nullptr, // addr
retSize
MULTIREG_HAS_SECOND_GC_RET_ONLY_ARG(secondRetSize),
ilOffset,
di,
target->GetRegNum(),
call->IsFastTailCall());
// clang-format on
Expand Down Expand Up @@ -2552,7 +2550,7 @@ void CodeGen::genCallInstruction(GenTreeCall* call)
nullptr, // addr
retSize
MULTIREG_HAS_SECOND_GC_RET_ONLY_ARG(secondRetSize),
ilOffset,
di,
targetAddrReg,
call->IsFastTailCall());
// clang-format on
Expand Down Expand Up @@ -2600,7 +2598,7 @@ void CodeGen::genCallInstruction(GenTreeCall* call)
INDEBUG_LDISASM_COMMA(sigInfo)
NULL,
retSize,
ilOffset,
di,
tmpReg,
call->IsFastTailCall());
// clang-format on
Expand All @@ -2615,7 +2613,7 @@ void CodeGen::genCallInstruction(GenTreeCall* call)
addr,
retSize
MULTIREG_HAS_SECOND_GC_RET_ONLY_ARG(secondRetSize),
ilOffset,
di,
REG_NA,
call->IsFastTailCall());
// clang-format on
Expand Down
Loading