Page 2 of 2 FirstFirst 12
Results 21 to 35 of 35

Thread: Configuring Qmake mkspecs after it's built

  1. #21
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Configuring Qmake mkspecs after it's built

    Which version of gdb do you have? Python has been available in gdb for some quite time now.

    I'm not willing to be build my own cross-debugging gdb
    You seem to have some obsession with building things In no situation you will have to build the debugger or anything else actually, all tools are available in binary versions for your system. And there is no "cross-debugging gdb", you may just need a multiarch gdb, which is probably a good idea anyway (the package on Ubuntu is called gdb-multiarch).
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  2. #22
    Join Date
    Jun 2012
    Posts
    219
    Thanks
    28
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Configuring Qmake mkspecs after it's built

    I'm obsessed with NOT building tools. Been there, done that too many times over the past 37 years.

    I'm using a binary version that apparently was built without support for python scripting.

    The native Ubuntu debugger has execeptions when I use it with gdbserver on a RPI. If you have a pointer for a binary to download and try, that would be great!

    Thanks,

    Dave Thomas

  3. #23
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Configuring Qmake mkspecs after it's built

    Quote Originally Posted by davethomaspilot View Post
    I'm obsessed with NOT building tools. Been there, done that too many times over the past 37 years.

    I'm using a binary version that apparently was built without support for python scripting.
    Which version is that? gdb --version will return the version information and gdb --configuration will return the build configuration. E.g. my default Ubuntu debugger returns:

    text Code:
    1. $ gdb --configuration
    2. This GDB was configured as follows:
    3. configure --host=x86_64-linux-gnu --target=x86_64-linux-gnu
    4. --with-auto-load-dir=$debugdir:$datadir/auto-load
    5. --with-auto-load-safe-path=$debugdir:$datadir/auto-load
    6. --with-expat
    7. --with-gdb-datadir=/usr/share/gdb (relocatable)
    8. --with-jit-reader-dir=/usr/lib/gdb (relocatable)
    9. --without-libunwind-ia64
    10. --with-lzma
    11. --with-python=/usr (relocatable)
    12. --with-separate-debug-dir=/usr/lib/debug (relocatable)
    13. --with-system-gdbinit=/etc/gdb/gdbinit
    14. --with-zlib
    15. --without-babeltrace
    To copy to clipboard, switch view to plain text mode 

    Maybe you simply don't have python installed?

    The native Ubuntu debugger has execeptions when I use it with gdbserver on a RPI. If you have a pointer for a binary to download and try, that would be great!
    You need the multiarch version to debug ARM binaries with it. Just "sudo apt-get install gdb-multiarch".
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  4. #24
    Join Date
    Jun 2012
    Posts
    219
    Thanks
    28
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Configuring Qmake mkspecs after it's built

    Here's the gdb I've been successfully using for remote debugging under QtCreator 2. :

    davethomaspilot@ubuntu:~/rpi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin$ ./arm-linux-gnueabihf-gdb -version
    GNU gdb (crosstool-NG linaro-1.13.1+bzr2650 - Linaro GCC 2014.03) 7.6.1-2013.10
    Copyright (C) 2013 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law. Type "show copying"
    and "show warranty" for details.
    This GDB was configured as "--host=x86_64-build_unknown-linux-gnu --target=arm-linux-gnueabihf".
    For bug reporting instructions, please see:
    <https://bugs.launchpad.net/gcc-linaro>.

    I installed gdb-multiarch but the kit I created that references it isn't presented as an option under Debug->Start Debugging->Attach to remote debug server.

    The kit IS presented for selection under Debug->Start Debugging->Start Debug Remote Server attached to process. But, I see a list of pids--no clue what that's for. Same as what I saw on QtCreator 2.x.

  5. #25
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Configuring Qmake mkspecs after it's built

    Quote Originally Posted by davethomaspilot View Post
    The kit IS presented for selection under Debug->Start Debugging->Start Debug Remote Server attached to process. But, I see a list of pids--no clue what that's for.
    You have to choose a process on the remote device which you want to debug.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. #26
    Join Date
    Jun 2012
    Posts
    219
    Thanks
    28
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Configuring Qmake mkspecs after it's built

    You have to choose a process on the remote device which you want to debug.
    So the answer to this question:

    Does QtCreator support this -- automatic launching gdbserver and the target app on the remote machine?
    Should have been NO, not

    Debug -> Start Debugging -> Start Remote Debug Server Attached to Process...
    You have to launch the process outside qtcreator then attach. Same as with the older qtcreator.

    If I do launch the remote target executable then attach using that option, I just see:

    Debugging starts
    Debugging has finished
    In the application output. That's the same as what happened in 2.x

    In 2.x QtCreator , I'm using "Attach to remote debug server" with no issues--just the small inconvenience of having to start (and shutdown) the application under gdbserver each time on the remote machine.

    In 3. QtCreator, I can't pick the Kit I've configured when I try to that option. Again, probably because QtCreator 3.x thinks compiler is incompatible with the Qt verson.

    So, I haven't figured out how to remote debug at all on 3.x. And, even if there's a way to get around the issues caused by using a qmake -spec argument, it doesn't look like there is built-in support for starting a debug session that launches the debuggee on the remote machine.

    I'm thinking maybe there's a hook for running a script before starting the debug session. Not sure where I saw that, but in that script maybe I could probably launch a script on the remote machine that starts the debuggee under gdbserver.

  7. #27
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Configuring Qmake mkspecs after it's built

    Quote Originally Posted by davethomaspilot View Post
    You have to launch the process outside qtcreator then attach.
    No, that's not neccessary the case, maybe earlier I misunderstood what you wanted to do. I think that all the devices I have been using so far with Creator (Maemo, Meego, Android, generic linux devices) could be debugged remotely without any additional actions, just by pressing the "Start debugging" button. Launching the gdb server manually is the last option if all else fails.

    If I do launch the remote target executable then attach using that option, I just see:
    (...)
    In the application output. That's the same as what happened in 2.x
    I can't possibly know what you did wrong just by reading your post. Open the debugger log view (Switch do Debug pane, on the right side of the window near the bottom you'll see a "Views" button, clicking it will let you choose "Debugger Log") and look for error messages.

    And, even if there's a way to get around the issues caused by using a qmake -spec argument
    This really has completely nothing to do with the -spec argument.

    Show us a screenshot of all the tabs (except "CMake") with details in your "Build and Run" settings pane, at least we will see what you have configured. Maybe also show us a screenshot with the device configuration pane.

    it doesn't look like there is built-in support for starting a debug session that launches the debuggee on the remote machine.
    Works fine for me. Haven't tried with Pi, though, I don't have one But it works, you can even see it in the movie here: https://www.youtube.com/watch?v=pBhT_CINPjE (around 4:00).
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  8. #28
    Join Date
    Jun 2012
    Posts
    219
    Thanks
    28
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Configuring Qmake mkspecs after it's built

    5 screenshots, more in next post


    Added after 14 minutes:


    More screen shots attached.

    As far as the debug log-- from which option?

    Are you still saying to launch the remote process I should use:

    Debug -> Start Debugging -> Start Remote Debug Server Attached to Process...

    That's where I get the list of pids, so obviously that's not what I want. But, I can attach debug log.

    Debug->Attach to Remote Debug Server hasn't the wrong kit and won't let me change it. So, the errors in the log are a result of the wrong kit being used.

    Are you saying I should just try "Start Debugging". Never tried that until your last post. It DOES look like its trying to launch the remote application, which dies because it needs superuser credentials. I can chase that.

    Thanks!
    Attached Images Attached Images
    Last edited by davethomaspilot; 17th December 2014 at 22:23.

  9. #29
    Join Date
    Jun 2012
    Posts
    219
    Thanks
    28
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Configuring Qmake mkspecs after it's built

    Show us a screenshot of all the tabs (except "CMake") with details in your "Build and Run" settings pane, at least we will see what you have configured. Maybe also show us a screenshot with the device configuration pane.
    So, does anything look wrong with the configuration?

    Is there a way to do a chmod +s on the target binary before beginning it's execution?

    Thanks,

  10. #30
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Configuring Qmake mkspecs after it's built

    Quote Originally Posted by davethomaspilot View Post
    So, does anything look wrong with the configuration?
    From your last post it seems the problem is with your application crashing.

    Is there a way to do a chmod +s on the target binary before beginning it's execution?
    You can add a deploy step that will do that using ssh. Or you can deploy using the root account in the first place.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  11. #31
    Join Date
    Jun 2012
    Posts
    219
    Thanks
    28
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Configuring Qmake mkspecs after it's built

    Running the Qt application logged in as user root causes the QSettings to be picked up from /root/.config instead of the user specific settings. So, I want to login in as user, not root, and run the binary owned by root with the -s flag set.

    So, I added a deployment step to remote command to do a "sudo rm target" before sftp'ing the new binary to the run machine.

    sudo rm -f /home/pi/Camera-Debug/Camera
    Then the sftp deployment step, and a "post sftp" deployment step:

    sudo chown root /home/pi/Camera-Debug/Camera;sudo chmod +s /home/pi/Camera-Debug/Camera
    This works for deployment, and I can run the binary on the target machine. But, when running the target executable as a debugee from Qt creator on the host machine, the application still exits because of permission problems (wiringPi library used by application must have root permissions).

    The same thing happens when I run the application locally (on the target machine) under gdbserver. So, apparently, when gdbserver runs an executable, the file's owner permissions (root) aren't used. If I do a "sudo gdbserver :1234 target-binary" on the target machine, the permission problem is avoided.

    So, I've been doing that on the older Qt Creator version, then doing the "Attach to Remote Debug Server". I can't get the kit right in the "Attach to Remote Debug Serve"r Dialog the newer version of Qt Creator-- see previous post where I pasted screen shots of everything. I've just kept using the older version after getting too frustrated trying to get the newer one (the version that wysota so kindly added a link for downloading) configured and working.

    But I'd rather use the slick "auto launch" features it looks like QtCreator supports anyway. I don't have the issue with the correct kit being picked up when I use this option in the newest version of QtCreator, but I'm still stuck with how to use gdbserver and start the application with permissions and home directory set just like a "real" user will have.

    Is there a way to tell QtCreator to do

    sudo gdbserver :1234 target_executable
    instead of

    gdbserver :1234 target_executable
    (add the sudo to run gdbserver as root)

    So, on the target machine, I did a chmod +s on /usr/bin/gdbserver. Now, I can simply do Debug->Start Debugging->Start Debugging and everything works! I figure I'll remove the -s bit on target gdbserver executable at some point.

    Is there a better way to do this (run an application with root permissions on the target machine under gdbserver)?

    Also, I still think the new QtCreator has some bug that prevents the required kit being picked up in the "Attach to Remote Debug Server". I've suggested that it's because of the

    -r -spec linux-arm-g++
    I'm using for cross compiling, but only because that's the only thing I think I'm doing that isn't down "a well beaten path".

    I've attached all the requested screen shots to help track down what's going on with that in a previous post, but I'm working ok with the setup I have now.

    Thanks,

    Dave Thomas

  12. #32
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Configuring Qmake mkspecs after it's built

    You could replace gdbserver with a script executing sudo.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  13. #33
    Join Date
    Jun 2012
    Posts
    219
    Thanks
    28
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Configuring Qmake mkspecs after it's built

    Ok, finally got everything working nicely with QtCreator 3.3.0 as provided by Wysota. But, no support for subversion?

    I saw this thread and have the same symptoms:

    http://qt-project.org/forums/viewthread/51853

    The poster fixed by moving back in Qt version, but I'm already using 4.8, so I suspect something else is going on.

  14. #34
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Configuring Qmake mkspecs after it's built

    I suggest starting a new thread for this separate problem.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  15. #35
    Join Date
    Jun 2012
    Posts
    219
    Thanks
    28
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Configuring Qmake mkspecs after it's built

    You're right--strayed a long way from the original problem.

Similar Threads

  1. Replies: 1
    Last Post: 13th December 2014, 18:08
  2. Configuring qmake to put files inside proper folder
    By Momergil in forum Qt Programming
    Replies: 3
    Last Post: 11th May 2014, 13:02
  3. Replies: 6
    Last Post: 3rd December 2010, 21:51
  4. Replies: 5
    Last Post: 25th September 2007, 11:43
  5. 4.1.4 built from source, qmake fails with Hello World
    By Mookie in forum Installation and Deployment
    Replies: 6
    Last Post: 28th June 2006, 00:13

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.