Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 325521

Summary: [cdi][debug view] Evidence of a SIGSEGV does not exist in DSF debugger after application terminates
Product: [Tools] CDT Reporter: Jeff Johnston <jjohnstn>
Component: cdt-debug-dsf-gdbAssignee: Project Inbox <cdt-debug-dsf-gdb-inbox>
Status: NEW --- QA Contact: Jonah Graham <jonah>
Severity: normal    
Priority: P3 CC: malaperle, pawel.1.piech
Version: 7.0   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Jeff Johnston CLA 2010-09-16 16:02:10 EDT
If the following C++ application:

#include <iostream>
using namespace std;

int main() {
	int *x = 0;
	x[500] = 5;
	cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!
	return 0;
}

is run under both the old and new debuggers, both will stop at the line where x[500] is assigned 5 and note that a SIGSEGV has caused the interrupt (no console messages).  However, if the application is continued, it will exit and there is a difference between the old CDI debugger with gdb vs DSF.

With the old CDI debugger, one gets:

<terminated>hellocpp [C/C++ Application]	
	<terminated>gdb/mi (9/16/10 3:53 PM) (Exited. Signal 'SIGSEGV' received. Description: Segmentation fault.)	
	<terminated, exit value: 0>gdb (9/16/10 3:53 PM)	
	<terminated, exit value: 0>/home/jjohnstn/workspace-test-sigsegv/hellocpp/Debug/hellocpp (9/16/10 3:53 PM)	

whereas in the new case it is:

<terminated>hellocpp [C/C++ Application]	
	<terminated, exit value: 0>gdb	
	<terminated, exit value: 0>hellocpp	

I'm not sure that the exit value for hellocpp is being reported correctly in either case as this doesn't match the return code given back from running the program on the command line, but at least with the old debugger, the SIGSEGV termination information is kept via the gdb/mi termination message.

This application was created a Hello World C++ Managed Build executable and just modified with the additional 2 lines to make it SIGSEGV.