@@ -6158,21 +6158,6 @@ void Debugger::CalcActiveMask(rdcarray<bool> &activeMask)
6158
6158
return ;
6159
6159
}
6160
6160
6161
- ScopedDebugData *Debugger::FindScopedDebugData (const uint32_t instructionIndex) const
6162
- {
6163
- ScopedDebugData *scope = NULL ;
6164
- // Scopes are sorted with increasing minInstruction
6165
- for (ScopedDebugData *s : m_DebugInfo.scopedDebugDatas )
6166
- {
6167
- uint32_t scopeMinInstruction = s->minInstruction ;
6168
- if ((scopeMinInstruction <= instructionIndex) && (instructionIndex <= s->maxInstruction ))
6169
- scope = s;
6170
- else if (scopeMinInstruction > instructionIndex)
6171
- break ;
6172
- }
6173
- return scope;
6174
- }
6175
-
6176
6161
ScopedDebugData *Debugger::FindScopedDebugData (const DXIL::Metadata *md) const
6177
6162
{
6178
6163
for (ScopedDebugData *s : m_DebugInfo.scopedDebugDatas )
@@ -6205,7 +6190,6 @@ ScopedDebugData *Debugger::AddScopedDebugData(const DXIL::Metadata *scopeMD)
6205
6190
6206
6191
scope = new ScopedDebugData ();
6207
6192
scope->md = scopeMD;
6208
- scope->minInstruction = UINT32_MAX;
6209
6193
scope->maxInstruction = 0 ;
6210
6194
// File scope should not have a parent
6211
6195
if (scopeMD->dwarf ->type == DIBase::File)
@@ -6651,14 +6635,18 @@ void Debugger::ParseDebugData()
6651
6635
6652
6636
for (uint32_t i = 0 ; i < countInstructions; ++i)
6653
6637
{
6638
+ if (f->instructions [i]->debugLoc == ~0U )
6639
+ continue ;
6640
+
6654
6641
uint32_t instructionIndex = i + info.globalInstructionOffset ;
6655
6642
6656
6643
DXIL::Program::LocalSourceVariable localSrcVar;
6657
6644
localSrcVar.startInst = instructionIndex;
6658
6645
localSrcVar.endInst = instructionIndex;
6659
6646
6660
6647
// For each instruction - find which scope it belongs
6661
- const ScopedDebugData *scope = FindScopedDebugData (instructionIndex);
6648
+ const DebugLocation &debugLoc = m_Program->m_DebugLocations [f->instructions [i]->debugLoc ];
6649
+ const ScopedDebugData *scope = FindScopedDebugData (GetMDScope (debugLoc.scope ));
6662
6650
// track which mappings we've processed, so if the same variable has mappings in multiple
6663
6651
// scopes we only pick the innermost.
6664
6652
rdcarray<LocalMapping> processed;
@@ -7624,7 +7612,6 @@ ShaderDebugTrace *Debugger::BeginDebug(uint32_t eventId, const DXBC::DXBCContain
7624
7612
continue ;
7625
7613
7626
7614
currentScope = thisScope;
7627
- thisScope->minInstruction = RDCMIN (thisScope->minInstruction , instructionIndex);
7628
7615
thisScope->maxInstruction = instructionIndex;
7629
7616
// Walk upwards from this scope to find where to append to the scope hierarchy
7630
7617
{
0 commit comments