Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

Debugging Qt Applications

In the Debug mode you can interact with the debugger in several ways, including the following:

  • Go through a program line-by-line or instruction-by-instruction.
  • Interrupt running programs.
  • Set breakpoints.
  • Examine the contents of the call stack.
  • Examine and modify registers and memory contents of the debugged program.
  • Examine and modify registers and memory contents of local and global variables.
  • Examine the list of loaded shared libraries.
  • Create snapshots of the current state of the debugged program and re-examine them later.

Qt Creator displays the raw information provided by the native debuggers in a clear and concise manner with the goal to simplify the debugging process as much as possible without losing the power of the native debuggers.

In addition to the generic IDE functionality provided by stack view, views for locals and watchers, registers, and so on, Qt Creator includes features to make debugging Qt-based applications easy. The debugger plugin understands the internal layout of several Qt classes, for example, QString, the Qt containers, and most importantly QObject (and classes derived from it), as well as most containers of the C++ Standard Library and some gcc and Symbian extensions. This deeper understanding is used to present objects of such classes in a useful way.

For an example of how to debug applications in the Debug mode, see Debugging the Example Application.

For more information about the functions available in the Debug mode, see Interacting with the Debugger.

If you install Qt Creator as part of a Qt SDK, the GNU Symbolic Debugger is installed automatically and you should be ready to start debugging after you create a new project. If you want a special setup, such as using debugging tools for Windows, see Setting Up Debugger.

Modes of Operation

The debugger plugin runs in different operating modes depending on where and how the process is started and run. Some of the modes are only available for a particular operating system or platform.

You can launch the debugger in the following modes:

  • Plain to debug locally started applications, such as a Qt based GUI application.
  • Terminal to debug locally started processes that need a console, typically without a GUI.
  • Attach to debug local processes started outside Qt Creator.
  • Remote to debug a process running on a different machine.
  • Core to debug crashed processes on Unix.
  • Post-mortem to debug crashed processes on Windows.
  • TRK to debug processes running on a Symbian device.

When you click the Start Debugging button, the debugger is launched in the appropriate operating mode (plain, terminal, or TRK), based on the build and run settings for the active project. Select Debug menu options to launch the debugger in the other modes.

Plain Mode

To launch the debugger in the plain mode, click the Start Debugging button for the active project, or choose Debug > Start Debugging > Start and Debug External Application... and specify an executable.

Terminal Mode

To launch the debugger in the terminal mode, select Projects > Run Settings and select the Run in terminal check box. Then click the Start Debugging button for the active project.

Attach Mode

To launch the debugger in the attach mode, select Debug > Start Debugging > Attach to Running External Application..., and then select a process by its name or process ID to attach to.

Remote Mode

The remote mode uses a gdbserver daemon that runs on the remote machine.

To launch the debugger in the remote mode, select Debug > Start Debugging > Start and Attach to Remote Application....

Core Mode

The core mode is available only in Unix. It debugs crashed processes using the core files (crash dumps) that are generated if the setting is enabled in the shell.

To enable the dumping of core files, enter the following command in the shell from which the application will be launched:

 ulimit -c unlimited

To launch the debugger in the core mode, select Debug > Start Debugging > Attach to Core....

Post-Mortem Mode

The post-mortem mode is available only on Windows, if you have installed the debugging tools for Windows.

The Qt Creator installation program asks you whether you want to register Qt Creator as a post-mortem debugger. To change the setting, select Tools > Options... > Debugger > Common > Use Creator for post-mortem debugging.

You can launch the debugger in the post-mortem mode if an application crashes on Windows. Click the Debug in Qt Creator button in the error message that is displayed by the Windows operating system.

TRK Mode

The TRK mode is a special mode available only for Symbian. It debugs processes running on a Symbian device using the App TRK application that runs on the device.

To launch the debugger in the TRK mode, open the project, select Symbian as the target, and click the Start Debugging button.

For more information on setting up Symbian projects, see Setting Up Development Environment for Symbian.

X

rc="scripts/functions.js" type="text/javascript">
Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 64
  2. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  3. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  4. BlackBerry 10 : premières images du prochain OS de RIM qui devrait intégrer des widgets et des tuiles inspirées de Windows Phone 0
  5. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  6. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
  7. La rubrique Qt a besoin de vous ! 1
Page suivante

Le Qt Developer Network au hasard

Logo

Comment fermer une application

Le Qt Developer Network est un réseau de développeurs Qt anglophone, où ils peuvent partager leur expérience sur le framework. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt qtcreator-2.0
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web