Qt - Unexpected GDB Exit - c++
I am trying to develop an application that creates an image and fills it with color pixels using bilinear interpolation and then displays it. My code so far is the following:
#include <QtCore/QCoreApplication>
#include <opencv/cv.h>
#include <opencv/highgui.h>
#include <iostream>
#include <string>
#include <sys/stat.h>
using namespace cv;
int main()
{
Mat image;
image.create( 500, 500, CV_8UC3);
//upper left corner
Vec3b ul( 255, 0, 0 );
//upper right corner
Vec3b ur( 0, 255, 0 );
//bottom left corner
Vec3b bl( 0, 0, 255 );
//bottom right corner
Vec3b br( 255, 0, 255 );
//for(int y=0;y<image.rows; y++)
//for(int x=0;x<image.cols;x++)
// call function to add noise
namedWindow("Colored Pixels");
imshow("Colored Pixels", image);
// shows image for 5 seconds
waitKey(10000);
return 0;
}
When I run my program in debug mode I get the following two pop up windows:
Unexpected GDB Exit
The gdb process exited unexpectedly (code 0)
and
Executable Failed
During startup program exited with code 0xc0000138
my debugger log screen shows the following:
sStarting debugger 'GdbEngine' for ABI 'x86-windows-msys-pe-32bit'...
dStart parameters: 'pixelGradient' mode: 1
dABI: x86-windows-msys-pe-32bit
dExecutable: C:\Users\encore\Desktop\Lectures\Year 3\QtCreator\pixelGradient-build-desktop-Qt_4_8_1_for_Desktop_-_MinGW__Qt_SDK__Debug\debug\pixelGradient.exe [terminal]
dDirectory: C:\Users\encore\Desktop\Lectures\Year 3\QtCreator\pixelGradient-build-desktop-Qt_4_8_1_for_Desktop_-_MinGW__Qt_SDK__Debug
dDebugger: C:\QtSDK\pythongdb\python_2.7based\gdb-i686-pc-mingw32.exe
dProject: C:\Users\encore\Desktop\Lectures\Year 3\QtCreator\pixelGradient (built: C:\Users\encore\Desktop\Lectures\Year 3\QtCreator\pixelGradient-build-desktop-Qt_4_8_1_for_Desktop_-_MinGW__Qt_SDK__Debug)
dQt: C:\QtSDK\Desktop\Qt\4.8.1\mingw
dQML server: 127.0.0.1:3768
dSysroot:
dDebug Source Loaction:
dSymbol file:
dDumper libraries: C:\QtSDK\Desktop\Qt\4.8.1\mingw\\qtc-debugging-helper\ C:\QtSDK\QtCreator\qtc-debugging-helper\168937759\ C:\Users\encore\AppData\Local\Nokia\QtCreator\qtc-debugging-helper\168937759\
d
dDebugger settings:
dUseAlternatingRowColours: false (default: false)
dFontSizeFollowsEditor: false (default: false)
dUseMessageBoxForSignals: true (default: true)
dAutoQuit: false (default: false)
dLogTimeStamps: false (default: false)
dVerboseLog: false (default: false)
dCloseBuffersOnExit: false (default: false)
dSwitchModeOnExit: false (default: false)
dUseDebuggingHelper: true (default: true)
dUseCodeModel: true (default: true)
dShowThreadNames: false (default: false)
dUseToolTips: false (default: false)
dUseToolTipsInLocalsView: false (default: false)
dUseToolTipsInBreakpointsView: false (default: false)
dUseAddressInBreakpointsView: false (default: false)
dUseAddressInStackView: false (default: false)
dRegisterForPostMortem: false (default: false)
dLoadGdbInit: true (default: true)
dScriptFile: (default: )
dWatchdogTimeout: 20 (default: 20)
dAutoEnrichParameters: false (default: false)
dTargetAsync: false (default: false)
dMaximalStackDepth: 20 (default: 20)
dAlwaysAdjustStackColumnWidths: false (default: false)
dShowStandardNamespace: true (default: true)
dShowQtNamespace: true (default: true)
dSortStructMembers: true (default: true)
dAutoDerefPointers: true (default: true)
dAlwaysAdjustLocalsColumnWidths: false (default: false)
dListSourceFiles: false (default: false)
dSkipKnownFrames: false (default: false)
dEnableReverseDebugging: false (default: false)
dAllPluginBreakpoints: true (default: true)
dSelectedPluginBreakpoints: false (default: false)
dAdjustBreakpointLocations: true (default: true)
dAlwaysAdjustBreakpointsColumnWidths: false (default: false)
dNoPluginBreakpoints: false (default: false)
dSelectedPluginBreakpointsPattern: .* (default: .*)
dBreakOnThrow: false (default: false)
dBreakOnCatch: false (default: false)
dBreakOnWarning: false (default: false)
dBreakOnFatal: false (default: false)
dAlwaysAdjustRegistersColumnWidths: false (default: false)
dAlwaysAdjustSnapshotsColumnWidths: false (default: false)
dAlwaysAdjustThreadsColumnWidths: false (default: false)
dAlwaysAdjustModulesColumnWidths: false (default: false)
dState changed from DebuggerNotReady(0) to EngineSetupRequested(1).
dQUEUE: SETUP ENGINE
dCALL: SETUP ENGINE
dTRYING TO START ADAPTER
dENABLING TEST CASE: 0
dSTARTING C:/QtSDK/pythongdb/python_2.7based/gdb-i686-pc-mingw32.exe -i mi
dGDB STARTED, INITIALIZING IT
<1show version
<2-list-features
<3set print object on
<4set breakpoint pending on
<5set print elements 10000
<6set overload-resolution off
<7handle SIGSEGV nopass stop print
<8set unwindonsignal on
<9pwd
<10set width 0
<11set height 0
<12set auto-solib-add on
<13-interpreter-exec console "maintenance set internal-warning quit no"
<14-interpreter-exec console "maintenance set internal-error quit no"
<15-interpreter-exec console "disassemble 0 0"
<16-interpreter-exec console "python execfile('C:/QtSDK/QtCreator/share/qtcreator/dumper/bridge.py')"
<17-interpreter-exec console "python execfile('C:/QtSDK/QtCreator/share/qtcreator/dumper/dumper.py')"
<18-interpreter-exec console "python execfile('C:/QtSDK/QtCreator/share/qtcreator/dumper/qttypes.py')"
<19-interpreter-exec console "bbsetup"
dADAPTER SUCCESSFULLY STARTED
dNOTE: ENGINE SETUP OK
dState changed from EngineSetupRequested(1) to EngineSetupOk(3).
dQUEUE: SETUP INFERIOR
dState changed from EngineSetupOk(3) to InferiorSetupRequested(4).
dQUEUE: SETUP INFERIOR
dCALL: SETUP INFERIOR
sSetting up inferior...
<20set substitute-path C:/iwmake/build_mingw_opensource C:/QtSDK/Desktop/Qt/4.8.1/mingw
<21set substitute-path C:/ndk_buildrepos/qt-desktop/src C:/QtSDK/Desktop/Qt/4.8.1/mingw
<22set substitute-path C:/qt-greenhouse/Trolltech/Code_less_create_more/Trolltech/Code_less_create_more/Troll/4.6/qt C:/QtSDK/Desktop/Qt/4.8.1/mingw
Attaching to 1260 (6412)
dTaking notice of pid 1260
<23attach 1260
>=thread-group-added,id="i1"
>~"GNU gdb (GDB) 7.2\n"
>~"Copyright (C) 2010 Free Software Foundation, Inc.\n"
>~"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law. Type \"show copying\"\nand \"show warranty\" for details.\n"
>~"This GDB was configured as \"i686-pc-mingw32\".\nFor bug reporting instructions, please see:\n"
>~"<http://www.gnu.org/software/gdb/bugs/>.\n"
>&"show version\n"
>~"GNU gdb (GDB) 7.2\n"
>~"Copyright (C) 2010 Free Software Foundation, Inc.\n"
>~"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law. Type \"show copying\"\nand \"show warranty\" for details.\n"
>~"This GDB was configured as \"i686-pc-mingw32\".\nFor bug reporting instructions, please see:\n"
>~"<http://www.gnu.org/software/gdb/bugs/>.\n"
>1^done
dPARSING VERSION: 1^done
d
dSUPPORTED GDB VERSION GNU gdb (GDB) 7.2
dCopyright (C) 2010 Free Software Foundation, Inc.
dLicense GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
dThis is free software: you are free to change and redistribute it.
dThere is NO WARRANTY, to the extent permitted by law. Type "show copying"
dand "show warranty" for details.
dThis GDB was configured as "i686-pc-mingw32".
dFor bug reporting instructions, please see:
d<http://www.gnu.org/software/gdb/bugs/>.
dGNU gdb (GDB) 7.2
dCopyright (C) 2010 Free Software Foundation, Inc.
dLicense GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
dThis is free software: you are free to change and redistribute it.
dThere is NO WARRANTY, to the extent permitted by law. Type "show copying"
dand "show warranty" for details.
dThis GDB was configured as "i686-pc-mingw32".
dFor bug reporting instructions, please see:
d<http://www.gnu.org/software/gdb/bugs/>.
d
dUSING GDB VERSION: 70200, BUILD: 2010
>2^done,features=["frozen-varobjs","pending-breakpoints","thread-info","python"]
dFEATURES: 2^done,data={features=["frozen-varobjs","pending-breakpoints","thread-info","python"]}
d
>&"set print object on\n"
>3^done
>&"set breakpoint pending on\n"
>4^done
>&"set print elements 10000\n"
>5^done
>&"set overload-resolution off\n"
>6^done
>&"handle SIGSEGV nopass stop print\n"
>~"Signal Stop\tPrint\tPass to program\tDescription\n"
>~"SIGSEGV Yes\tYes\tNo\t\tSegmentation fault\n"
>7^done
>&"set unwindonsignal on\n"
>8^done
>&"pwd\n"
>~"Working directory C:\\Users\\encore.\n"
>9^done
>&"set width 0\n"
>10^done
>&"set height 0\n"
>11^done
>&"set auto-solib-add on\n"
>12^done
>13^done
>14^done
>&"A syntax error in expression, near `0'.\n"
>15^error,msg="A syntax error in expression, near `0'."
>16^done
>17^done
>18^done
>~"dumpers=[{type=\"QLinkedList\",formats=\"\"},{type=\"QSize\",formats=\"\"},{type=\"QFileInfo\",formats=\"\"},{type=\"QAbstractItemModel\",formats=\"\"},{type=\"std__stack\",formats=\"\"},{type=\"QTextDocument\",formats=\"\"},{type=\"QTJSC__JSValue\",formats=\"\"},{type=\"__gnu_cxx__hash_set\",formats=\"\"},{type=\"QStringList\",formats=\"\"},{type=\"QRegion\",formats=\"\"},{type=\"std__wstring\",formats=\"\"},{type=\"QString\",formats=\"Inline,Separate Window\",editable=\"true\"},{type=\"QTextCodec\",formats=\"\"},{type=\"QBasicAtomicInt\",formats=\"\"},{type=\"QScriptValue\",formats=\"\"},{type=\"QTime\",formats=\"\"},{type=\"QSharedData\",formats=\"\"},{type=\"std__vector\",formats=\"\",editable=\"true\"},{type=\"QRegExp\",formats=\"\"},{type=\"QTextCursor\",formats=\"\"},{type=\"QxXmlAttributes\",formats=\"\"},{type=\"QDateTime\",formats=\"\"},{type=\"QList\",formats=\"\"},{type=\"QStandardItem\",formats=\"\"},{type=\"std__deque\",formats=\"\"},{type=\"QFixed\",formats=\"\"},{type=\"QHash\",formats=\"\"},{type=\"QSharedPointer\",formats=\"\"},{type=\"QUrl\",formats=\"\"},{type=\"std__set\",formats=\"\"},{type=\"std__list\",formats=\"\"},{type=\"std__basic_string\",formats=\"\"},{type=\"QPoint\",formats=\"\"},{type=\"QHostAddress\",formats=\"\"},{type=\"QStack\",formats=\"\"},{type=\"QScopedPointer\",formats=\"\"},{type=\"QRectF\",formats=\"\"},{type=\"QMultiMap\",formats=\"\"},{type=\"QMapNode\",formats=\"\"},{type=\"QModelIndex\",formats=\"Normal,Enhanced\"},{type=\"QLocale\",formats=\"\"},{type=\"QSharedDataPointer\",formats=\"\"},{type=\"QVariant\",formats=\"\"},{type=\"string\",formats=\"\",editable=\"true\"},{type=\"QBasicAtomicPointer\",formats=\"\"},{type=\"QVector\",formats=\"\",editable=\"true\"},{type=\"QDate\",formats=\"\"},{type=\"QFile\",formats=\"\"},{type=\"QAtomicInt\",formats=\"\"},{type=\"TBuf\",formats=\"\"},{type=\"QWeakPointer\",formats=\"\"},{type=\"QSizeF\",formats=\"\"},{type=\"__m128\",formats=\"As Floats,As Doubles\"},{type=\"boost__optional\",formats=\"\"},{type=\"wstring\",formats=\"\"},{type=\"QPointF\",formats=\"\"},{type=\"TLitC\",formats=\"\"},{type=\"QRect\",formats=\"\"},{type=\"QByteArray\",formats=\"\"},{type=\"QMap\",formats=\"\"},{type=\"boost__shared_ptr\",formats=\"\"},{type=\"QChar\",formats=\"\"},{type=\"QDir\",formats=\"\"},{type=\"QPixmap\",formats=\"\"},{type=\"QFlags\",formats=\"\"},{type=\"std__map\",formats=\"\"},{type=\"QHashNode\",formats=\"\"},{type=\"QTemporaryFile\",formats=\"\"},{type=\"QObject\",formats=\"\"},{type=\"Eigen__Matrix\",formats=\"\"},{type=\"std__string\",formats=\"\",editable=\"true\"},{type=\"QImage\",formats=\"Normal,Displayed\"},{type=\"QSet\",formats=\"\"},],hasInferiorThreadList=\"1\"\n"
>19^done
>&"set substitute-path C:/iwmake/build_mingw_opensource C:/QtSDK/Desktop/Qt/4.8.1/mingw\n"
>20^done
>&"set substitute-path C:/ndk_buildrepos/qt-desktop/src C:/QtSDK/Desktop/Qt/4.8.1/mingw\n"
>21^done
>&"set substitute-path C:/qt-greenhouse/Trolltech/Code_less_create_more/Trolltech/Code_less_create_more/Troll/4.6/qt C:/QtSDK/Desktop/Qt/4.8.1/mingw\n"
>22^done
>&"attach 1260\n"
>~"Attaching to process 1260\n"
>=thread-group-started,id="i1",pid="1260"
sThread group i1 created
>=thread-created,id="1",group-id="i1"
sThread 1 created
>~"[New Thread 1260.0x190c]\n"
s[New Thread 1260.0x190c]
>23^running
Inferior attached, thread 6412 resumed
sSetting breakpoints...
dSetting breakpoints...
<24maint print msymbols C:/Users/encore/AppData/Local/Temp/gdb_ns_.Dq6408
>*running,thread-id="all"
>=thread-created,id="2",group-id="i1"
sThread 2 created
>~"[New Thread 1260.0xf9c]\n"
s[New Thread 1260.0xf9c]
>*running,thread-id="all"
>=thread-exited,id="2",group-id="i1"
sThread 2 in group i1 exited
>=thread-exited,id="1",group-id="i1"
sThread 1 in group i1 exited
>=thread-group-exited,id="i1"
sThread group i1 exited
>&"During startup program exited with code 0xc0000138.\n"
>23^error,msg="During startup program exited with code 0xc0000138."
dCOOKIE FOR TOKEN 23 ALREADY EATEN (InferiorSetupRequested). TWO RESPONSES FOR ONE COMMAND?
dNOTE: INFERIOR EXITED
dState changed from InferiorSetupRequested(4) to InferiorExitOk(16).
dState changed from InferiorExitOk(16) to InferiorShutdownOk(19).
dState changed from InferiorShutdownOk(19) to EngineShutdownRequested(20).
dQUEUE: SHUTDOWN ENGINE
sExecutable failed: During startup program exited with code 0xc0000138.
dCALL: SHUTDOWN ENGINE
dINITIATE GDBENGINE SHUTDOWN IN STATE 0, PROC: 2
<25-gdb-exit
>&"maint print msymbols C:/Users/encore/AppData/Local/Temp/gdb_ns_.Dq6408\n"
>24^done
dFOUND NON-NAMESPACED QT
dNOTE: INFERIOR SETUP OK
dState changed from EngineShutdownRequested(20) to InferiorSetupOk(6).
dState changed from InferiorSetupOk(6) to EngineRunRequested(7).
dQUEUE: RUN ENGINE
dCALL: RUN ENGINE
dNOTE: ENGINE RUN AND INFERIOR STOP OK
dState changed from EngineRunRequested(7) to InferiorStopOk(14).
dNOTE: INFERIOR RUN REQUESTED
dState changed from InferiorStopOk(14) to InferiorRunRequested(10).
sRunning requested...
<26-exec-continue
>25^exit
dGDB CLAIMS EXIT; WAITING
dGDB PROCESS FINISHED, status 0, code 0
dNOTE: ENGINE ILL ******
dState changed BY FORCE from InferiorRunRequested(10) to InferiorStopRequested(13).
dATTEMPT TO INTERRUPT INFERIOR
sStop requested...
dTRYING TO INTERRUPT INFERIOR
dCANNOT INTERRUPT 1260
do you have any idea as to how I can handle this?
Exit code 0xc0000138 is STATUS_ORDINAL_NOT_FOUND (I checked it by perl -MWin32::Status -E 'say $Win32::Status::INTEGER_TO_SYMBOL{ 0xc0000138 }', it can also be found in the ntstatus.h header, e.g. http://source.winehq.org/source/include/ntstatus.h)
An "ordinal not found" error means that some function provided by a DLL couldn't be found; possibly the wrong version of the DLL was loaded. I'm not sure if the same error can be produced when a DLL is entirely missing.
Can you verify the following?
OpenCV DLL(s) exist
OpenCV DLL(s) are in PATH
OpenCV DLL(s) match the version of your <opencv/*> headers
OpenCV libs are listed in your .pro file; there should be some LIBS+=... statements relating to OpenCV. There's an example of what it might look like here - http://mobidevelopers.wordpress.com/2009/01/29/qt-and-opencv/
Never mind I just reinstalled everything. It seems some files were colliding with another installation I'd done in the past ;)
Related
GDB STM32 Clion flash but no debug
I have successfully set up gdb to debug stm32 on Clion. However, it's only able to flash the .elf on to the target, Clion exits the debugging mode immediately when the flashing is done. I would like of course to have the ability to properly debug using breakpoints, etc Here are the debugging properties : I believe I should put something in target remote args and that all my problem arise from here. I've tested with target extended-remote \\.\COM5 but it ended with a failure Content of the args file : target extended-remote \\.\COM5 monitor swdp_scan attach 1 load set mem inaccessible-by-default off run Here is the Clion console : arm-none-eabi-gdb.exe cmake-build-debug\EPUCK2Test.elf --interpreter=mi --command=cmake-build-debug\args =thread-group-added,id="i1" ~"GNU gdb (GNU Tools for Arm Embedded Processors 7-2017-q4-major) 8.0.50.2017112 8-git\n" ~"Copyright (C) 2017 Free Software Foundation, Inc.\n" ~"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\ nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law. Type \"show copying\"\nand \"show wa rranty\" for details.\n" ~"This GDB was configured as \"--host=i686-w64-mingw32 --target=arm-none-eabi\". \nType \"show configuration\" for configuration details." ~"\nFor bug reporting instructions, please see:\n" ~"<http://www.gnu.org/software/gdb/bugs/>.\n" ~"Find the GDB manual and other documentation resources online at:\n<http://www. gnu.org/software/gdb/documentation/>.\n" ~"For help, type \"help\".\n" ~"Type \"apropos word\" to search for commands related to \"word\"...\n" ~"Reading symbols from cmake-build-debug\\EPUCK2Test.elf..." ~"done.\n" #"Target voltage: ABSENT!\n" #"Available Targets:\n" #"No. Att Driver\n" #" 1 STM32F40x M3/M4\n" =thread-group-started,id="i1",pid="1" =thread-created,id="1",group-id="i1" ~"HAL_GetTick () at D:/Data/Dev/Minor/STM32/EPUCK2Test/Drivers/STM32F4xx_HAL_Dri ver/Src/stm32f4xx_hal.c:326\n" ~"326\t}\n" *stopped,frame={addr="0x08000744",func="HAL_GetTick",args=[],file="D:/Data/Dev/M inor/STM32/EPUCK2Test/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c",fullname ="D:\\Data\\Dev\\Minor\\STM32\\EPUCK2Test\\Drivers\\STM32F4xx_HAL_Driver\\Src\\s tm32f4xx_hal.c",line="326"},thread-id="1",stopped-threads="all" +download,{section=".isr_vector",section-size="392",total-size="49699"} +download,{section=".isr_vector",section-sent="392",section-size="392",total-sen t="392",total-size="49699"} +download,{section=".text",section-size="4264",total-size="49699"} +download,{section=".rodata",section-size="20",total-size="49699"} +download,{section=".ARM",section-size="8",total-size="49699"} +download,{section=".init_array",section-size="8",total-size="49699"} +download,{section=".fini_array",section-size="4",total-size="49699"} +download,{section=".data",section-size="1084",total-size="49699"} =cmd-param-changed,param="mem inaccessible-by-default",value="off" =thread-exited,id="1",group-id="i1" =thread-group-exited,id="i1" =thread-group-started,id="i1",pid="42000" =thread-created,id="1",group-id="i1" *running,thread-id="all" com.jetbrains.cidr.execution.debugger.backend.gdb.GDBDriver$GDBCommandException: To open a remote debug connection, you need to specify what serial device is attached to the remote system (e.g. /dev/ttyS0, /dev/ttya, COM1, etc.). Debugger disconnected Process finished with exit code 0 GDB Server stopped, exit code 1 The end of the log is quite odd, it looks like for some reason gdb has been disconnected from the target com.jetbrains.cidr.execution.debugger.backend.gdb.GDBDriver$GDBCommandException: To open a remote debug connection, you need to specify what serial device is attached to the remote system (e.g. /dev/ttyS0, /dev/ttya, COM1, etc.). Debugger disconnected What is even stranger is that there is no such "disconnection" when running the very same command arm-none-eabi-gdb.exe cmake-build-debug\EPUCK2Test.elf --interpreter=mi --command=cmake-build-debug\args directly in the terminal. Thanks in advance for your help
The problem you are seeing is probably related to https://sourceware.org/bugzilla/show_bug.cgi?id=28711
How to debug Fiware-Orion
I'm new to this field. I've installed Fiware-orion via source on my VM (centOS), by following the link below: https://fiware-orion.readthedocs.io/en/master/admin/build_source/index.html. Currently I'm working on a Fiware-Orion issue, but I don't know how to debug Fiware-Orion. I've searched on google and Official documentation of Fiware-Orion but I don't find any relative documentation/material related to Fiware-Orion debugging. I've find some commands related to Orion debugging (but I don't know whether these commands are correct or not) and I'm following these commands: -> First installed orion from source and mongoDB then, make di ./BUILD_DEBUG/src/app/contextBroker/contextBroker -port 1026 curl localhost:1026/version gdb ./BUILD_DEBUG/src/app/contextBroker/contextBroker -tui b (lineNo) run [root#localhost fiware-orion]# gdb ./BUILD_DEBUG/src/app/contextBroker/contextBroker GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-100.el7 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 "x86_64-redhat-linux-gnu". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... Reading symbols from /root/workingDir/fiware-orion/BUILD_DEBUG/src/app/contextBroker/contextBroker...done. (gdb) b 101 Breakpoint 1 at 0x6033c9: file /root/workingDir/fiware-orion/src/app/contextBroker/contextBroker.cpp, line 101. (gdb) run Starting program: /root/workingDir/fiware-orion/./BUILD_DEBUG/src/app/contextBroker/contextBroker [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". Breakpoint 1, fileExists (path=0xbfc380 <pidPath> "/tmp/contextBroker.pid") at /root/workingDir/fiware-orion/src/app/contextBroker/contextBroker.cpp:371 371 if (access(path, F_OK) == 0) Missing separate debuginfos, use: debuginfo-install boost-filesystem-1.53.0-27.el7.x86_64 boost-regex-1.53.0-27.el7.x86_64 boost-system-1.53.0-27.el7.x86_64 boost-thread-1.53.0-27.el7.x86_64 cyrus-sasl-lib-2.1.26-23.el7.x86_64 glibc-2.17-292.el7.x86_64 gmp-6.0.0-15.el7.x86_64 gnutls-3.3.29-9.el7_6.x86_64 keyutils-libs-1.5.8-3.el7.x86_64 krb5-libs-1.15.1-37.el7_7.2.x86_64 libcom_err-1.42.9-16.el7.x86_64 libcurl-7.29.0-54.el7_7.1.x86_64 libffi-3.0.13-18.el7.x86_64 libgcc-4.8.5-39.el7.x86_64 libgcrypt-1.5.3-14.el7.x86_64 libgpg-error-1.12-3.el7.x86_64 libicu-50.1.2-15.el7.x86_64 libidn-1.28-4.el7.x86_64 libselinux-2.5-14.1.el7.x86_64 libssh2-1.8.0-3.el7.x86_64 libstdc++-4.8.5-39.el7.x86_64 libtasn1-4.10-1.el7.x86_64 libuuid-2.23.2-61.el7_7.1.x86_64 nettle-2.7.1-8.el7.x86_64 nspr-4.21.0-1.el7.x86_64 nss-3.44.0-7.el7_7.x86_64 nss-softokn-freebl-3.44.0-8.el7_7.x86_64 nss-util-3.44.0-4.el7_7.x86_64 openldap-2.4.44-5.el7.x86_64 openssl-libs-1.0.2k-19.el7.x86_64 p11-kit-0.23.5-3.el7.x86_64 pcre-8.32-17.el7.x86_64 zlib-1.2.7-18.el7.x86_64 (gdb) list 366 * 367 * fileExists - 368 */ 369 static bool fileExists(char* path) 370 { 371 if (access(path, F_OK) == 0) 372 { 373 return true; 374 } 375 (gdb) n 376 return false; (gdb) n 377 } (gdb) n pidFile (justCheck=true) at /root/workingDir/fiware-orion/src/app/contextBroker/contextBroker.cpp:397 397 if (justCheck == true) (gdb) print justCheck $1 = true (gdb) list 876 { 877 LM_X(1, ("Fatal Error (when option '-https' is used, option '-cert' is mandatory)")); 878 } 879 } 880 881 notificationModeParse(notificationMode, ¬ificationQueueSize, ¬ificationThreadNum); // This should be called before contextBrokerInit() 882 LM_T(LmtNotifier, ("notification mode: '%s', queue size: %d, num threads %d", notificationMode, notificationQueueSize, notificationThreadNum)); 883 LM_I(("Orion Context Broker is running")); 884 885 if (fg == false) (gdb) n 882 LM_T(LmtNotifier, ("notification mode: '%s', queue size: %d, num threads %d", notificationMode, notificationQueueSize, notificationThreadNum)); (gdb) step 883 LM_I(("Orion Context Broker is running")); (gdb) While I'm using skip(i.e. 's') command to enter into the function but it moves to the next line. I don't know where I'm making mistakes. Actually I wanted to debug the files present inside https://github.com/telefonicaid/fiware-orion/blob/master/src/lib/ folders but I'm not able to reach there. Even, I'm not able to move out of fiware-orion/src/app/contextBroker/contextBroker.cpp class. Can anyone suggest me correct commands for debugging Fiware-Orion, or tell me where I'm making mistakes, please. Is there any proper documentation available regarding to debugging the Fiware-Orion?
To debug Orion you would need it compiled in DEBUG mode. The release that you have installed is not. To get a debuggable Orion, you'll have to build it from source, and compile it for debugging. To build Orion from sources, check out the documentation here: https://github.com/telefonicaid/fiware-orion/blob/master/doc/manuals/admin/build_source.md. Build Orion using the make target "di", which stands for "debug install". Good luck!
If you simply want to increase the debug level of Orion itself, the command line arguments are simply: orion -logLevel DEBUG -t 0-255 -noCache -logForHumans For example, when using a Dockerized Orion, the following docker-compose could be used: orion: image: fiware/orion:${ORION_VERSION} hostname: orion container_name: fiware-orion depends_on: - mongo-db networks: - default expose: - "${ORION_PORT}" ports: - "${ORION_PORT}:${ORION_PORT}" # localhost:1026 command: -dbhost mongo-db -logLevel DEBUG -noCache -logForHumans healthcheck: test: curl --fail -s http://orion:${ORION_PORT}/version || exit 1
In my case, I use QtCreator as IDE (in particular, version 3.5.1, a bit old but it works :). QtCreator integrates nicely with gdb, so it is easy to run Orion in debug mode, set breakpoints in the graphical code editor, then stimulate Orion with requests and see how it goes (breakpoint reached, etc.).
Remote debugging HiFive Unleashed in QEMU
I'm trying to get remote debugging working in QEMU for the sifive_u machine. All tools are from the Arch Linux repositories: ➜ qemu-system-riscv64 --version QEMU emulator version 4.2.0 Copyright (c) 2003-2019 Fabrice Bellard and the QEMU Project developers ➜ riscv64-linux-gnu-gdb --version GNU gdb (GDB) 8.3.1 Copyright (C) 2019 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. I'm starting the machine as follows: qemu-system-riscv64 -M sifive_u -m 256M -bios default -nographic -S -s When I connect the debugger, I attempt to continue execution, but nothing happens; if I detach the debugger, the OpenSBI splash prints to the serial console. A typical gdb session looks something like this: GNU gdb (GDB) 8.3.1 Copyright (C) 2019 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-pc-linux-gnu --target=riscv64-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word". (gdb) target remote :1234 Remote debugging using :1234 warning: No executable has been specified and target does not support determining executable automatically. Try using the "file" command. 0x0000000000001000 in ?? () (gdb) info thread Id Target Id Frame * 1 Thread 1.1 (sifive-e51-riscv-cpu harts[0] [running]) 0x0000000000001000 in ?? () (gdb) c Continuing. ^C Program received signal SIGINT, Interrupt. 0x0000000080005a52 in ?? () (gdb) info thread Id Target Id Frame * 1 Thread 1.1 (sifive-e51-riscv-cpu harts[0] [halted ]) 0x0000000080005a52 in ?? () (gdb) detach Detaching from program: , process 1 Ending remote debugging. [Inferior 1 (process 1) detached] It seems odd that I can only see a single thread in info thread; I would expect to see one thread per hart. My hunch is that I end up attached to a hart which loses the lottery and goes to sleep, and for some none of the other harts are allowed to continue execution. If I use the virt machine, the execution starts as expected when I run continue and I see the OpenSBI splash immediately, so it seems to be linked to the use of the sifive_u in some way. Does anyone have any idea what I'm doing wrong?
https://www.qemu.org/docs/master/system/gdb.html#Debugging%20multicore%20machines See "Debugging multicore machines" in this page. (gdb)target extended-remote :1234 (gdb)add-inferior (gdb)inferior 2 (gdb)attach 2 (gdb)i threads See this picture
code blocks debugger not stoping
I have code blocks 13.12 with borland 5.5 and mingw debugger. Everytime I debug, it debugs it completely without stopping at breakpoints or cursor (when pressed run to cursor). The debug log is: Building to ensure sources are up-to-date Selecting target: Debug Adding source dir: G:\Copy_string\ Adding source dir: G:\Copy_string\ Adding file: G:\Copy_string\bin\Debug\Copy_string.exe Changing directory to: G:/Copy_string/. Set variable: PATH=.;C:\Borland\BCC55\Bin;C:\Borland\BCC55;C:\Program Files\Intel\iCLS Client;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\ WindowsPowerShell\v1.0;C:\Program Files\Intel\OpenCL SDK\2.0\bin\x86;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT [debug]Command-line: C:\CodeBlocks\MinGW\bin\gdb.exe -nx -fullname -quiet -args G:/Copy_string/bin/Debug/Copy_string.exe [debug]Working dir : G:\Copy_string Starting debugger: C:\CodeBlocks\MinGW\bin\gdb.exe -nx -fullname -quiet -args G:/Copy_string/bin/Debug/Copy_string.exe done [debug]> set prompt >>>>>>cb_gdb: Registered new type: wxString Registered new type: STL String Registered new type: STL Vector Setting breakpoints [debug]Reading symbols from G:\Copy_string\bin\Debug\Copy_string.exe...(no debugging symbols found)...done. [debug](gdb) >>>>>>cb_gdb: [debug]> show version Reading symbols from G:\Copy_string\bin\Debug\Copy_string.exe...(no debugging symbols found)...done. [debug]GNU gdb (GDB) 7.5 [debug]Copyright (C) 2012 Free Software Foundation, Inc. [debug]License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> [debug]This is free software: you are free to change and redistribute it. [debug]There is NO WARRANTY, to the extent permitted by law. Type "show copying" [debug]and "show warranty" for details. [debug]This GDB was configured as "i686-pc-mingw32". [debug]For bug reporting instructions, please see: [debug]<http://www.gnu.org/software/gdb/bugs/>. [debug]>>>>>>cb_gdb: [debug]> set confirm off Debugger name and version: GNU gdb (GDB) 7.5 [debug]>>>>>>cb_gdb: [debug]> set width 0 [debug]>>>>>>cb_gdb: [debug]> set height 0 [debug]>>>>>>cb_gdb: [debug]> set breakpoint pending on [debug]>>>>>>cb_gdb: [debug]> set print asm-demangle on [debug]>>>>>>cb_gdb: [debug]> set unwindonsignal on [debug]>>>>>>cb_gdb: [debug]> set print elements 0 [debug]>>>>>>cb_gdb: [debug]> set new-console on [debug]>>>>>>cb_gdb: [debug]> set disassembly-flavor att [debug]>>>>>>cb_gdb: [debug]> catch throw [debug]Function "__cxa_throw" not defined. [debug]Catchpoint 1 (throw) [debug]>>>>>>cb_gdb: [debug]> source C:\CodeBlocks\share\codeblocks/scripts/stl-views-1.0.3.gdb [debug]>>>>>>cb_gdb: [debug]> set follow-fork-mode child [debug]>>>>>>cb_gdb: [debug]> directory G:/Copy_string/ [debug]Source directories searched: G:/Copy_string;$cdir;$cwd [debug]>>>>>>cb_gdb: [debug]> run [debug]Starting program: G:\Copy_string\bin\Debug\Copy_string.exe Child process PID: 3596 [debug][New Thread 3596.0x4e4] [debug][Inferior 1 (process 3596) exited with code 020325214] [debug]>>>>>>cb_gdb: [Inferior 1 (process 3596) exited with code 020325214] [debug]> quit Debugger finished with status 0 `
Make sure that 'Build->Select target' is [X] Debug. Then open the source program you want to debug and click on the line where you want the debugger to stop. Lastly, use [Right Click]+[Run to cursor]. A yellow arrow should show besides the line number on your source code window.
This worked with me: choose debugger from setting. select default change the executable path to C:\msys64\mingw64\bin\gdb.exe
CDB crashes in Qt project
The riddle I am going to present to you just blowing my mind. There is a project written on Qt 4.8.2, compiled by MSVC 2010 compiler, 32-bit application. It uses lapack linear algebra library and also some networking to download and present Google maps to the user. I'm not the author of the code: the author gave me source code as well as compiled application and my task is to adapt it to my purposes. The application doesn't run on my Windows 7 Ultimate x64 system. More specifically, it runs but then hangs up showing no GUI, consuming 25% of CPU (i.e. one core) and the only way I can kill it is through Task Manager. When I compile it in Qt Creator with MSVC2010 compiler and run under CDB - it crashes; the debugger's listing is presented below. What is more - the application runs smmothly on my colleagues' computers as well as in the same Win7 system in the Virtual box. In client system the application runs but in the host system it hangs up! Re-installing the Win7 system didn't help: on the completely new system the situation repeated exactly. Simple test application (doing nothing - just showing up a simple window) is being compiled and runs smoothly. The problem is only with that 'problem' application. sStarting debugger 'CdbEngine' for ABI 'x86-windows-msvc2010-pe-32bit'... dStart parameters: 'ZModel' mode: 1 dABI: x86-windows-msvc2010-pe-32bit dExecutable: D:\trunk\build-Debug\ZModel.exe dDirectory: D:\trunk\build-Debug dDebugger: D:\Tools\WinDDK\Debuggers\cdb.exe dProject: D:\trunk\src (built: D:\trunk\src) dQt: d:\Tools\QtSDK\Desktop\Qt\4.8.1\msvc2010 dQML server: 127.0.0.1:3768 dSysroot: dDebug Source Loaction: dSymbol file: dDumper libraries: d:\Tools\QtSDK\Desktop\Qt\4.8.1\msvc2010\\qtc-debugging-helper\ D:\Tools\QtSDK\QtCreator\qtc-debugging-helper\258168559\ C:\Users\DAN\AppData\Local\Nokia\QtCreator\qtc-debugging-helper\258168559\ d dDebugger settings: dUseAlternatingRowColours: false (default: false) dFontSizeFollowsEditor: false (default: false) dUseMessageBoxForSignals: true (default: true) dAutoQuit: false (default: false) dLogTimeStamps: false (default: false) dVerboseLog: false (default: false) dCloseBuffersOnExit: false (default: false) dSwitchModeOnExit: false (default: false) dUseDebuggingHelper: true (default: true) dUseCodeModel: true (default: true) dShowThreadNames: false (default: false) dUseToolTips: false (default: false) dUseToolTipsInLocalsView: false (default: false) dUseToolTipsInBreakpointsView: false (default: false) dUseAddressInBreakpointsView: false (default: false) dUseAddressInStackView: false (default: false) dRegisterForPostMortem: false (default: false) dLoadGdbInit: true (default: true) dScriptFile: (default: ) dWatchdogTimeout: 20 (default: 20) dAutoEnrichParameters: false (default: false) dTargetAsync: false (default: false) dMaximalStackDepth: 20 (default: 20) dAlwaysAdjustStackColumnWidths: false (default: false) dShowStandardNamespace: true (default: true) dShowQtNamespace: true (default: true) dSortStructMembers: true (default: true) dAutoDerefPointers: true (default: true) dAlwaysAdjustLocalsColumnWidths: false (default: false) dListSourceFiles: false (default: false) dSkipKnownFrames: false (default: false) dEnableReverseDebugging: false (default: false) dAllPluginBreakpoints: true (default: true) dSelectedPluginBreakpoints: false (default: false) dAdjustBreakpointLocations: true (default: true) dAlwaysAdjustBreakpointsColumnWidths: false (default: false) dNoPluginBreakpoints: false (default: false) dSelectedPluginBreakpointsPattern: .* (default: .*) dBreakOnThrow: false (default: false) dBreakOnCatch: false (default: false) dBreakOnWarning: false (default: false) dBreakOnFatal: false (default: false) dAlwaysAdjustRegistersColumnWidths: false (default: false) dAlwaysAdjustSnapshotsColumnWidths: false (default: false) dAlwaysAdjustThreadsColumnWidths: false (default: false) dAlwaysAdjustModulesColumnWidths: false (default: false) dState changed from DebuggerNotReady(0) to EngineSetupRequested(1). dQUEUE: SETUP ENGINE dCALL: SETUP ENGINE Launching D:\Tools\WinDDK\Debuggers\cdb.exe -aqtcreatorcdbext.dll -lines -G -c .idle_cmd !qtcreatorcdbext.idle -y symsrv*symsrv.dll*C:\Users\DAN\AppData\Local\Temp\symbolcache*http://msdl.microsoft.com/download/symbols D:\trunk\build-Debug\ZModel.exe using D:\Tools\QtSDK\QtCreator\lib\qtcreatorcdbext64\qtcreatorcdbext.dll of 22.07.2014 18:43:57. D:\Tools\WinDDK\Debuggers\cdb.exe running as 4444 Microsoft (R) Windows Debugger Version 6.12.0002.633 AMD64 Copyright (c) Microsoft Corporation. All rights reserved. CommandLine: D:\trunk\build-Debug\ZModel.exe Symbol search path is: symsrv*symsrv.dll*C:\Users\DAN\AppData\Local\Temp\symbolcache*http://msdl.microsoft.com/download/symbols Executable search path is: ModLoad: 00000000`012c0000 00000000`01c74000 ZModel.exe ModLoad: 00000000`77410000 00000000`775bb000 ntdll.dll ModLoad: 00000000`775f0000 00000000`77770000 ntdll32.dll ModLoad: 00000000`73d90000 00000000`73dcf000 C:\Windows\SYSTEM32\wow64.dll ModLoad: 00000000`73d30000 00000000`73d8c000 C:\Windows\SYSTEM32\wow64win.dll ModLoad: 00000000`73d20000 00000000`73d28000 C:\Windows\SYSTEM32\wow64cpu.dll (130c.1300): Break instruction exception - code 80000003 (first chance) ntdll!LdrpDoDebuggerBreak+0x30: 00000000`774c1220 cc int 3 cdb: Reading initial command '.idle_cmd !qtcreatorcdbext.idle' Execute when idle: !qtcreatorcdbext.idle 0:000> <l+t <l+s dNOTE: ENGINE SETUP OK dState changed from EngineSetupRequested(1) to EngineSetupOk(3). dQUEUE: SETUP INFERIOR dState changed from EngineSetupOk(3) to InferiorSetupRequested(4). dQUEUE: SETUP INFERIOR dCALL: SETUP INFERIOR <sxn 0x4000001f <.asm source_line <!qtcreatorcdbext.pid -t 0 Source options are 1: 1/t - Step/trace by source line Source options are 5: 1/t - Step/trace by source line 4/s - List source code at prompt Assembly options: source_line Qt Creator CDB extension version 0.11 (Qt 5 support) 64 bit built Oct 11 2011. dTaking notice of pid 4876 dNOTE: INFERIOR SETUP OK dState changed from InferiorSetupRequested(4) to InferiorSetupOk(6). dState changed from InferiorSetupOk(6) to EngineRunRequested(7). dQUEUE: RUN ENGINE dCALL: RUN ENGINE <sxe eh <sxe ct <sxe et <g dNOTE: ENGINE RUN AND INFERIOR RUN OK dState changed from EngineRunRequested(7) to InferiorRunOk(11). ModLoad: 00000000`771f0000 00000000`7730f000 WOW64_IMAGE_SECTION ModLoad: 00000000`75880000 00000000`75980000 WOW64_IMAGE_SECTION ModLoad: 00000000`771f0000 00000000`7730f000 NOT_AN_IMAGE ModLoad: 00000000`77310000 00000000`7740a000 NOT_AN_IMAGE ModLoad: 00000000`75880000 00000000`75980000 C:\Windows\syswow64\kernel32.dll ModLoad: 00000000`75450000 00000000`75496000 C:\Windows\syswow64\KERNELBASE.dll ModLoad: 00000000`6f250000 00000000`6f2c9000 D:\trunk\build-Debug\Solver.dll ModLoad: 00000000`68e50000 00000000`690c6000 D:\trunk\build-Debug\QtCore4.dll ModLoad: 00000000`75600000 00000000`75700000 C:\Windows\syswow64\USER32.dll ModLoad: 00000000`77130000 00000000`771c0000 C:\Windows\syswow64\GDI32.dll ModLoad: 00000000`75370000 00000000`7537a000 C:\Windows\syswow64\LPK.dll ModLoad: 00000000`760f0000 00000000`7618d000 C:\Windows\syswow64\USP10.dll ModLoad: 00000000`75550000 00000000`755fc000 C:\Windows\syswow64\msvcrt.dll ModLoad: 00000000`76f30000 00000000`76fd0000 C:\Windows\syswow64\ADVAPI32.dll ModLoad: 00000000`75340000 00000000`75359000 C:\Windows\SysWOW64\sechost.dll ModLoad: 00000000`75700000 00000000`757f0000 C:\Windows\syswow64\RPCRT4.dll ModLoad: 00000000`75160000 00000000`751c0000 C:\Windows\syswow64\SspiCli.dll ModLoad: 00000000`75150000 00000000`7515c000 C:\Windows\syswow64\CRYPTBASE.dll ModLoad: 00000000`76fd0000 00000000`7712c000 C:\Windows\syswow64\ole32.dll ModLoad: 00000000`75ec0000 00000000`75ef5000 C:\Windows\syswow64\WS2_32.dll ModLoad: 00000000`75360000 00000000`75366000 C:\Windows\syswow64\NSI.dll ModLoad: 00000000`6f1e0000 00000000`6f249000 C:\Windows\SysWOW64\MSVCP100.dll ModLoad: 00000000`74e30000 00000000`74eef000 C:\Windows\SysWOW64\MSVCR100.dll ModLoad: 00000000`10000000 00000000`10580000 D:\trunk\build-Debug\lapack_win32_MT.dll ModLoad: 00000000`00390000 00000000`00453000 D:\trunk\build-Debug\blas_win32_MT.dll ModLoad: 00000000`76210000 00000000`7623a000 C:\Windows\syswow64\imagehlp.dll ModLoad: 00000000`70e80000 00000000`72d3f000 D:\trunk\build-Debug\QtWebKitd4.dll ModLoad: 00000000`68a00000 00000000`68e49000 D:\trunk\build-Debug\QtCored4.dll ModLoad: 00000000`6f120000 00000000`6f1d7000 C:\Windows\SysWOW64\MSVCP100D.dll ModLoad: 00000000`691d0000 00000000`69343000 D:\trunk\build-Debug\MSVCR100D.dll (130c.1300): Unknown exception - code c0000139 (first chance) s sException at 0x77671b12, code: 0xc0000139: DLL entry point not found, flags=0x1 (execution cannot be continued) in ntdll32!LdrpSnapThunk sProcess exited (3221225785) eProcess crashed eCDB crashed dNOTE: ENGINE SPONTANEOUS SHUTDOWN dState changed BY FORCE from InferiorRunOk(11) to EngineShutdownOk(22). dState changed from EngineShutdownOk(22) to DebuggerFinished(23). dQUEUE: FINISH DEBUGGER dNOTE: FINISH DEBUGGER dHANDLE RUNCONTROL FINISHED sDebugger finished. What could be done about this? How can I make application work? I've run out of ideas. Because the Win7 system is clean - there are no Qt dlls in the Windows/System32 folder - nothing to delete.
0xc0000139: DLL entry point not found - double-check that all needed dlls are there and of the proper kind *debug/release, 32/64 bit, whatever)