🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #13971

Re: Help on catch.o & reg. params.

#13971
From: John J. Szucs
Date: Thu, 01 Mar 1990 16:33
56 lines
3077 bytes
In article <613.25e9d861@zodiac.rutgers.edu> wall@zodiac.rutgers.edu writes:
>Hi folks!
>	I was wondering about how to use catch.o in Lattice C to catch Gurus.
>I've tried linking this in instead of c.o, but this doesn't quit do the trick.
>Any suggestions?

catch.o is substituted for c.o as the startup module in the BLink command line,
as you described. For example, to compile and link the program hello.c with
catch.o (assuming use of the standard Lattice math libraries):

LC <options> hello
BLink FROM LIB:catch.o+hello.o TO hello LIB LIB:LCM.lib+LIB:LC.lib+LIB:Amiga.lib
     <other linker flags>

Note: Do not use the -L (link) option of LC to link the file if you are
      attempting to use catch.o, as -L automagically uses LIB:c.o as the
      startup module.

When a program linked with catch.o causes an exception (know and loved as
"a Guru" :-)), a file named Snapshot.TB is created in the current directory.
The Snapshot.TB file contains a description of the state of the system at
the time that the exception occured. After the file is created, the normal
Amiga exception handling continues (and the Guru is still displayed).

After rebooting the system, cd to the directory that the Snapshot.TB file was
created in and execute the command:

TB

to display the contents of the file in the basic format. (The program TB
is part of the Lattice C distribution and should be located in LC:).

To display the Snapshot.TB file in complete format, including the state of
the registers and stack at the time of the exception, execute the command:

TB -l

Note that some programming errors can place the system in such a sorry state
that the catch.o exception handler cannot write the Snapshot.TB file, so this
method is not always effective. However, I've personally found it to be a
useful debugging tool, particularly in highly-interactive programs where using
CodePRobe is inconvenient.

>
>			Thanks,
>			Sean Wall
>			(WALL@PISCES) on Bitnet

================================================================================
|| John J. Szucs                    || The opinions expressed are my own and  ||
|| Systems Evaluation Group         || in no way represent the opinions or    ||
|| Product Assurance Department     || policies of Commodore Technology, Inc. ||
|| Commodore Technology, Inc.       || or any associated entity.              ||
================================================================================
{rutgers|uunet}!cbmvax!jjszucs
jjszucs@cbmvax.commodore.com
Technical Details
Message-ID: <9915@cbmvax.commodore.com>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!brutus.cs.uiuc.edu!wuarchive!psuvax1!rutgers!bpa!cbmvax!jjszucs
References: <613.25e9d861@zodiac.rutgers.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!brutus.cs.uiuc.edu!wuarchive!psuvax1!rutgers!bpa!cbmvax!jjszucs
From: jjszucs@cbmvax.commodore.com (John J. Szucs)
Newsgroups: comp.sys.amiga.tech
Subject: Re: Help on catch.o & reg. params.
Keywords: catch.o
Message-ID: <9915@cbmvax.commodore.com>
Date: 1 Mar 90 16:33:10 GMT
References: <613.25e9d861@zodiac.rutgers.edu>
Reply-To: jjszucs@cbmvax.cbm.commodore.com (John J. Szucs)
Followup-To: comp.sys.amiga.tech
Organization: Commodore, West Chester, PA
Lines: 56