From kdevelop-bugs Wed May 25 16:07:06 2005 From: kdevelop-bugs-admin () barney ! cs ! uni-potsdam ! de Date: Wed, 25 May 2005 16:07:06 +0000 To: kdevelop-bugs Subject: [Bug 106282] New: cannot debug multithreaded application Message-Id: <20050525180704.106282.eddyhahn () hotmail ! com> X-MARC-Message: https://marc.info/?l=kdevelop-bugs&m=118306937207169 ------- 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 #endif #include #include #include 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; }