SlickEdit Product Discussion > SlickEdit®

Ubuntu native GDB has terminated prematurely

(1/3) > >>

ChuckInDodgeville:
I'm a long time SE user, but I've never connected the gdb debug features before.  Now I am working on a project that runs on Ubuntu 20.4 and I want to use gdb from SE.  I followed the outline given in this post:

--- Quote ---https://community.slickedit.com/index.php?topic=185.msg680#msg680
--- End quote ---
The build command correctly uses the cmake generated Makefile, but my attempts to launch the Debug command all end with

--- Code: ---"Error starting debugger: GDB has terminated prematurely".
--- End code ---
 
I am using the Linux version of SlickEdit Pro 2021 (v26.0.0.6 64-bit Qt4).  I'm using g++ 9.3.0.  The project uses Qt 5 and hence autogenerates versions of all of the source files after cmake creates the makefile.

The debug command I see in the build window is like this:

--- Code: ---/home/chuck/slickedit-pro2021/bin/vsdebugio -port 8001  -prog  "/home/chuck/controller-ui/package/controller-ui/build/controller-ui" --no_hardware --port="/dev/ttyUSB0"
--- End code ---

The file specified by the -prog argument runs when I simply launch it, even in the build window.  Launching the program using the default command line gdb also works. 

Where else might I look to find out what is wrong?

Dennis:
Try this:

1) From the SlickEdit command line:  set-var def_debug_logging 1

2) Debug > Step Into

3) Debug > Stop

4) From the SlickEdit command line:  set-var def_debug_logging 0

5) In your configuration directory, under logs, there will be a debug.log, post that here.
    The contents of the log file usually reveals why GDB terminated.

ChuckInDodgeville:
Thanks Dennis.  Here's the log:

--- Code: ---chuck@cu20:~/.slickedit$ cat 26.0.0/logs/debug.log
debug[2021-12-06T08:17:24Z]Connected to 'vsdebugio' process on port 26
debug[2021-12-06T08:17:24Z]Connected to 'vsdebugio' process using tty /dev/pts/2
debug[2021-12-06T08:17:24Z]GDB starting gdb: /usr/bin/gdb
debug[2021-12-06T08:17:24Z]GDB startup arg[0]=/usr/bin/gdb
debug[2021-12-06T08:17:24Z]GDB startup arg[1]=-nx
debug[2021-12-06T08:17:24Z]GDB startup arg[2]=-interpreter=mi
debug[2021-12-06T08:17:24Z]GDB startup arg[3]=-quiet
debug[2021-12-06T08:17:24Z]GDB connect, pid=88947
debug[2021-12-06T08:17:24Z]GDB connect, alive=1
debug[2021-12-06T08:17:24Z]======================================
debug[2021-12-06T08:17:24Z]  GDB command_reply: command=-inferior-tty-set /dev/pts/2
debug[2021-12-06T08:17:24Z]  GDB command_reply: timeout=0
debug[2021-12-06T08:17:24Z]      GDB event: error reading next event -5702
debug[2021-12-06T08:17:24Z]GDB command_reply: error reading events, status=-5702
debug[2021-12-06T08:17:24Z]GDB connect: could not open tty, status=-5702
debug[2021-12-06T08:17:24Z]======================================
debug[2021-12-06T08:17:24Z]  GDB command_reply: command=-list-features
debug[2021-12-06T08:17:24Z]  GDB command_reply: timeout=0
debug[2021-12-06T08:17:24Z]      GDB event: error reading next event -5702
debug[2021-12-06T08:17:24Z]GDB command_reply: error reading events, status=-5702
debug[2021-12-06T08:17:24Z]GDB event parser: Reply did not begin with ^ :
debug[2021-12-06T08:17:24Z]======================================
debug[2021-12-06T08:17:24Z]  GDB command_reply: command=-gdb-set auto-load off
debug[2021-12-06T08:17:24Z]  GDB command_reply: timeout=0
debug[2021-12-06T08:17:24Z]      GDB event: error reading next event -5702
debug[2021-12-06T08:17:24Z]GDB command_reply: error reading events, status=-5702
debug[2021-12-06T08:17:24Z]======================================
debug[2021-12-06T08:17:24Z]  GDB command_reply: command=-environment-path -r /home/chuck/controller-ui/package/controller-ui/build/ /usr/local/sbin /usr/local/bin /usr/sbin /usr/bin /sbin /bin /usr/games /usr/local/games /snap/bin /home/chuck/slickedit-pro2021/bin/
debug[2021-12-06T08:17:24Z]  GDB command_reply: timeout=0
debug[2021-12-06T08:17:24Z]      GDB event: error reading next event -5702
debug[2021-12-06T08:17:24Z]GDB command_reply: error reading events, status=-5702
debug[2021-12-06T08:17:24Z]======================================
debug[2021-12-06T08:17:24Z]  GDB command_reply: command=-environment-cd /home/chuck/4193-controller-ui/douglas/package/controller-ui/build
debug[2021-12-06T08:17:24Z]  GDB command_reply: timeout=0
debug[2021-12-06T08:17:24Z]      GDB event: error reading next event -5702
debug[2021-12-06T08:17:24Z]GDB command_reply: error reading events, status=-5702
debug[2021-12-06T08:17:24Z]======================================
debug[2021-12-06T08:17:24Z]  GDB command_reply: command=-file-exec-and-symbols /home/chuck/controller-ui/package/controller-ui/build/controller-ui
debug[2021-12-06T08:17:24Z]  GDB command_reply: timeout=0
debug[2021-12-06T08:17:24Z]      GDB event: error reading next event -5702
debug[2021-12-06T08:17:24Z]GDB command_reply: error reading events, status=-5702
debug[2021-12-06T08:17:24Z]stopping 'vsdebugio' process

