Results 1 to 3 of 3

Thread: Qt and gdb

  1. #1

    Default Qt and gdb

    gdb doesn't handle QStringLists as in
    Code:
    #include <QStringList>
    int main(int, char** ) {
      QStringList    names  = {"abc", "def", "ghi"};
      int        nrs[3] = { 10, 11, 12};
      qDebug("%s %d", qPrintable(names[1]), nrs[1]);
      return 0;
    }
    When breaking on the qDebug line
    Code:
    p names[1]
    outputs
    Code:
    Could not find operator[].
    I have installed the qt4-debuginfo rpm.
    Debugging is akward if I can't verify the content of array elements.
    (The nrs array was only to verify that gdb handles ordinary arrays properly)

    What shoudl I do or not do?
    Enno

  2. #2
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,305
    Blog Entries
    2

    Default Re: Qt and gdb

    You should include enough information for anyone to possibly replicate what you're looking at and provide context for what you are trying to do.

    TSU

  3. #3

    Default Re: Qt and gdb

    I am using an uptodate SuSE 13.2 system with Qt 4.8.6-4.4.1.
    I am writeing a largish program but the small program above already demonstrates my problem.
    Running the program it has no trouble printing names[1] as 'def' but gdb moans about not finding the [] operator.

    Any help appreciated.
    Enno

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •