Bug 361762 - Cannot toggle breakpoints if thread status is running
Summary: Cannot toggle breakpoints if thread status is running
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug (show other bugs)
Version: 8.0   Edit
Hardware: PC Windows 7
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: cdt-debug-inbox@eclipse.org CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-23 18:05 EDT by Ho. namkoong CLA
Modified: 2020-09-04 15:27 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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