Dismiss
InnovationQ will be updated on Sunday, Oct. 22, from 10am ET - noon. You may experience brief service interruptions during that time.
Browse Prior Art Database

Debuggee Start-up Via Shell

IP.com Disclosure Number: IPCOM000013019D
Original Publication Date: 2000-Feb-01
Included in the Prior Art Database: 2003-Jun-12
Document File: 3 page(s) / 48K

Publishing Venue

IBM

Abstract

Since, on UNIX, the windowing system is separate from the base operating system, the raw debug interface on UNIX systems does not start a debuggee program in a window like the corresponding APIs on Windows and OS/2 systems. This makes it necessary for the debugger to either: a. Run the debuggee in the debugger's window or terminal session, or b. Create and manage pipes to handle stdin, stdout, and stderr for the debuggee and provide a window to display output and receive input, or c. Provide some means to start the debuggee in a separate standard window or terminal session.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 48% of the total text.

Page 1 of 3

Debuggee Start-up Via Shell

Since, on UNIX, the windowing system is separate from the base operating system, the raw debug interface on UNIX systems does not start a debuggee program in a window like the corresponding APIs on Windows and OS/2 systems. This makes it necessary for the debugger to either:
a. Run the debuggee in the debugger's window or terminal session, or
b. Create and manage pipes to handle stdin, stdout, and stderr for the debuggee and provide a window to display output and receive input, or
c. Provide some means to start the debuggee in a separate standard window or terminal session.

Solution (a) is relatively simple and straightforward, and is used by many of the UNIX debuggers available today (e.g. dbx and xldb). It is essentially a direct application of the system debug interfaces, without any consideration given to windowing. Solution (b) is used by several debuggers, and is a viable way to provide a separate window for the debuggee I/O. However, it does require that the debugger manage the window and the traffic to and from the debuggee. Since this functionality is already provided by the standard window programs, this is a duplication of effort. Solution
(c) is desirable in a windowed environment, as it allows each debuggee to have its own window, and this window is now the same as would be used in the run environment. This allows debugging of programs that use the curses library, for example. Moreover, in a "programmer's workbench" environment, such a separate window is mandatory since the workbench may not have a console window. This invention provides a way of providing this behavior.

The solution modifies the start-up of the debuggee program by the debugger as described below. The solution is given in the form of pseudo-code. There are 4 programs of interest:
1. The debugger.
2. The terminal window program (e.g. dtterm).
3. The debuggee wrapper (referred to below as the wrapper).
4. The debuggee

The debugger determines if X windows (or some other windowing system) is available. If not, it starts up the debuggee in the conventional way (see solution (a), above) The debugger creates a message queue (see note 1) The debugger calls fork(), creating a child process

The child process calls exec() to start a window using the terminal window program (dtterm, xterm, or some other X client window), which in turn will execute the wrapper program. (see note

Page 2 of 3

   queue to send a "termination" message. (see note 6) Work thread then terminates. The debugger main thread waits for a message to arrive on the message queue. (see note 7)

If the message is "termination", this indicates that the wrapper or window failed. An appropriate failure message can now be given to the user of the debugger. Otherwise, the message will contain the process id of the wrapper. The debugger attaches to the process (using the operating system's debug attach facility), thus stopping the wrapper and putting it into debug mode.

If necessary, th...