Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Show Reason for Crash When Core Debugging

Yes. MIRunControlEventProcessor_7_0 is the version we use for any GDB>= 7.0.


From: Adam Ward <award@xxxxxxxxxxxxxx>
Sent: Jun 20, 2016 10:49 AM
To: CDT General developers list.
Subject: Re: [cdt-dev] Show Reason for Crash When Core Debugging

To fix this I added some code to MIRunControlEventProcessor#eventReceived(). Should I also add my fix to MIRunControlEventProcessor_7_0#eventReceived()?

 

From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Marc Khouzam
Sent: Thursday, June 16, 2016 8:24 AM
To: CDT General developers list. <cdt-dev@xxxxxxxxxxx>
Subject: Re: [cdt-dev] Show Reason for Crash When Core Debugging

 

> Is it possible to create and dispatch an MISignalEvent this way or create a new event for this?

You can create the event with an IExecutionDMContext being the process only,
not the thread, since you don't know what the thread is.  As for the process, it must be
the only process being debugged.  I believe the logic present in
MIRunControlEventProcessor_7_0#createEvent() does this already.


From: cdt-dev-bounces@xxxxxxxxxxx [cdt-dev-bounces@xxxxxxxxxxx] on behalf of Adam Ward [award@xxxxxxxxxxxxxx]
Sent: June 15, 2016 3:21 PM
To: CDT General developers list.
Subject: Re: [cdt-dev] Show Reason for Crash When Core Debugging

The text could be added to the process level instead. I have exhausted the route of sending a command to GDB, there isn’t one that returns the reason for the crash. The signal that produced the core file is only outputted when the connection is setup with the core file using the “-target-select core <core file>” command. The only possible route looks to be parsing the signal and reason from the MIStreamConsoleOutput received in eventReceived. Is it possible to create and dispatch an MISignalEvent this way or create a new event for this?

 

Adam

 

From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Marc Khouzam
Sent: Wednesday, June 15, 2016 1:01 PM
To: CDT General developers list. <cdt-dev@xxxxxxxxxxx>
Subject: Re: [cdt-dev] Show Reason for Crash When Core Debugging

 

You will need to figure out which thread caused the crash.
I don't see that information given by GDB when quickly looking at some traces.
There may be a command you can send to GDB that will provide that info,
but I don't know myself.

So, if you can figure out the thread id from the output received in eventReceived,
you are set.  If you cannot, then you need some other way to find the crashed thread;
if you find such a way, you will probably need a different mechanism to sent such a
request to GDB, like an extra step in the FinalLaunchSequence for a core file case.
If you cannot find a way to know which thread caused the crash, then, what you can
do is add the crash text to the process level instead of the thread level.

If you do find a way to know which thread crashed, come back to use and we can
clarify a way forward based on your finding.

Also, you can make the suggestion to the GDB community to properly report
a crashed thread in this case.  It sounds like a missing feature if they don't
do that already.

Finally, I'd love to see this contributed back to CDT if you get it working.

Thanks


From: cdt-dev-bounces@xxxxxxxxxxx [cdt-dev-bounces@xxxxxxxxxxx] on behalf of Adam Ward [award@xxxxxxxxxxxxxx]
Sent: June 15, 2016 11:19 AM
To:
cdt-dev@xxxxxxxxxxx
Subject: [cdt-dev] Show Reason for Crash When Core Debugging

Hi all,

 

I'm augmenting core debugging to show the reason for the crash on the thread label in the debug view (like what is seen when a process crashes while actively being debugged). I can see that when a process crashes while being debugged a MIExecAsyncOutput event is received by the eventReceived(Object) method in MIRunControlEventProcessor. The MIExecAsyncOutput event is used to create an MISignalEvent which is dispatched to update the UI. During core debugging an MITargetSelectCore command causes MIConsoleStreamOutput event to be received by this same eventReceived(Object) method which contains the signal and meaning in a string ("Program terminated with signal <signal>, <reason>"). Is there a way I can get an IExecutionDMContext from the MIConsoleStreamOutput so I can build an MISignalEvent or is there a better way of trying to accomplish this?

 

Thanks,

Adam

 

 


Back to the top