--- End code ---

Dennis:
Looks like /usr/bin/gdb is failing to start.

First thing to verify is if GDB is even installed:

--- Code: ---sudo apt install gcc gdb -y

--- End code ---

If that is copasetic but debugging still does not work, the next step would be to try the GDB which comes pre-built with SlickEdit.

Debug > Debugger Options... > Configurations

Select "SlickEdit GDB" from the list and check [x] Default native debugging configuration.

If that still does not do the trick, the next step would be to check if you can use the command line GDB debugger (/usr/bin/gdb) from a Terminal (outside of SlickEdit), then also see if <slickedit>/bin/gdb will run from a Terminal (outside of SlickEdit). 

ChuckInDodgeville:
Thank you.  Indeed, I've tried all of these. 
gdb is installed. 
I can run the program using /usr/bin/gdb from the build window or from a shell outside of SE.  Commanding "start" goes where I expect in the program.
I tried using the SE version of gdb.  It has the same result.  Here's the log.

--- Code: ---chuck@cu20:~/.slickedit$ cat 26.0.0/logs/debug.log
debug[2021-12-06T11:02:10Z]Connected to 'vsdebugio' process on port 26
debug[2021-12-06T11:02:10Z]Connected to 'vsdebugio' process using tty /dev/pts/2
debug[2021-12-06T11:02:10Z]GDB starting gdb: /home/chuck/slickedit-pro2021/bin/gdb
debug[2021-12-06T11:02:10Z]GDB startup arg[0]=/home/chuck/slickedit-pro2021/bin/gdb
debug[2021-12-06T11:02:10Z]GDB startup arg[1]=-nx
debug[2021-12-06T11:02:10Z]GDB startup arg[2]=-interpreter=mi
debug[2021-12-06T11:02:10Z]GDB startup arg[3]=-quiet
debug[2021-12-06T11:02:10Z]GDB startup arg[4]=-data-directory=/home/chuck/slickedit-pro2021/toolconfig/vsdebug/
debug[2021-12-06T11:02:10Z]GDB connect, pid=89308
debug[2021-12-06T11:02:10Z]GDB connect, alive=1
debug[2021-12-06T11:02:10Z]GDB setting PYTHONHOME: /home/chuck/slickedit-pro2021/bin/python2.7
debug[2021-12-06T11:02:10Z]======================================
debug[2021-12-06T11:02:10Z]  GDB command_reply: command=-inferior-tty-set /dev/pts/2
debug[2021-12-06T11:02:10Z]  GDB command_reply: timeout=0
debug[2021-12-06T11:02:10Z]      GDB event: error reading next event -5702
debug[2021-12-06T11:02:10Z]GDB command_reply: error reading events, status=-5702
debug[2021-12-06T11:02:10Z]GDB connect: could not open tty, status=-5702
debug[2021-12-06T11:02:10Z]======================================
debug[2021-12-06T11:02:10Z]  GDB command_reply: command=-list-features
debug[2021-12-06T11:02:10Z]  GDB command_reply: timeout=0
debug[2021-12-06T11:02:10Z]      GDB event: error reading next event -5702
debug[2021-12-06T11:02:10Z]GDB command_reply: error reading events, status=-5702
debug[2021-12-06T11:02:10Z]GDB event parser: Reply did not begin with ^ :
debug[2021-12-06T11:02:10Z]======================================
debug[2021-12-06T11:02:10Z]  GDB command_reply: command=-gdb-set auto-load off
debug[2021-12-06T11:02:10Z]  GDB command_reply: timeout=0
debug[2021-12-06T11:02:10Z]      GDB event: error reading next event -5702
debug[2021-12-06T11:02:10Z]GDB command_reply: error reading events, status=-5702
debug[2021-12-06T11:02:10Z]======================================
debug[2021-12-06T11:02:10Z]  GDB command_reply: command=-environment-path -r /home/chuck/4193-controller-ui/douglas/package/controller-ui/build/ /usr/local/sbin /usr/local/bin /usr/sbin /usr/bin /sbin /bin /usr/games /usr/local/games /snap/bin /home/chuck/slickedit-pro2021/bin/
debug[2021-12-06T11:02:10Z]  GDB command_reply: timeout=0
debug[2021-12-06T11:02:10Z]      GDB event: error reading next event -5702
debug[2021-12-06T11:02:10Z]GDB command_reply: error reading events, status=-5702
debug[2021-12-06T11:02:10Z]======================================
debug[2021-12-06T11:02:10Z]  GDB command_reply: command=-environment-cd /home/chuck/4193-controller-ui/douglas/package/controller-ui/build
debug[2021-12-06T11:02:10Z]  GDB command_reply: timeout=0
debug[2021-12-06T11:02:10Z]      GDB event: error reading next event -5702
debug[2021-12-06T11:02:10Z]GDB command_reply: error reading events, status=-5702
debug[2021-12-06T11:02:10Z]======================================
debug[2021-12-06T11:02:10Z]  GDB command_reply: command=-file-exec-and-symbols /home/chuck/4193-controller-ui/douglas/package/controller-ui/build/controller-ui
debug[2021-12-06T11:02:10Z]  GDB command_reply: timeout=0
debug[2021-12-06T11:02:10Z]      GDB event: error reading next event -5702
debug[2021-12-06T11:02:10Z]GDB command_reply: error reading events, status=-5702
debug[2021-12-06T11:02:10Z]stopping 'vsdebugio' process

--- End code ---

Navigation

[0] Message Index

[#] Next page

Go to full version