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

"Illegal Command", and "Ambiguous 2 Commands DISASM DISK" #473

Closed
TommyGH opened this Issue Aug 19, 2017 · 11 comments

Comments

Projects
None yet
3 participants
@TommyGH

TommyGH commented Aug 19, 2017

Emulator: 1.26.3.0
Debugger: 2.9.0.8

It seems something is broken worse than before. I get strange errors when running my debugger script.

My "debug.txt" script file:
debug.txt

My "A2_USER1.SYM".
A2_USER1.SYM (2).txt

  1. Start AppleWin.exe
  2. Boot DOS3.3 disk
  3. F7
  4. ESC (to "skip")
  5. Enter (to display whole console window).
  6. RUN DEBUG.TXT

After "Default Path:" is displayed, there is text:

++++++++++++++++++
Illegal Command
Ambiguous 2 Commands:
DISASM DISK
++++++++++++++++++

Now modify DEBUG.TXT. Near the end of the file are 2 lines commented out. Remove the "//" from both lines so that the commands will execute:
ma1 d0d0
mt2 ff0a

And repeat the steps 1 to 6 from above.

The error at the end now changes!? It looks like more of the script execution is now shown (?)

After "Default Path:" is displayed, there is text:

++++++++++++++++++
Illegal Command
Branch type: 2
colon: ON
Opcodes: ON
Info Target Pointer: OFF
Opcode spaces: ON
Target: 3
++++++++++++++++++

@TommyGH

This comment has been minimized.

Show comment
Hide comment
@TommyGH

TommyGH Aug 19, 2017

Goodness. I just did another experiment.
I noticed that after the last commented line in the file I had a "line" with no text. In other words, I entered the "// R PC RESET" as the last line in my script, pressed the ENTER key, and then saved the file. I'm using NotePad.exe.
Perhaps AppleWin.exe is having trouble determining the end of the file!? And is processing random stuff?

TommyGH commented Aug 19, 2017

Goodness. I just did another experiment.
I noticed that after the last commented line in the file I had a "line" with no text. In other words, I entered the "// R PC RESET" as the last line in my script, pressed the ENTER key, and then saved the file. I'm using NotePad.exe.
Perhaps AppleWin.exe is having trouble determining the end of the file!? And is processing random stuff?

@Michaelangel007

This comment has been minimized.

Show comment
Hide comment
@Michaelangel007

Michaelangel007 Aug 23, 2017

Contributor

I'll try to take a look at this later today ...

Code in question: Debug.cpp, 6382-6445

find . -iname "*.h" | xargs grep "CONSOLE_WIDTH"
./Debugger_Console.h:		CONSOLE_WIDTH  =  80,
Contributor

Michaelangel007 commented Aug 23, 2017

I'll try to take a look at this later today ...

Code in question: Debug.cpp, 6382-6445

find . -iname "*.h" | xargs grep "CONSOLE_WIDTH"
./Debugger_Console.h:		CONSOLE_WIDTH  =  80,
@Michaelangel007

This comment has been minimized.

Show comment
Hide comment
@Michaelangel007

Michaelangel007 Aug 24, 2017

Contributor

Didn't get a chance yesterday ... should today.

Contributor

Michaelangel007 commented Aug 24, 2017

Didn't get a chance yesterday ... should today.

@Michaelangel007

This comment has been minimized.

Show comment
Hide comment
@Michaelangel007

Michaelangel007 Aug 25, 2017

Contributor

OK, able to repro. Investigating ...

Repro.

  1. Start AppleWin
  2. F7
  3. run debug.txt
Contributor

Michaelangel007 commented Aug 25, 2017

OK, able to repro. Investigating ...

Repro.

  1. Start AppleWin
  2. F7
  3. run debug.txt
@Michaelangel007

This comment has been minimized.

Show comment
Hide comment
@Michaelangel007

Michaelangel007 Aug 25, 2017

Contributor

Caused by this line:

disasm COLON  1  // Colon after addresses
Contributor

Michaelangel007 commented Aug 25, 2017

Caused by this line:

disasm COLON  1  // Colon after addresses
@Michaelangel007

