Qtopia Debugging

Build the Application with Debug Symbols

To build an application with debug symbols:

  • pass -debug to configure or add debug to the .pro file CONFIG settings as follows:
        CONFIG += debug
  • build the application and install the application binary into the /opt/Qtopia/bin directory using the following commands:
        $ make clean
        $ make
        $ make install

Run the Debugging Environment

The runqtopia script supports running Qtopia in several different debugging environments. To run Qtopia in using gdb:

    runqtopia -runmode gdb

Posted by 태해

2008/06/03 01:21 2008/06/03 01:21
,
Response
No Trackback , No Comment
RSS :
http://taehae.injece.net/rss/response/131

Trackback URL : http://taehae.injece.net/trackback/131

Leave a comment

Application build modes

Qtopia applications can be built in one of four ways:

  1. quicklaunch
  2. non-quicklaunch
  3. singleexec (quicklaunch)
  4. singleexec (non-quicklaunch)

To facilitate switching between build modes, Qtopia provides two macros which are used as follows:

    #include "myheader.h"
    #include <QtopiaApplication>

    QTOPIA_ADD_APPLICATION(QTOPIA_TARGET, MyMainClass)
    QTOPIA_MAIN

The first argument to QTOPIA_ADD_APPLICATION() must be a literal string that matches the binary name that is, the value of TARGET from the .pro file. The build system defines QTOPIA_TARGET with the value of TARGET and it is recommended to use this macro.

The second argument to QTOPIA_ADD_APPLICATION() should be the name of your class. If you use the wrong value you will get a compile failure.

Building for either quicklaunch or singleexec (quicklaunch) requires these macros but the build system cannot easily determine if you have used them and the penalty for a wrong guess could be disastrous. Therefore you must use the qtopia_main CONFIG value if you use these macros or the build system will assume your application is not quicklaunch-compatible. If your application does not handle quicklaunch or is singleexec you can use the no_quicklaunch or no_singleexec CONFIG values.

For example, games do not need the speed benefits of quicklauncher (and there is a size penalty for using quicklauncher) but they do work with singleexec. So use CONFIG+=qtopia_main no_quicklaunch to indicate this.

Some applications, such as those using a custom application class, cannot use the macros. Tis prevents the use of quicklauncher but you can still work with singleexec if you make some changes to your code. You need to use the singleexec_main CONFIG value and have a main.cpp similar to the following:

    #include "myheader.h"
    #include <QtopiaApplication>

    #ifdef SINGLE_EXEC
    QTOPIA_ADD_APPLICATION(QTOPIA_TARGET, MyMainClass)
    #define MAIN_FUNC main_MyMainClass
    #else
    #define MAIN_FUNC main
    #endif

    int MAIN_FUNC( int argc, char **argv )
    {
        MyApplication a( argc, argv );
        MyWidget w;
        w.show();
        return a.exec();
    }

Posted by 태해

2008/04/28 17:24 2008/04/28 17:24
,
Response
No Trackback , No Comment
RSS :
http://taehae.injece.net/rss/response/128

Trackback URL : http://taehae.injece.net/trackback/128

Leave a comment

Add new program in qtopia phone edition

Manually running qmake is no longer supported. All application development must be enabled via configure or qtopiamake.


When editing source files and shadow building (that is, build tree != source tree) you may be interested in depot hopping. Simply set QPEDIR to the location of your build tree and the Makefiles that qtopiamake puts in the source tree will call through to those in the build tree. For example:

    cd /path/to/build
    export QPEDIR=$PWD
    cd /path/to/source/examples/application
    $QPEDIR/bin/qtopiamake # sets up shadow build to $QPEDIR/examples/application
    make # build in $QPEDIR/examples/application

Posted by 태해

2008/04/28 16:43 2008/04/28 16:43
,
Response
No Trackback , No Comment
RSS :
http://taehae.injece.net/rss/response/127

Trackback URL : http://taehae.injece.net/trackback/127

Leave a comment