[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Determining signal context



Hello Andreas,

|> lux%heidelbg.ibm.com%ibmpa@ibminet.awdpa.ibm.com (Wolfgang Lux) writes:
|> 
|> |> Hello,
|> |> I'm just wondering whether there is a clean and "official" way under
|> |> MiNT (apart from hooking into the appropriate 68000 vectors) to
|> |> determine the context in which a signal handler was called.
|> 
|> Yes, there is. Every signal handler actually receives three arguments:
|> the signal number, the m68k vector number and the signal context.  I'm
|> not sure if struct sigcontext is already defined in <signal.h>, but in
|> case it's not, look it up in the MiNT sources in signal.c and define
|> it yourself.  It should be obvious from the names of the struct
|> members what they mean.  Btw, you can even change the context from
|> within the signal handler, on return the new context will be used.
|> 
|> Andreas.

well I looked it up in the source of signal.c and first found nothing
as I still am at 1.11h1 level (going to upgrade to 1.12 real soon :-).
Looking into the 1.12 sources I found sigcontext and it was not really
what I'm interested in. I would just like to read the frame pointer
(A6) at the time of the signal, as it is the point from which I can
analyse the program's stack. The program counter and stack pointer
alone won't help.

Or am I going to miss something? Might I possibly find the saved
registers on the (user!) stack?

Wolfgang

---
Wolfgang Lux				(Standard Disclaimer :-)

WZH Heidelberg, IBM Germany             Internet: lux@heidelbg.ibm.com
+49-6221-59-4546			VNET:     LUX at HEIDELBG
+49-6221-59-3300 (fax)			EARN:     LUX at DHDIBMIP