This comment has been minimized.

Show comment
Hide comment
@Michaelangel007

Michaelangel007 Aug 25, 2017

Contributor

di is getting passed into DebuggerProcessCommand() causing the DisplayAmbigiousCommands( 2 ) to be triggered.

nSize: 4293
iLine = 225
nLine = 226

Bug in MemoryTextFile_t::GetLinePointers() ??

		pEnd = const_cast<char*>( SkipUntilEOL( pBegin ));
OutputDebugStringA( pBegin );

g_pConsoleInput: " "20 84 FE" vs "2084FE" "

Contributor

Michaelangel007 commented Aug 25, 2017

di is getting passed into DebuggerProcessCommand() causing the DisplayAmbigiousCommands( 2 ) to be triggered.

nSize: 4293
iLine = 225
nLine = 226

Bug in MemoryTextFile_t::GetLinePointers() ??

		pEnd = const_cast<char*>( SkipUntilEOL( pBegin ));
OutputDebugStringA( pBegin );

g_pConsoleInput: " "20 84 FE" vs "2084FE" "

@Michaelangel007

This comment has been minimized.

Show comment
Hide comment
@Michaelangel007

Michaelangel007 Aug 25, 2017

Contributor

MemoryTextFile_t::Read() isn't setting null terminator ?

xxd -g 1 debug.txt:

00010a0: 2e 32 36 2e 33 2e 30 0d 0a 2f 2f 33 66 32 3a 20  .26.3.0..//3f2:
00010b0: 30 20 30 20 30 0d 0a 2f 2f 52 20 50 43 20 52 45  0 0 0..//R PC RE
00010c0: 53 45 54 0d 0a                                   SET..```
Contributor

Michaelangel007 commented Aug 25, 2017

MemoryTextFile_t::Read() isn't setting null terminator ?

xxd -g 1 debug.txt:

00010a0: 2e 32 36 2e 33 2e 30 0d 0a 2f 2f 33 66 32 3a 20  .26.3.0..//3f2:
00010b0: 30 20 30 20 30 0d 0a 2f 2f 52 20 50 43 20 52 45  0 0 0..//R PC RE
00010c0: 53 45 54 0d 0a                                   SET..```
@Michaelangel007

This comment has been minimized.

Show comment
Hide comment
@Michaelangel007

Michaelangel007 Aug 25, 2017

Contributor

Bug caused by Util_MemoryTextFile, Line 51 not zero-terminating buffer by invalidating it.

		m_vBuffer.push_back( EOL_NULL );
Contributor

Michaelangel007 commented Aug 25, 2017

Bug caused by Util_MemoryTextFile, Line 51 not zero-terminating buffer by invalidating it.

		m_vBuffer.push_back( EOL_NULL );

@Michaelangel007 Michaelangel007 self-assigned this Aug 25, 2017

@Michaelangel007 Michaelangel007 added this to the 1.27 milestone Aug 25, 2017

@Michaelangel007

This comment has been minimized.

Show comment
Hide comment
@Michaelangel007

Michaelangel007 Aug 25, 2017

Contributor

Whoops, closed by mistake.

Contributor

Michaelangel007 commented Aug 25, 2017

Whoops, closed by mistake.

@Michaelangel007

This comment has been minimized.

Show comment
Hide comment
@Michaelangel007

Michaelangel007 Aug 25, 2017

Contributor

NOTE: Need to merge #480 before we can pump bump debugger version & update docs/Debugger_Changelog.txt

Contributor

Michaelangel007 commented Aug 25, 2017

NOTE: Need to merge #480 before we can pump bump debugger version & update docs/Debugger_Changelog.txt

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

@tomcw

This comment has been minimized.

Show comment
Hide comment
@tomcw

tomcw Jan 6, 2018

Contributor

Bumped debugger version (2.9.0.12) & updated docs/Debugger_Changelog.txt.

Contributor

tomcw commented Jan 6, 2018

Bumped debugger version (2.9.0.12) & updated docs/Debugger_Changelog.txt.

@tomcw tomcw closed this Jan 6, 2018

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