Index of /DarwinSourceArchive/expanded/gdbforcw/gdbforcw-1/macsbug

      Name                    Last modified       Size  Description

[DIR] Parent Directory 13-Jun-2006 14:28 - [   ] ChangeLog 13-Sep-2005 17:23 11k [   ] MacsBug.h 13-Sep-2005 17:11 12k [   ] MacsBug_cmdline.c 13-Sep-2005 17:11 29k [   ] MacsBug_display.c 14-Sep-2005 14:24 100k [   ] MacsBug_patches.c 13-Sep-2005 17:11 31k [   ] MacsBug_plugins.c 13-Sep-2005 17:11 76k [   ] MacsBug_screen.c 03-May-2001 07:31 15k [   ] MacsBug_set.c 13-Sep-2005 17:11 24k [   ] MacsBug_testing.i 13-Sep-2005 17:11 5k [   ] MacsBug_utils.c 13-Sep-2005 17:11 46k [   ] Makefile 13-Sep-2005 17:23 7k [   ] cp_macsbug 13-Sep-2005 17:23 1k [DIR] gdb_plugin_support/ 17-Apr-2006 15:24 - [   ] gdbinit-MacsBug 13-Sep-2005 17:11 13k [   ] gdbinit-MacsBug-with..> 03-May-2001 07:31 121k

MacsBug Interface for GDB

MacsBug Interface for GDB
7/25/05

1. Introduction

The MacsBug supported here is gdb extended to support a subset of the Mac Classic MacsBug commands and a MacsBug-like screen UI. Thus it basically is a variant of MacsBug with source-level debugging!

Along with this README there are three other files in this directory:

Both gdbinit-MacsBug-without-plugin and gdbinit-MacsBug are gdb command language scripts one of which you source from your ~/.gdbinit script (the script that gdb always looks for, and for what it's worth, it looks for a .gdbinit script in the current directory as well). In the following sections the difference in the two MacsBug scripts will be explained.

The MacsBug_plugin is just that; the gdb plugins that implement the MacsBug UI and commands. The plugin is loaded by the gdbinit-MacsBug script.

 

2. Background

Once upon a time there was an implementation of Classic MacsBug for gdb using nothing but the command language provided by gdb. The file was called gdbinit-MacsBug (and since renamed gdbinit-MacsBug-without-plugin) and it is included with this release. It supports about 40 of the MacsBug commands.

It has the benefit of being totally portable, i.e., it should be able to be used with any version of gdb, on any Unix system, anywhere. It's down side is that it cannot do any more that what is provided by the rather limited gdb command language, is interpretive, and thus rather inefficient and in some cases slow, and cannot provide a MacsBug-like screen UI.

To get around these limitations the plugin support in Apple's gdb was utilized which allows the implementation be done in a "real" language. Thus the script gdbinit-MacsBug is provided which appears to be a very reduced form or gdbinit-MacsBug-without-plugin because most of the implementation is provided in the plugin (MacsBug_plugin) which gdbinit-MacsBug loads with a load-plugin Apple gdb command.

The benefit of using the plugin is that it is very efficient because it "talks" directly to gdb. It can provide functionality that the pure script variant cannot like some additional MacsBug commands and behavior as well as a MacsBug-like screen UI. It's down side is of course that it is tied directly to the version of gdb (and system) for which it was built. Further, because the script uses the load-plugin gdb command it will only work with Apple's version of gdb. Since MacsBug is mainly used by Mac developers this should be not be a serious limitation.

You thus have two choices:

  1. Install the totally portable gdbinit-MacsBug-without-plugin script, or,
  2. Install the gdbinit-MacsBug script and the MacsBug_plugin file.

 

3. Installation

The MacsBug files should already be installed in,

  /usr/libexec/gdb/plugins/MacsBug

If you elect choice 1 then just add the following to your ~/.gdbinit script:

  source /usr/libexec/gdb/plugins/MacsBug/gdbinit-MacsBug-without-plugin

If you want to use the plugin then add the following source command instead:

  source /usr/libexec/gdb/plugins/MacsBug/gdbinit-MacsBug

The gdbinit-MacsBug script is installed with it's load-plugin command defined as follows:

  load-plugin /usr/libexec/gdb/plugins/MacsBug/MacsBug_plugin

The load-plugin command will load the MacsBug_plugin from it's installed directory when gdbinit-MacsBug is read (i.e., when the source command in your ~/.gdbinit script is executed).

Of course you don't have to use the files in their installed location. They can be anywhere so long as the ~/.gdbinit's source command can access the gdbinit-MacsBug file with an appropriate pathname and the gdbinit-MacsBug script's load-plugin command can, in turn, access the MacsBug_plugin file. The only restriction on the load-plugin command is that the specified pathname must be a full pathname ('~' cannot be used).

From this point on this README assumes you are installing the plugin.

 

4. Using Gdb's HELP Commands For MacsBug

Once gdb is loaded type help to see a summary of all gdb command classes. There are three additional classes for MacsBug: "macsbug", "screen", and "useful".

Typing help macsbug gives a summary of all the MacsBug commands.

Typing help screen gives a summary of all MacsBug screen UI-related commands which are additions to this MacsBug implementation.

Typing help useful gives a list of "useful" gdb commands that could be used to extend the MacsBug script or for your own gdb define commands. Some of these are used internally, or are plugin descendants from the original gdb script, or are just plain useful in their own right and should probably be in gdb in the first place!.

Two existing gdb help classes, "aliases" and "support" also list some MacsBug commands. The "aliases" class lists aliases for some commands that don't follow the standard gdb command abbreviation conventions (e.g., sc6 is the same as sc). The "support" class lists the set options.

As indicated at the end of the help class summary you can type mb-notes to get some additional information specifically related to this implementation of MacsBug. These notes are also repeated in the next section.

Finally, also as indicated in the help summary, typing help followed by a command name displays a summary for that specific command.

 

5. General Comments About Gdb MacsBug

Below are a list of some general notes about the Gdb MacsBug. Much of this information is also available by type "mb-notes"(or help mb-notes) into gdb.

 

6. Terminal Considerations

Gdb MacsBug assumes it is writing to a terminal window that should be configured as follows:

With the exception of bolding, the OSX standard terminal window supports all these characteristics (use its preferences to configure for extra bolding). The only colors MacsBug uses are red and blue. All other output uses the default font color.

Color and bolding are, of course, not a strict requirement. But Xterm, 8-bit support is. While an OSX standard terminal has no problems with these requirements you do need to verify them when using a Telenet program.

Finally, different terminal programs as well as the OSX terminal window itself have their own unique "quirks" and timing considerations or communication failures may mangle the display. If this should happen while the MacsBug screen is up you will need to type a refresh command to restore the proper display.

 

7. Changes in MacsBug 1.5

 

8. Changes in MacsBug 1.4

 

9. Changes in MacsBug 1.3

 

10. Changes in MacsBug 1.2

 

11. Changes in MacsBug 1.1