From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6600 invoked by alias); 23 Nov 2004 16:58:33 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 6316 invoked from network); 23 Nov 2004 16:58:09 -0000 Received: from unknown (HELO kharon.iss.org.ua) (212.109.61.230) by sourceware.org with SMTP; 23 Nov 2004 16:58:09 -0000 Received: from Vladimir (kesl4.iss.org.ua [192.168.1.5]) by kharon.iss.org.ua (8.13.1/8.13.1) with ESMTP id iANGwdPm090547; Tue, 23 Nov 2004 18:58:39 +0200 (EET) (envelope-from vladimir.vorobyov@iss.org.ua) Content-Type: text/plain; charset="iso-8859-1" From: Vladimir Vorobyov Organization: ISS To: Daniel Jacobowitz Subject: Re: pthreads debug with gdbserver Date: Tue, 23 Nov 2004 19:33:00 -0000 User-Agent: KMail/1.4.3 Cc: Andreas Schwab , gdb@sources.redhat.com References: <200411191233.22357.vladimir.vorobyov@iss.org.ua> <200411221440.21131.vladimir.vorobyov@iss.org.ua> <20041122140643.GA402@nevyn.them.org> In-Reply-To: <20041122140643.GA402@nevyn.them.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200411231857.31740.vladimir.vorobyov@iss.org.ua> X-SW-Source: 2004-11/txt/msg00225.txt.bz2 On Monday 22 November 2004 04:06 pm, Daniel Jacobowitz wrote: > On Mon, Nov 22, 2004 at 02:40:21PM +0200, Vladimir Vorobyov wrote: > > I think I've added all missing routines and it ALMOST work. First, I > > have to specify 'set remotetimeout 60' otherwise gdb reports timeout > > error (Ignoring packet error, continuing...). > > - Is it normal ? > > Second, after I set any break point (e.g. break main) I cant use > > 'continue' command. Program stops after any instruction with SIGTRAP. > > When I force gdbserver to ignore 'stepping' variable, everything works > > fine. But Im sure it is wrong correction. Who is responsible for reseti= ng > > stepping? And why we need it? > > Try CVS; Andreas has also just implemented m68k support. I've downloaded the CVS version and have some questions: 1) When I try to debug following example: ***************************************************************************= ********** 3 #define NUM_THREADS 5 4 5 void *thread_function(void *arg) 6 { 7 printf("Hello World from %d!\n", arg); 8 sleep(10); 9 printf("Exited %d!\n", arg); 10 pthread_exit(NULL); 11 } 12 13 int main (int argc, char *argv[]) 14 { 15 pthread_t threads[NUM_THREADS]; 16 int i; 17 18 for (i =3D 0; i < NUM_THREADS; i++) 19 { 20 pthread_create(&threads[i], NULL, thread_function, (void *)= i); 21 printf("Thread %d created.\n", i); 22 } 23 for (i =3D 0; i < NUM_THREADS; i++) 24 pthread_join(threads[i], NULL); 25 26 printf("finish!\n"); 27 return (0); 28 } ***************************************************************************= *************** I put first break point to line 23. When program stops, 'info threads' show= s: (gdb) info threads 7 Thread 81926 0x40126f56 in nanosleep () from /tftpboot/rootfsdir/lib/libc.so.6 6 Thread 65541 0x40126f56 in nanosleep () from /tftpboot/rootfsdir/lib/libc.so.6 5 Thread 49156 0x40126f56 in nanosleep () from /tftpboot/rootfsdir/lib/libc.so.6 4 Thread 32771 0x40126f56 in nanosleep () from /tftpboot/rootfsdir/lib/libc.so.6 3 Thread 16386 0x40126f56 in nanosleep () from /tftpboot/rootfsdir/lib/libc.so.6 2 Thread 32769 0x40150a0e in loser_poll () from /tftpboot/rootfsdir/lib/libc.so.6 * 1 Thread 16384 main (argc=3D1, argv=3D0xbffffe04) at hello.c:23 Looks perfectly for me. After this if I set "break 9 thread 3" and "continue", program stops on=20 correct line but I can't 'step' it: (gdb) c Continuing. [Switching to Thread 16386] Breakpoint 4, thread_function (arg=3D0x0) at hello.c:9 9 printf("Exited from %d!\n", arg); (gdb) step Program received signal SIGTRAP, Trace/breakpoint trap. [Switching to Thread 32771] 0x80000540 in thread_function (arg=3D0x1) at hello.c:9 9 printf("Exited from %d!\n", arg); (gdb) c Continuing. Program received signal SIGILL, Illegal instruction. 0x80000540 in thread_function (arg=3D0x1) at hello.c:9 9 printf("Exited from %d!\n", arg); (gdb) x /20i $pc 0x80000540 : 010 0x80000542 : pea 0x800006d4 <_IO_stdin_used+26> 0x80000548 : bsrl 0x80000414 0x8000054e : addql #8,%sp 0x80000550 : clrl %sp@- 0x80000552 : bsrl 0x80000444 0x80000558 : nop 0x8000055a
: linkw %fp,#-24 0x8000055e : clrl %fp@(-24) ...... Andreas, do you have this problem on your side? 2) I still need 'set remotetimeout 30' because otherwise I get error "Ignor= ing=20 packet error, continuing...". What can gdbserver do for 30 seconds? Sorry for the long post. Could you recommend anything? Regards, Vladimir.