Qtopia Home - Classes - Hierachy - Annotated - Functions - Licenses - Reference

Debugging Qtopia Applications Using gdb

Introduction

gdb is the GNU Debugger used to monitor program execution and to examine program status in the event of a crash.

For more information on gdb, please refer to the GNU site http://www.gnu.org/software/gdb/gdb.html

The remainder of this page provides instructions on how to debug Qtopia applications using gdb in a Linux environment.

Build the Application with Debug Symbols

To build an application with debug symbols:

Run the Debug Environment

To run the debugging environmnent:

using the following commands:
   $ qvfb &
   $ qpe &
   $ gdb theProgram
   (gdb) r # run

Alternatively to debug an application outside of the Qtopia environment:

using the following commands:
   $ qvfb &
   $ gdb theProgram
   (gdb) set args - qws # we need this to hook to the virtual frame buffer.
   (gdb) list # if you want to list the main.cpp file
   (gdb) b 6 # break at line six
   (gdb) r # run
   (gdb) s # step into
   (gdb) r # continue

Debug Crashes

If an application built with debug crashes, a core file is produced. Use the following commands to examine the core file contents:

   $ gdb theapplication core
   (gdb) backtrace full

Other References


Copyright © 2005 Trolltech Trademarks
Qtopia version 2.2.0