Hello,
Normal Windows C++ projects allow threads to be paused (“Freeze” is the context menu option in the Threads window), a piece of functionality which is massively useful when diagnosing/replicating deadlock/general synchronisation issues. This functionality is present in VisualGDB but does not appear to do anything. Consider this code:
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
void* ThreadFunc(void*)
{
int i = 0;
while (true)
{
printf("%i\n", ++i);
sleep(1);
}
}
int main(int argc, char** argv)
{
pthread_attr_t attr;
pthread_t thread;
int nRet = pthread_create(&thread, &attr, ThreadFunc, 0);
if (nRet != 0) exit(-1);
void* pRet = 0;
pthread_join(thread, &pRet);
return 0;
}
After starting debugging this code, then pausing execution, then right clicking on the worker thread and choosing “Freeze”, then resuming debugging, I would have liked to have seen the output stop appearing in the output window; but sadly the count continues.
Is it possible to have this functionality implemented?
Thanks very much!
-
This topic was modified 5 years, 5 months ago by DeeJayBee.