HPlogo HP/DDE Debugger User's Guide: HP 9000 Series 700/800 Computers > Chapter 8 Debugging in Special Situations

Debugging Applications That Use ioctl or curses

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Glossary

 » Index

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 ” 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.