Bug 215132 - No watch-on-demand support in CDT
Summary: No watch-on-demand support in CDT
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug (show other bugs)
Version: 5.0   Edit
Hardware: PC Windows XP
: P3 enhancement with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: cdt-debug-inbox@eclipse.org CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-12 20:46 EST by Rustam Abdullaev CLA
Modified: 2020-09-04 15:16 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rustam Abdullaev CLA 2008-01-12 20:46:22 EST
Build ID: M20071023-1652

This bug is about invoking a user-interactive function from a watch expression. A real-world example can be found here:
http://gcc.gnu.org/projects/tree-ssa/tree-browser.html

The only way I can do this from CDT is to add a permanent watch expression "debug_tree(tmp)". This causes two problems:
1. CDT tries to update this expression which results in my function being called multiple times. Disabling the watch doesn't seem to help (another bug? why does it evaluate a disabled watch expression?);
2. Since the function waits for user input, CDT appears to "hang", and approx. every 30 seconds displays "debug session timed out".

In a simplified test case, I want to be able to invoke func() in the example below with a single mouse click (after I add it as a watch expression) as many times as I want but _only_ when I want it.

#include <stdio.h>
void func()
  {
    printf("in func(). press Enter:"); getchar();
  }
int main()
  {
    int a; // just something to step through
    a=0;
    a++;
    a++;
    a++;
    a++;
    a++;
    return 0;
  }

Steps To Reproduce:
1. Add a watch expression "func()"
2. Step through the program
3. Notice how many times you have to press Enter in the console
4. Disable the watch
5. Notice that func() is still being invoked, multiple times

More information:

I propose:
1. Add a "manual watch update" mode with an "update" button next to the expression so that it can be updated with a single click.
2. If the expression contains a function call, switch the paused thread/application back into "running" mode until the function returns.