[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kdevelop-bugs
Subject:    [Bug 106282] New: cannot debug multithreaded application
From:       kdevelop-bugs-admin () barney ! cs ! uni-potsdam ! de
Date:       2005-05-25 16:07:06
Message-ID: 20050525180704.106282.eddyhahn () hotmail ! com
[Download RAW message or body]

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=106282         
           Summary: cannot debug multithreaded application
           Product: kdevelop
           Version: unspecified
          Platform: SuSE RPMs
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: general
        AssignedTo: kdevelop-bugs kdevelop org
        ReportedBy: eddyhahn hotmail com


Version:            (using KDE KDE 3.4.0)
Installed from:    SuSE RPMs
Compiler:          gcc 3.3.5  
OS:                Linux

If the application is multithreaded a set breakpoint in the thread never get caught.  \
Also, if it is in the bad mood the debugger gets into a wierd state and you won't be \
able to start new debugging without restarting the IDE.

In the Project Options I have the folowing addition flags:
LDFLAGS:  -lpthread
CXXFLAGS: -pthread

I've tried all combination of the above flags with no luck.

Here is a simple example just put a break point on the printf in the thread code. \
Then execute it and you will see it will not break.  Also, if you catch it in the \
right moment it will render debugger useless.

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <iostream>
#include <cstdlib>
#include <pthread.h>


using namespace std;

//void *(*__start_routine) (void *)
void* thread(void* pData)
{
	while(1)
	{
		printf("Worker has started...\r\n");
		sleep(1);
	}
}


int main(int argc, char *argv[])
{
  printf("Starting main...\r\n");

  pthread_t id;
  
  pthread_create( &id, NULL, thread, NULL);

  while( true )
	sleep(1);

  return EXIT_SUCCESS;
}


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic