home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!munnari.oz.au!uniwa!bilby.cs.uwa.oz.au!nuntius
- From: Quinn <quinn@cs.uwa.edu.au>
- Subject: Re: MacsBug symbols from assembler code?
- Message-ID: <1992Aug21.030941.6506@bilby.cs.uwa.edu.au>
- Sender: usenet@bilby.cs.uwa.edu.au
- Nntp-Posting-Host: eriodon
- Organization: The University of Western Australia
- X-Useragent: Nuntius v1.1
- References: <1992Aug20.155733.6869@daimi.aau.dk>
- Date: Fri, 21 Aug 1992 03:09:41 GMT
- Lines: 53
-
- In article <1992Aug20.155733.6869@daimi.aau.dk> Peter Andersen,
- datpete@daimi.aau.dk writes:
- >Am I missing something?
-
- Hmm. I had great fun getting MacsBug symbols working consistently
- in my latest Asm project. Try using the following macro (with
- apologies to those people whose systems don't expand tabs
- properly)...
-
- ----------------------------------------------
- macro
- MacsBug &Name,&rts:int
- lclc &oldstr
- gbla &debug
-
- if &debug then
-
- if &rts then
- rts ; force rts in specific cases
- endif
-
- dc.b &len(&name)+$80 ; length of string + $80 marks symbol
- &oldstr setc &setting('string')
- string AsIs
- dc.b '&upcase(&Name)' ; define the string AsIs
- string &oldstr
- align ; pad to word boundary
- dc.w 0 ; no literals
-
- endif
-
- endm
- ----------------------------------------------
-
- ... which you invoke as.
- MacsBug Fred
- MacsBug Jim,1
- at the end of routine Fred that ends in an RTS (or JMP (A0) or
- RTD) or routine Jim that doesn't end in one of the above.
-
- However theres still the problem of whether MacsBug will actually
- see the symbol. Sometimes it does, sometimes it doesn't. I'm not
- actually sure what it depends on but I think it has something to do
- with what code has been executed recently. One thing that I found
- that helps is doing an 'hx' into the heap that the symbol is in.
- But if all else fails you can at least search for the symbol string
- (-:
-
- Quinn "The Eskimo!" <quinn@cs.uwa.edu.au> "Support HAVOC!"
- Department of Computer Science, The University of Western Australia
- -- MacsBug: Don't leave home without it.
- -- This macro is for Pascal; converting it to C is left as an
- exercise to the reader. (-:
-