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

Screen partly corrupted using DEBUGGER. "111111111111" outside disassembly window. #479

Closed
TommyGH opened this Issue Aug 24, 2017 · 18 comments

Comments

Projects
None yet
3 participants
@TommyGH

TommyGH commented Aug 24, 2017

This is a bit of a weird one. I was using the down arrow on my keyboard to scroll through some code in the disassembly pane. All of a sudden 2 characters to the right of the disassembly pane (is it called the "info panel"?) were corrupted. Each time I pressed the down arrow key, another " 1" appeared. See attached screen captures.

It doesn't seem to be directly related to WM_PAINT, as I could move another application window over the corrupted window, then move it off again, and I could still see the corruption. However, if I minimized AppleWin and then restored Applewin, the window was displayed without the corruption.

The problem is repeatable. I could close Applewin, then restart it, and scroll through this same sequence of code and it would corrupt in the same manner. There seems to be more than one place in the code that causes this corruption.

AppleWin: 1.26.3.0
Debugger: 2.9.0.8

I was using the enclosed DEBUG.TXT script and the enclosed A2_USER1.SYM. I booted DOS(1983) (January) Master disk first before F7 and RUN DEBUG.TXT.

Corrupt Screen:
corruptpaintjob

Good Screen:
goodscreen

First sign of corruption:
firstsignofcorruption

debug.txt

A2_USER1.SYM.txt

@Michaelangel007

This comment has been minimized.

Show comment
Hide comment
@Michaelangel007

Michaelangel007 Aug 24, 2017

Contributor

Repro.:

Setup

  1. Copy AppleWin.exe and Apple DOS 3.3 January 1983.dsk into same directory as symbols and debug script
  2. Rename a2_user1.sym.txt to a2_user1.sym to have Applewin auto-load symbols at start (will see 1164 symbols in User1)

Running

  1. Start AppleWin
  2. Boot: Apple DOS 3.3 January 1983.dsk
  3. F7
  4. run debug.txt
  5. Press ESC (PC will be at $BA00)
  6. Down arrow until BD81 (over-writing outside disassembly window into info pane)
  7. F7
  8. May show bug: F7 (single line overflows edge @ $C27B or $C294), F7

Re-trigger

  1. u ba00
  2. Down to BD6A -- bad disassembly line on $BD7C
Contributor

Michaelangel007 commented Aug 24, 2017

Repro.:

Setup

  1. Copy AppleWin.exe and Apple DOS 3.3 January 1983.dsk into same directory as symbols and debug script
  2. Rename a2_user1.sym.txt to a2_user1.sym to have Applewin auto-load symbols at start (will see 1164 symbols in User1)

Running

  1. Start AppleWin
  2. Boot: Apple DOS 3.3 January 1983.dsk
  3. F7
  4. run debug.txt
  5. Press ESC (PC will be at $BA00)
  6. Down arrow until BD81 (over-writing outside disassembly window into info pane)
  7. F7
  8. May show bug: F7 (single line overflows edge @ $C27B or $C294), F7

Re-trigger

  1. u ba00
  2. Down to BD6A -- bad disassembly line on $BD7C
@Michaelangel007

This comment has been minimized.

Show comment
Hide comment
@Michaelangel007

Michaelangel007 Aug 24, 2017

Contributor

Trace:

  • CmdCursorLineDown()
  • UpdateDisplay( 16 ) // UPDATE_DISASM = 1 << 4
    • DrawWindow_Code() // bUpdate = 2
      • DrawSubWindow_Code() // g_iWindowThis = 2
        • DrawDisassemblyLine()
          • GetDisassemblyLine( nBaseAddress, line )

g_nDisasmTopAddress = 0xbd59

Before first PrintTextCursorX()

		if (g_bConfigDisasmAddressColon)
			PrintTextCursorX( ":", linerect );

linerect

  • top: 144
  • bottom: 152
  • left: 28
  • right: 353

Before Line 2141

		PrintTextCursorX( pTarget, linerect );

linerect:

  • top: 144
  • bottom: 152
  • left:210
  • right: 353
Contributor

Michaelangel007 commented Aug 24, 2017

Trace:

  • CmdCursorLineDown()
  • UpdateDisplay( 16 ) // UPDATE_DISASM = 1 << 4
    • DrawWindow_Code() // bUpdate = 2
      • DrawSubWindow_Code() // g_iWindowThis = 2
        • DrawDisassemblyLine()
          • GetDisassemblyLine( nBaseAddress, line )

g_nDisasmTopAddress = 0xbd59

Before first PrintTextCursorX()

		if (g_bConfigDisasmAddressColon)
			PrintTextCursorX( ":", linerect );

