When a signal like SIGSEGV or SIGFPE is intercepted by a signal handler that receives signal no., siginfo_t, and ucontext the PSW is that of the program old PSW. However, the instruction length code (ILC) is not passed anywhere nor can is it accessible (nor could it be relied upon) from low-core. This makes writing signal handlers that inspect the problem difficult. For example, I want to distinguish between a zero divide exception and other fixed point exceptions (both PROG 009). I'd like to inspect the opcode to see if it was a divide operations and then check the operands to see if the divisor was 0. The divide instruction could be 2, 4, or 6 bytes long (RR, RX, RXY format) but because the PSW address is pointing to the instruction following and there's no ILC I cannot write a foolproof method of finding the opcode (having 1d20 could be the opcode for DR but it might be part of the displacement field of the D, DL instructions). I'd like to suggest that the ucontext structure be enhanced to include the ILC information. (Changing the current behavior of the PSW address would probably cause massive breakage.)
Neale Ferguson ---------------------------------------------------------------------- For LINUX-390 subscribe / signoff / archive access instructions, send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit http://www.marist.edu/htbin/wlvindex?LINUX-390
