gdb problems with threads on mpc512x
I encountered several problem debugging multithreated software with gdb on mpc512x, remotely (gdbserver) and locally. I built gdb 6.8 from scratch, but it's crashing when I stop execution into a thread.
Did anyone get it to work correctly?
Thanks,
Daniele
--
Daniele Bosi DIGITEK S.p.A.
Via L. Romagnoli 24,
41033 Concordia sulla Secchia
Modena (MO), Italy
Tel: +39-(0)53556942 Fax. +39-(0)53554550
Web: http://www.digitek.it
Mail to: [email protected]
Dear Daniele Bosi,
Quoted 3 lines · In message <[email protected]> you wrote:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html>
Please post plain text only on mailing lists.
Quoted 6 lines
I encountered several problem debugging multithreated software with gdb on mpc512x, remotely (gdbserver) and locally.<br>
I built gdb 6.8 from scratch, but it's crashing when I stop execution into a thread.<br>
<br>
Did anyone get it to work correctly?<br>
We use GDB 6.7 in our ELDK 4.2; we didn't encounter such problems in our tests.
Best regards,
Wolfgang Denk
Signature · 4 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [email protected] I often quote myself; it adds spice to my conversation. - G. B. Shaw
I attach the listing of our program, I tried it on ELDK4.2 Freescale (kernel 2.6.24.6 by Freescale, your rootfs) and it's still giving me problems: if I issue br PrintHello
then cont-inue for some times, after a while gdb stops responding and is not even getting CTRL-C or CTRL-Z.
Of course the same works fine on i686.
I tried both gdbserver and gdb and even rebuilt the file with the target gcc.
Thank you,
Daniele
==== CUT HERE ====
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <pthread.h>
#define NUM_THREADS 5
void *PrintHello(void *threadid)
{
int c = 0;
int tid;
tid = (int)threadid;
while (++c < 100) {
printf("Hello World! It's me, thread #%d!\n", tid); sleep (1);
}
pthread_exit(NULL);
}
int main (int argc, char *argv[])
{
printf ("Hello world\n");
pthread_t threads[NUM_THREADS];
int rc, t;
for(t=0; t<NUM_THREADS; t++){
printf("In main: creating thread %d\n", t);
rc = pthread_create(&threads[t], NULL, PrintHello, (void *)t); if (rc){
printf("ERROR; return code from pthread_create() is %d\n", rc); exit(-1);
}
}
pthread_exit(NULL);
}
==== CUT HERE ====
Wolfgang Denk ha scritto: Dear Daniele Bosi, In message <[email protected]> you wrote: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> Mail to: [email protected]