linerect

  • top: 144
  • bottom: 152
  • left: 28
  • right: 353

Before Line 2141

		PrintTextCursorX( pTarget, linerect );

linerect:

  • top: 144
  • bottom: 152
  • left:210
  • right: 353
@Michaelangel007

This comment has been minimized.

Show comment
Hide comment
@Michaelangel007

Michaelangel007 Aug 24, 2017

Contributor

Also, $BD7C, $BD7F and $BD81 are showing a few pixels of the background outside the disassembly pane.

^ this is the symptom of the bug

Contributor

Michaelangel007 commented Aug 24, 2017

Also, $BD7C, $BD7F and $BD81 are showing a few pixels of the background outside the disassembly pane.

^ this is the symptom of the bug

@Michaelangel007

This comment has been minimized.

Show comment
Hide comment
@Michaelangel007
Contributor

Michaelangel007 commented Aug 24, 2017

outside_bd7c

@Michaelangel007

This comment has been minimized.

Show comment
Hide comment
@Michaelangel007

Michaelangel007 Aug 24, 2017

Contributor

Bug lies past line 2042

i.e. Replace line 2042 with, and no bug.

return nOpbyte; // **************************************************
Contributor

Michaelangel007 commented Aug 24, 2017

Bug lies past line 2042

i.e. Replace line 2042 with, and no bug.

return nOpbyte; // **************************************************
@Michaelangel007

This comment has been minimized.

Show comment
Hide comment
@Michaelangel007

Michaelangel007 Aug 24, 2017

Contributor

Bisect: 2042,2293
Bisect: 2115,2293
Bisect: 2115,2209

Line $BD7C is overflowing disassembly pane

Bisect: 2143,2192

Contributor

Michaelangel007 commented Aug 24, 2017

Bisect: 2042,2293
Bisect: 2115,2293
Bisect: 2115,2209

Line $BD7C is overflowing disassembly pane

Bisect: 2143,2192

@Michaelangel007

This comment has been minimized.

Show comment
Hide comment
@Michaelangel007
Contributor

Michaelangel007 commented Aug 24, 2017

outside_bd7c_2

@Michaelangel007

This comment has been minimized.

Show comment
Hide comment
@Michaelangel007

Michaelangel007 Aug 24, 2017

Contributor

Shorter repro.:

  1. Applewin
  2. F2
  3. F7
  4. ESC
  5. run debug.txt
  6. ESC
    6. u bd28
    7. Down -- bug shows at $BD7C
  7. u bd7c

Looks like 2.8.0.1 and 2.8.0.8 weren't completely fixed.

Contributor

Michaelangel007 commented Aug 24, 2017

Shorter repro.:

  1. Applewin
  2. F2
  3. F7
  4. ESC
  5. run debug.txt
  6. ESC
    6. u bd28
    7. Down -- bug shows at $BD7C
  7. u bd7c

Looks like 2.8.0.1 and 2.8.0.8 weren't completely fixed.

@Michaelangel007

This comment has been minimized.

Show comment
Hide comment
@Michaelangel007

Michaelangel007 Aug 24, 2017

Contributor

pTarget: DRV2EN.LCBANK1.ENABLE2
After: DRV2EN.LCBANK1.ENABL
nlen: 22
nMaxLen: 20

Contributor

Michaelangel007 commented Aug 24, 2017

pTarget: DRV2EN.LCBANK1.ENABLE2
After: DRV2EN.LCBANK1.ENABL
nlen: 22
nMaxLen: 20

@Michaelangel007

This comment has been minimized.

Show comment
Hide comment
@Michaelangel007

Michaelangel007 Aug 24, 2017

Contributor

Bug is caused by lines 2168-2170

			if (line.bTargetX)
			{
				PrintTextCursorX( ",", linerect );
				if (! bCursorLine)
					DebuggerSetColorFG( DebuggerGetColor( FG_INFO_REG ) );
				PrintTextCursorX( "X", linerect );
			}
Contributor

Michaelangel007 commented Aug 24, 2017

Bug is caused by lines 2168-2170

			if (line.bTargetX)
			{
				PrintTextCursorX( ",", linerect );
				if (! bCursorLine)
					DebuggerSetColorFG( DebuggerGetColor( FG_INFO_REG ) );
				PrintTextCursorX( "X", linerect );
			}
@Michaelangel007

This comment has been minimized.

Show comment
Hide comment
@Michaelangel007

Michaelangel007 Aug 24, 2017

Contributor

Repro.:

  1. F7
sym DRV2EN.LCBANK1.ENABLE2 = C08B
300:BD 8B C0
u 300
Contributor

