Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!nrl-cmf!ukma!rutgers!bellcore!texbell!killer!pollux!ti-csl!m2!holland From: holland@m2.csc.ti.com (Fred Hollander) Newsgroups: comp.sys.mac.programmer Subject: Re: LSC - how to find if the debugger is running? Message-ID: <72491@ti-csl.csc.ti.com> Date: 16 Mar 89 20:44:06 GMT References: <1806@viscous.sco.COM> <2547@ilium.cs.swarthmore.edu> Sender: news@ti-csl.csc.ti.com Reply-To: holland@m2.UUCP (Fred Hollander) Organization: TI Computer Science Center, Dallas Lines: 25 In article <2547@ilium.cs.swarthmore.edu> jackiw@ilium.UUCP (Nick Jackiw) writes: >In article <1806@viscous.sco.COM> jamesm@sco.COM (James M. Moore) writes: >> I'd like to be able to do somthing like this in LSC 3.0: >> >> if (DebuggerIsActive()) >> DebugStr("\pNow in Macsbugs"); >> ... >So what you want to do is determine whether trap $A9FF invokes the built-in >debugger (worthless for breakpoints) or something else (i. e. your better- >debugger-of-choice). Taking a clean (debugger-free) system, write a little >program to print out the result of NGetTrapAddress($FF,ToolTrap) [cf. IM >IV-234]. This is the address which a debuggerless Mac will hit; let's say >it's X. Your DebuggerIsActive function is now the comparison >NGetTrapAddress($FF,ToolTrap)<>X; i. e. whether someone has patched this >to a different (and presumably better) debugger. A more general solution would be to check the address against the ROMbase. If it's in ROM, it isn't MacsBug or TMON. Fred Hollander Computer Science Center Texas Instruments, Inc. hollander@ti.com The above statements are my own and not representative of Texas Instruments.