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

Bug 361762

Summary: Cannot toggle breakpoints if thread status is running
Product: [Tools] CDT Reporter: Ho. namkoong <nkh4947>
Component: cdt-debugAssignee: cdt-debug-inbox <cdt-debug-inbox>
Status: NEW --- QA Contact: Jonah Graham <jonah>
Severity: major    
Priority: P3 CC: cdtdoug, pawel.1.piech
Version: 8.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Ho. namkoong CLA 2011-10-23 18:05:11 EDT
Build Identifier: M20110909-1335

My Eclipse version is 3.7.1, and CDT version is 8.0.0

I made the simple code as following and debugged.


#include <stdio.h>
#include <stdlib.h>

int main(void) {
	setvbuf(stdout, NULL, _IONBF, 0);


	char str[50];

	printf("!!!Hello World!!!\n"); /* prints !!!Hello World!!! */

	scanf("%s", str);

	printf("%s", str);

	return EXIT_SUCCESS;
}


At first, debug process was suspended because of the breakpoint in the line 'setvbuf(stdout, NULL, _IONBF, 0);'

In this moment, it was OK to toggle breakpoints anywhere.

Then, I resumed the debug process, and it was stopped for waiting users' request  at the line 'scanf("%s", str);'.

Also, its thread status is running in the Debug view.

If I toggle breakpoint at this moment, following messages appear in the console view

[New Thread 7204.0x340c]
[New Thread 7204.0x2068]
[Switching to Thread 7204.0x2068]

,and process stops. 

I also tested this to different functions which require user's request like gets() or getchar().

Same thing happens with those methods, too.

I think it always happens if thread status is running.

Also, I tested this with Linux environment, and it works well in the Linux.

It only happens in the Windows.

How can I toggle breakpoint when thread status is running?

Reproducible: Always

Steps to Reproduce:
1. Debug C Project.
2. Thread status is running in the Debug View
3. Toggle breapoint