2. Starting the debugger

2. Starting the debugger

Browsing

Home: Bugloo 0.3.0 reference manual

Previous chapter: Quick introduction
Next chapter: Break requests commands

Starting the debugger

2.1 Specifying the debuggee
2.2 Running the debuggee
  2.2.1 Creating a debuggee VM
  2.2.2 Starting the debuggee

Chapters

1. Quick introduction
2. Starting the debugger
3. Break requests commands
4. Execution control
5. Name Manglers and Displayers
6. Getting informations during execution
7. Debug sessions
8. Debugging of Memory Allocation
9. Recording events during the execution
10. Miscellaneous commands
11. Manual Index

The first step to debug a program is to run the debugger ! There's two ways of starting Bugloo. You can either invoke Bugloo with the program you want to debug (hereafter the debuggee), or you can set it later once that the debugger has been started.

2.1 Specifying the debuggee

Suppose you want to debug a program named stack. Let's say that you want to pass arguments foo bar gee in parameter to this program. You can do it by typing the following line into a shell:
> bugloo stack foo bar gee

This will start Bugloo, and after a short time you sould see its Logo displayed on the screen:
-----------------------------------------------------------------------
Bugloo debugger (0.3.0)                                     \   /
Fri Aug 22 14h38m17 CEST 2003                                )_(
ALPHA RELEASE                                               (/_\)
                                                         _/\/_._\/\_
email:                                                  _/\( _._ )/\_
Damien.Ciabrini@sophia.inria.fr                          _/\\___//\_
-----------------------------------------------------------------------
Loading init files...
(bugloo)

The second way of starting the debuggee you want is to specify it to Bugloo after it has been loaded. You can set the debuggee and/or its arguments at anytime by using the (debuggee) command:
(debuggee <prgm> . <arguments>)Bugloo command

Set the new debuggee and its arguments.

argumentdescription
<prgm>::intthe name of the debuggee
<arguments>::intthe debuggee's arguments

With the preceding example, you can type:
(bugloo) (debuggee stack foo bar gee)

Bugloo will set the new debuggee and will indicate it to you:
New debuggee set: stack foo bar gee
(bugloo)

Note that at anytime you can ask Bugloo some informations about the current debuggee and its arguments.
(info debuggee)Bugloo command

Get informations about the current debuggee

With the preceding example, you can type the following command to verify that the debuggee is correct.
(bugloo) (info debuggee)
Main program: stack
Command-line: foo bar gee
(bugloo)

2.2 Running the debuggee

Once that you set the debuggee, you must run it. None of the preceding command run the debuggee, they only inform Bugloo about what program to start. The process of running the debuggee is done by:

  • load the debuggee in memory,
  • starting the debuggee with the (resume) command

2.2.1 Creating a debuggee VM

(run . <arg> ...)Bugloo command

Run the debuggee program

(run/reset . <arg> ...)Bugloo command

Reset the state of the debugger and run the debuggee

argumentdescription
<arg>::stringargument to debuggee program

You typically load the debuggee in memory by using the (run) commands. This will start a new VM where the debuggee will reside in.

The two preceding commands differ only when the debuggee hast terminated, and that you want to start a new execution without exiting the debugger. The first one preserve the current state of the debugger (i.e. breakpoint that are still alive, current filters etc... will be effective in the next execution), while the second one really reset the state of the debugger.

For example, if you use the (run) With the program stack, you will get the following result:
(bugloo) (run)
Starting Debuggee VM: stack foo bar gee
VM started. (resume) to continue
(bugloo)

Note that you can change original arguments passed to the main function of the program by setting optional arguments of these two commands.

2.2.2 Starting the debuggee

When a debuggee is loaded in memory via the (run) command, it is always started in a suspended mode. This means that the program will not start its execution until you use the (resume) command. See chapter Execution control for a complete description of this command.

For example, as soon as you type type (resume) into the console, the execution of the program stack should start and terminate by printing something on the screen:
(bugloo) (resume)
loading debuggee control class...
(a.out foo bar gee)
(5 4 3 2 1)
(1 2 3 4 5)
120
Debuggee VM exited....
(bugloo)

Note that when you start Bugloo, or when you set a new debuggee, it is not necessary to type the (run) command. If you use (resume) whereas the debuggee hasn't been loaded in memory yet, Bugloo will automatically load it for you.


This page has been generated by Scribe.
Last update Thu Aug 28 17:12:18 2003