Skip to content

Commit f10e4b6

Browse files
committed
Handle showing multi-source line code
1 parent 143435d commit f10e4b6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/MIDebugEngine/AD7.Impl/AD7Disassembly.cs

+5-1
Original file line numberDiff line numberDiff line change
@@ -213,11 +213,15 @@ public int Read(uint dwInstructions, enum_DISASSEMBLY_STREAM_FIELDS dwFields, ou
213213

214214
if ((dwFields & enum_DISASSEMBLY_STREAM_FIELDS.DSF_POSITION) != 0 && currentLine != 0)
215215
{
216+
// If we have a new line and the current line is greater than the previously seen source line.
217+
// Try to grab the last seen source line + 1 and show a group of source code.
218+
// Else, just show the single line.
219+
uint startLine = isNewLine && currentLine > _dwLastSourceLine ? _dwLastSourceLine + 1 : currentLine;
216220

217221
prgDisassembly[iOp].dwFields |= enum_DISASSEMBLY_STREAM_FIELDS.DSF_POSITION;
218222
prgDisassembly[iOp].posBeg = new TEXT_POSITION()
219223
{
220-
dwLine = currentLine,
224+
dwLine = startLine,
221225
dwColumn = 0
222226
};
223227
prgDisassembly[iOp].posEnd = new TEXT_POSITION()

0 commit comments

Comments
 (0)