Where Did My Program Fail?
Using Pascal Traceback
Assuming that the file data is still in the current directory, you can compile
and run the program as follows:
hostname% pc -o copy2 copy2.p
hostname% copy2
hello, are you listening?
goodbye, I must go now.
SPARCompiler Pascal can trace why a program failed; its traceback utility
finds the routine that triggers the error.
Pascal traceback installs signal handlers on selected signals and dumps a
backtrace when those signals are caught. The backtrace shows the chain of
calls leading from the routine in which the error occurred, all the way back to
the main program.
Pascal catches the following set of signals:
SIGQUIT
SIGIOT
SIGILL
SIGABRT
SIGTRAP
SIGEMT
See the signal(3) man page for further information on these signals.
After the system produces the traceback, it continues with whatever action it
would have taken if the interposer had not been in place, including calling a
user signal handler that was previously set.
The traceback facility uses the debugger dbx. To obtain a traceback,
SPARCworks must be installed on your system, and the directory containing
dbx must be in your PATH environment variable. If the traceback routine
cannot find dbx, it does not produce the traceback.
Use the -notrace command-line option to disable traceback.
Pascal Programs
SIGFPE
SIGSYS
SIGBUS
SIGPIPE
SIGSEGV
2
SIGTERM
SIGLOST
13
Need help?
Do you have a question about the SunSoft Pascal 4.0 and is the answer not in the manual?
Questions and answers