Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] strange issue with GDB MI interface with pretty prints

OK, thank you guys for suggestions. I tried them and here what I've found. It is indeed a GDB bug and I could reproduce it in MI mode by sending commands that Eclipse did.
I also found why in my interactive session it would crash, it is indeed related to the order in which commands were sent. Here are the MI commands that make it crash:

-environment-cd /mypath
source /mypath/sc_dt_pretty_print_gdb.cmd
-file-exec-and-symbols --thread-group i1 /mypath/Debug/loop_restruct_test
-break-insert --thread-group i1 -d -f /mypath/loop_restruct_test.h:89
-break-insert --thread-group i1 -f /mypath/loop_restruct_test.h:91
-break-insert --thread-group i1 -f /mypath/main.cpp:13
-break-insert --thread-group i1 -t -f main
-exec-run --thread-group i1
-exec-continue --thread 1
-stack-info-depth --thread 3 
-stack-list-locals --thread 3 --frame 0 1

I believe I should file a bug with GDB, but I am still looking for a workaround... I found that if I remove line "-stack-info-depth --thread 3" then it will not crash. Alternatively, I can keep that line and add line "-thread-info 1" like this:
-exec-continue --thread 1
-stack-info-depth --thread 3 
-thread-info 1
-stack-list-locals --thread 3 --frame 0 1
This will also keep it alive. In fact this latter case happens when I debug CDT interactively, it sends -thread-info commands for all threads and those happen before -stack-list-locals and that's why it doesn't crash in the CDT debug session. And finally this would still crash it, so it should be a different thread. 
-exec-continue --thread 1
-stack-info-depth --thread 3 
-thread-info 3
-stack-list-locals --thread 3 --frame 0 1

Any suggestions? Or anything that I can try to help you with suggestions? Thanks!!

-----Original Message-----
From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Simon Marchi
Sent: Thursday, September 25, 2014 11:21 AM
To: cdt-dev@xxxxxxxxxxx
Subject: Re: [cdt-dev] strange issue with GDB MI interface with pretty prints

On 2014-09-25 02:18 PM, Marc Khouzam wrote:
> For example you might find out the crash happens because CDT uses -enable-pretty-printing which you didn't use when you originally tried in the GDB command-line.  This will allow you to know if the problem in in GDB or not.

In that case, there is for sure a GDB bug. GDB should never crash, whatever the commands you give it. A failed assertion necessarily indicates a problem with GDB.

What Marc said is still valid, if you can find a reduced set of MI commands to reproduce the crash, it will be incredibly useful for GDB devs to fix the problem.

cdt-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit

Back to the top