Results 1 to 5 of 5

Thread: Problem debugging Windows QT App w/ GDB

  1. #1
    Join Date
    Mar 2008
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Problem debugging Windows QT App w/ GDB

    Hi all,

    I'm having problems debugging a very simple Qt app in Windows under gdb. I'm using MinGW to compile it. I have compiled Qt for debugging and gdb seems to load the symbols for my application just fine. If I don't put any breakpoints in there, gdb even runs the application normally in the gdb environment. The problem comes about when I put a breakpoint in my application. Once I do this, I get segmentation faults when I try to run the application under gdb. When I remove the breakpoints, gdb seems to run the app just fine again.

    I know this must be something specific to Qt since I tried a very simple "hello world" app (w/o any Qt) and gdb handled this application just fine (breakpoints and all). For some reason it just chokes on breakpoints in my ultra-simple Qt app.

    Does anyone have any ideas what could be going wrong here?

    Thanks for your help!

  2. #2
    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: Problem debugging Windows QT App w/ GDB

    Do you get segmentation faults for the application or for gdb? If the former, try the backtrace (bt) command and see where and why it crashes.

  3. #3
    Join Date
    Mar 2008
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problem debugging Windows QT App w/ GDB

    The seg fault is coming from my application, not gdb. Here's the stack trace... doesn't seem very helpful though.

    #0 0x005c0065 in ?? ()
    #1 0x7c90eb94 in ntdll!LdrAccessOutOfProcessResource () from C:\WINDOWS\system32\ntdll.dll
    #2 0xeb0075fc in ?? ()
    #3 0x00007c90 in ?? ()
    #4 0x00630000 in ?? ()
    #5 0x006e0049 in ?? ()
    #6 0x002e006a in ?? ()
    #7 0x00000064 in ?? ()
    #8 0x07f40000 in ?? ()
    #9 0xfc780000 in ?? ()
    #10 0x104b0075 in ?? () from C:\Qt\4.3.4\bin\QtGuid4.dll
    #11 0xc0d87c90 in ?? ()
    #12 0x31dc0197 in ?? ()
    #13 0x32127c91 in ?? ()
    #14 0x00087c91 in ?? ()
    #15 0x0001c015 in ?? ()
    #16 0x83b00000 in ?? ()
    #17 0xf9cc0000 in ?? ()
    #18 0x00010075 in ?? ()
    #19 0xff040000 in ?? ()
    #20 0xee180075 in ?? ()
    #21 0x63a87c90 in ?? ()
    #22 0x00007c91 in ?? ()
    #23 0xff140000 in ?? ()
    #24 0x62da0075 in ?? ()
    #25 0x00007c91 in ?? ()
    #26 0x69700000 in ?? ()
    #27 0xff600025 in ?? ()
    #28 0xff400075 in ?? ()
    #29 0xff5c0075 in ?? ()
    #30 0x00010075 in ?? ()
    #31 0x00000000 in ?? ()

  4. #4
    Join Date
    Mar 2008
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problem debugging Windows QT App w/ GDB

    Again, when removing the breakpoints, the program runs fine in gdb. I am stumped

  5. #5
    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: Problem debugging Windows QT App w/ GDB

    The trace doesn't make sense. I suggest you try some other version of gdb - it may be conflicting with your mingw or something like that.

Similar Threads

  1. problem with indexes
    By MarkoSan in forum Qt Programming
    Replies: 5
    Last Post: 10th December 2007, 14:55
  2. Program crashes with assert error in xcb_lock.c
    By Valheru in forum Qt Programming
    Replies: 3
    Last Post: 18th November 2007, 19:56
  3. KDE 3.5.0 crash while opening project
    By MarkoSan in forum KDE Forum
    Replies: 2
    Last Post: 19th October 2007, 16:21
  4. Problem with SqLite and Qt
    By ad5xj in forum Newbie
    Replies: 26
    Last Post: 5th June 2007, 01:53
  5. KDE/QWT doubt on debian sarge
    By hildebrand in forum KDE Forum
    Replies: 13
    Last Post: 25th April 2007, 06: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.