In This Book

Debugging Applications That Use ioctl or curses

Programs that use ioctl (2) or curses (3x) do not run in the User Program I/O Area as they would in a terminal window. The User Program I/O Area is not designed as a fully functional terminal emulator. However, you can still debug these types of programs with HP/DDE.

One method is to run the program in a terminal window and then attach the debugger to the process. See \Attaching the Debugger to a Running Process" in Chapter 2 for more information.

Another method is to use I/O redirection, as follows:

1.Start an hpterm or xterm terminal window with a running shell.

2.Run the tty command in the terminal window to get its device name (for example, /dev/pty/ttyp5 ).

3.Run the sleep command in the terminal window to keep the shell from intercepting any input (for example, sleep 100000 ).

4.Load the target program, but redirect standard I/O to the terminal window, using the device name obtained in Step 2.

If you use the Load/Rerun dialog box, enter the device name (which is

/dev/pty/ttyp5 in this example) in the stdin, stdout, and stderr redirection input boxes.

When the target program starts, the User Program I/O area disappears since all I/O has been redirected.

8

Debugging in Special Situations 8-23