Michaelangel007 commented Aug 24, 2017

Repro.:

  1. F7
sym DRV2EN.LCBANK1.ENABLE2 = C08B
300:BD 8B C0
u 300
@Michaelangel007

This comment has been minimized.

Show comment
Hide comment
@Michaelangel007

Michaelangel007 Aug 24, 2017

Contributor

Tommy,

/Oblg.

  • Patient: "Doctor, it hurts when I do this."
  • Doctor: "Don't do that then!"

Until the debugger gets fixed here is a work-around in your A2_USER1.SYM

C08B DRV2EN.LC.BANK2

The bug is that long symbol names are not being clipped. You have a few of those. :-/ Specifically,

  • PRIOR.SLOTZ.CSUM.GBASH
  • TRACK.BOOTSL.MASK.TEMOP
  • DRV1TRK.CURTRK.TEXT.HOLE.1
  • SEEKCNT.DRV2TRK.TEXT.HOLE.2
  • DRV2EN.LCBANK1.ENABLE2

I attempted to fix this in the past but looks like I forgot a few cases (indirect mode, etc.) The cause of the bug is that I assumed years ago that no one would ever use symbols > 16 chars. And of course Murphy's Law -- users will always challenge your assumptions. :-)

On my end there are a few things that need to be done:

Contributor

Michaelangel007 commented Aug 24, 2017

Tommy,

/Oblg.

  • Patient: "Doctor, it hurts when I do this."
  • Doctor: "Don't do that then!"

Until the debugger gets fixed here is a work-around in your A2_USER1.SYM

C08B DRV2EN.LC.BANK2

The bug is that long symbol names are not being clipped. You have a few of those. :-/ Specifically,

  • PRIOR.SLOTZ.CSUM.GBASH
  • TRACK.BOOTSL.MASK.TEMOP
  • DRV1TRK.CURTRK.TEXT.HOLE.1
  • SEEKCNT.DRV2TRK.TEXT.HOLE.2
  • DRV2EN.LCBANK1.ENABLE2

I attempted to fix this in the past but looks like I forgot a few cases (indirect mode, etc.) The cause of the bug is that I assumed years ago that no one would ever use symbols > 16 chars. And of course Murphy's Law -- users will always challenge your assumptions. :-)

On my end there are a few things that need to be done:

@Michaelangel007 Michaelangel007 self-assigned this Aug 24, 2017

@Michaelangel007

This comment has been minimized.

Show comment
Hide comment
@Michaelangel007

Michaelangel007 Aug 24, 2017

Contributor

Need to account for:

  • Branch != 0
  • , X
  • ,Y
  • ,X)
  • ),Y
  • Target Pointer
  • Immediate Char
Contributor

Michaelangel007 commented Aug 24, 2017

Need to account for:

  • Branch != 0
  • , X
  • ,Y
  • ,X)
  • ),Y
  • Target Pointer
  • Immediate Char
@Michaelangel007

This comment has been minimized.

Show comment
Hide comment
@Michaelangel007

Michaelangel007 Aug 24, 2017

Contributor

@tomcw Total of 4 commits need a quick review on branch bug_479

Thanks.

Contributor

Michaelangel007 commented Aug 24, 2017

@tomcw Total of 4 commits need a quick review on branch bug_479

Thanks.

@Michaelangel007

This comment has been minimized.

Show comment
Hide comment
@Michaelangel007

Michaelangel007 Aug 24, 2017

Contributor

Ah, GitHub shows/treats issue 480 as a pull request. Neat.

OK, enough "spam" for now. :-)

Contributor

Michaelangel007 commented Aug 24, 2017

Ah, GitHub shows/treats issue 480 as a pull request. Neat.

OK, enough "spam" for now. :-)

@tomcw tomcw modified the milestones: 1.27, 1.28 Dec 17, 2017

@tomcw

This comment has been minimized.

Show comment
Hide comment
@tomcw

tomcw Dec 19, 2017

Contributor

Merged and deleted PR #480.

Contributor

tomcw commented Dec 19, 2017

Merged and deleted PR #480.

@tomcw

This comment has been minimized.

Show comment
Hide comment
@tomcw

tomcw Dec 19, 2017

Contributor

Tested OK with 1st and 3rd repros above.

Contributor

tomcw commented Dec 19, 2017

Tested OK with 1st and 3rd repros above.

@tomcw

This comment has been minimized.

Show comment
Hide comment
@tomcw

tomcw Dec 19, 2017

Contributor

Closing.

Contributor

tomcw commented Dec 19, 2017

Closing.

@tomcw tomcw closed this Dec 19, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment