Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Debugging "index out of range " - suggestions please - can Qt IDE provide more help ?
Forum Updated to NodeBB v4.3 + New Features

Debugging "index out of range " - suggestions please - can Qt IDE provide more help ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 287 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Anonymous_Banned275
    wrote on last edited by
    #1

    OK, I know what the error is , what I am asking is
    how do you identify the actual code where the error "comes from"?
    All I have is the line in header reporting the error. How do I backtrack the actual source of the run time error ? Or is is even possible.
    So far I have been stepping thru the code in debug mode , but it is little tedious.

    I have several similar test codes and it would be helpful if I could identify the actual line where the "index" out of range is detected.

    I know this is C code logical error, I am asking if there is a way to let Qt IDE help identifying the source , not just header line reporting the error.

    // test retrieve QStringList local data
     current data size    4
     QStringList  test data  ("address ", "B8:27:EB:11:3F:82")  @ index   1
     QStringList  test data  ("name    ", "ARM")  @ index   2
     QStringList  test data  ("address ", "B8:27:EB:11:3F:82", "    name    ", "ARM")  @ index   3
    ASSERT failure in QVector<T>::at: "index out of range", file /usr/include/x86_64-linux-gnu/qt5/QtCore/qvector.h, line 393
    The program has unexpectedly finished.
    /media/d/QT/QT_PROJECT_CAT/build-TEST_PROJECT-Desktop-Debug/TEST_PROJECT crashed
    
    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @AnneRanch said in Debugging "index out of range " - suggestions please - can Qt IDE provide more help ?:

      how do you identify the actual code where the error "comes from"?

      Use a debugger, take a look in the backtrace from where it comes from.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      3
      • mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi
        As Mr Ehrlicher says, it should be visible in the debugger window

        I added some code that crash in maindows and then it looks like this

        alt text

        1 Reply Last reply
        2
        • Christian EhrlicherC Christian Ehrlicher referenced this topic on

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved