Skip to content

Commit

Permalink
Handle showing multi-source line code
Browse files Browse the repository at this point in the history
  • Loading branch information
WardenGnaw committed Nov 23, 2021
1 parent f74c640 commit 2f7a529
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/MIDebugEngine/AD7.Impl/AD7Disassembly.cs
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,15 @@ public int Read(uint dwInstructions, enum_DISASSEMBLY_STREAM_FIELDS dwFields, ou

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

prgDisassembly[iOp].dwFields |= enum_DISASSEMBLY_STREAM_FIELDS.DSF_POSITION;
prgDisassembly[iOp].posBeg = new TEXT_POSITION()
{
dwLine = currentLine,
dwLine = startLine,
dwColumn = 0
};
prgDisassembly[iOp].posEnd = new TEXT_POSITION()
Expand Down

0 comments on commit 2f7a529

Please sign in to comment.