Debugging via QEMU

noglin

Well-known member
Thank you @joevt, I appreciate it. I could not get MacsBug to work in QEMU - I press a key to type something and it just ends up filling the full line with that letter. And apart from that it just seems like one more great tool and convenient to run on my main desktop - although I think you are right that for what I wanted to do, MacsBug would be better.

I don't find CFLOpenContainer in the Mac OS header support files in CW Pro 7.1, I tried declaring it external to see if the linker would find it but it seems not - but I have not checked all the libs yet.

As for Ghidra, I really don't know. But thanks for sharing that mpw line, I will use that from now on!
I might be barking up the wrong tree, it is quite possible CFLOpenContainer is not invoked at all when launching a PPC application. In particular, I want to find the code that parses the PEF prior to launching the app.

Thanks again for the pointers!
 

joevt

Well-known member
I could not get MacsBug to work in QEMU - I press a key to type something and it just ends up filling the full line with that letter.
I have this problem on my Power Mac 8600 with G4 upgrade but not on my Power Mac B&W G3 with G4 upgrade. I don't know why.
I tested the B&W G3 and Power Mac 8600 just now.

For my Power Mac 8600, I can get into MacsBug using Command-Reset on the ADB keyboard. Pressing a key fills the line. I can use the ADB mouse to select commands from the menu. I'm using MacsBug 6.6.3. I can click on words from the MacsBug help to enter them into the command line. I can click on a space character to insert a space in the command line. In this way I can use the MacsBug Help menu to get help on MacsBug commands, and enter "help flow" by clicking on "help", " " (space character), and "flow". This help shows the "go" command. I can click on "go" and press return to leave Macs Bug.

Here's a thread that also discusses this problem:
https://tinkerdifferent.com/threads/emulator-for-macos-8-9-macsbug.2707/
Here's a small mention:
https://www.emaculation.com/forum/viewtopic.php?p=74582#p74582
There's an interesting note at:
https://www.emaculation.com/forum/viewtopic.php?p=68004&sid=b3d2461d5b066bfd84e7381addf5e3fc#p68004
Maybe just need to change the TimeDBRA low memory global?

Code:
TimeDBRA  		EQU 		$0D00 					; (word) number of iterations of DBRA per millisecond

; Mouse/Keyboard
KeyLast   		EQU 		$184  					; ASCII for last valid keycode [word]
KeyTime   		EQU 		$186  					; tickcount when KEYLAST was rec'd [long]
KeyRepTime		EQU 		$18A  					; tickcount when key was last repeated [long]

; Unpacked, user versions of parameter ram
KeyThresh 		EQU 		$18E  					; threshold for key repeat [word]
KeyRepThresh  	EQU 		$190  					; key repeat speed [word]

; Parameter Ram
SPKbd 			EQU 		$206  					; kbd repeat thresh in 4/60ths [2 4-bit]

Maybe TimeDBRA wrapped around from 65535? But wouldn't both my Power Macs have the same problem? Maybe both of them wrapped around but the B&W landed on a value that is ok and the Power Mac 8600 did not.
I need to compare them.
 

joevt

Well-known member
I don't find CFLOpenContainer in the Mac OS header support files in CW Pro 7.1, I tried declaring it external to see if the linker would find it but it seems not - but I have not checked all the libs yet.
The stub libraries do not have all the exports of the real library:
Code:
cd "/Volumes/Devs/Metrowerks CodeWarrior 8.0/Metrowerks CodeWarrior/MacOS Support/Universal/Libraries/StubLibraries"
mpw DumpPEF CFragManager
DeRez CFragManager

This is the list of symbols in the stub library:
Code:
CountSymbols
GetMemFragment
CloseConnection
FindSymbol
GetDiskFragment
GetIndSymbol
GetSharedLibrary

You can try linking the library that is extracted from the ROM resources. You may need to add a cfrg resource.
 
Top