Configuring Default Startup Actions Using Initialization Files

You can use an initialization file to execute specific commands when the debugger starts up. For example, you can create an initialization file to load a debuggee as soon as the debugger starts.

You can have an initialization file in your home directory as well as in your project directory. You can connect to the target in the initialization file in your home directory, and use the project initialization file to open a specific executable file and set a breakpoint.

When you start the debugger, it reads .gdbinit. The debugger first looks for the initialization file in your home directory, and then in the current directory.

Configuring Default Startup Actions

The following .gdbinit file is stored in the project directory. It does the following:


  1. Opens the executable app_name:

    idb file app_name

  2. Sets a breakpoint at main:

    break main

  3. Runs app_name:

    run

Here is the full sample .gdbinit file:

file app_name
break main
run

Submit feedback on this help topic

Copyright © 2001-2011, Intel Corporation. All rights reserved.