From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg Galperin To: gdb@sourceware.cygnus.com, grg22@life.ai.mit.edu Subject: Re: GDB 5.1 TODO list Date: Thu, 03 Aug 2000 09:38:00 -0000 Message-id: <200008031636.MAA17233@skydive.ai.mit.edu> X-SW-Source: 2000-08/msg00027.html > > * Thread support. Right now, as soon as a thread finishes and exits, > > you're hosed. This problem is reported once a week or so. > > One thing that is desparatly needed is a few good test cases. It is > hard to tell if thread support is getting better or worse :-( > > Andrew I posted one in February which should help: http://sources.redhat.com/ml/bug-gdb/2000-02/msg00008.html Below are four versions of that same idea, which test detached or joinable threads, and exiting by calling pthread_exit() or just falling through. This tests several forms of thread exiting, as well as the ability to create a large number of threads (in a lifetime serially, not concurrently) -- as MarkK explained to me, > Be aware though, that GDB cannot handle a lot of threads right now. It > chokes on the thread ID's after that since they don't fit in 15 bits. So > you'll see something like: > > thread_db: map_id2thr failed: invalid thread handle > > after 30 or so threads with your program. > > Mark IMHO it's important to both handle thread exit and have a lifetime budget of more than a few dozen threads. --grg =========================================================================== //// //// detached, pthread_exit() //// #include #include #include #define NTHREADS 100000 #define PRINTEVERY 10000 // committing the grossness of putting an int where a void* is expected. void* exitImmediately(void* count) { if ((int)count % PRINTEVERY == 0) printf("%d\n",(int)count); pthread_exit(NULL); } int main() { pthread_t pthread; pthread_attr_t attr; int retval; int i; // set up attr to detach retval = pthread_attr_init(&attr); assert(retval==0); // success retval = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); assert(retval==0); // success for (i=0; i #include #include #define NTHREADS 100000 #define PRINTEVERY 10000 // committing the grossness of putting an int where a void* is expected. void* exitImmediately(void* count) { if ((int)count % PRINTEVERY == 0) printf("%d\n",(int)count); return NULL; } int main() { pthread_t pthread; pthread_attr_t attr; int retval; int i; // set up attr to detach retval = pthread_attr_init(&attr); assert(retval==0); // success retval = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); assert(retval==0); // success for (i=0; i #include #define NTHREADS 10000 // committing the grossness of putting an int where a void* is expected. void* exitImmediately(void* count) { printf("tid %d: I'm #%d\n", pthread_self(), (int)count); pthread_exit(NULL); } int main(int argc, char* argv[]) { pthread_t p_thread; int i, retCreate, retJoin; for (i=0; i #include #define NTHREADS 10000 // committing the grossness of putting an int where a void* is expected. void* exitImmediately(void* count) { printf("tid %d: I'm #%d\n", pthread_self(), (int)count); return NULL; } int main(int argc, char* argv[]) { pthread_t p_thread; int i, retCreate, retJoin; for (i=0; iFrom shaunj@gray-interfaces.com Thu Aug 03 12:44:00 2000 From: Shaun Jackman To: gdb@sources.redhat.com Subject: gdb and jeeni Date: Thu, 03 Aug 2000 12:44:00 -0000 Message-id: <00080313412800.00552@ed> X-SW-Source: 2000-08/msg00028.html Content-length: 819 I'm running Insight 5.0 --target=arm-elf --host=i686-pc-linux-gnu and a jeeni (ARM Angel/Ethernet). When I click "Target Settings" I get the error 'No symbol "ETH" in current context.' The stack trace is: No symbol "ETH" in current context. while executing "gdb_cmd "set remotebaud $baud"" (object "::.targetselection0.targetselection" method "::TargetSelection::change_baud" body line 4) invoked from within "::.targetselection0.targetselection change_baud .targetselection0.targetselection.f.lab.lf.childsite.cb ETH" (in namespace inscope "::TargetSelection" script line 1) invoked from within "namespace inscope ::TargetSelection {::.targetselection0.targetselection change_baud} .targetselection0.targetselection.f.lab.lf.childsite.cb ETH" ("after" script)errorCode is NONE Cheers, Shaun