public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* GDB problem with statically linked application
@ 2005-09-20 18:50 Ajay Patel
  2005-09-20 19:08 ` David Highley
  0 siblings, 1 reply; 5+ messages in thread
From: Ajay Patel @ 2005-09-20 18:50 UTC (permalink / raw)
  To: Daniel Jacobowitz, gdb

[-- Attachment #1: Type: text/plain, Size: 1343 bytes --]

Hi Daniel,

Here is the summary/Problem report.

I compile gdb with gdb-6.3-orig + patches from gdb_6.3-6.diff for
both powerpc and i686.

Using this gdb on respective arch, I ran different tests
on a simple test program. (Program attached).
I normally comile this program through 
"gcc -g -static -o pthread_test pthread_test.c -lpthread"
or through cross compilation.

On All tests, I setup a breakpoint in run_thread1.
As soon as breakpoint is encountered in non-main thread,
the program terminates with following message.
"Program terminated with signal SIGTRAP, Trace/breakpoint trap".

Test 1 on PowerPC (Apple's EMAC)
  Kernel Version-2.6.11.2 (from kernel.org), Glibc 2.3.5 (with NPTL).
  Program terminated with signal SIGTRAP, Trace/breakpoint trap

Test 2 on PowerPC (Apple's EMAC)
  Kernel Version-2.6.11.2 (from kernel.org), Glibc 2.3.4 (with NPTL).
  Program terminated with signal SIGTRAP, Trace/breakpoint trap

Test 3 on i686 (Dell optiplex)
  Kernel Version-2.6.13.2 (from kernel.org), glibc 2.3.4 (with NPTL).
  Program terminated with signal SIGTRAP, Trace/breakpoint trap

Test 4 on i686 (Dell optiplex)
  Kernel Version-2.6.13.2 (from kernel.org), glibc 2.3.3 (Linux threads)
  Program terminated with signal SIGTRAP, Trace/breakpoint trap

If you need more info please let me know.

Thanks for your help.

Thanks
Ajay



[-- Attachment #2: pthread_test.c --]
[-- Type: application/octet-stream, Size: 1052 bytes --]

/* $OpenBSD: pthread_test.c,v 1.4 2003/07/31 21:48:05 deraadt Exp $ */
/* PUBLIC DOMAIN Oct 2002 <marc@snafu.org> */

#include <signal.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <pthread.h>
#include <stdio.h>
#include <sys/fcntl.h>
#include <sys/types.h>
#include <sys/time.h>
#include <errno.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <string.h>


void * run_thread1 (void *arg)
{
    printf ("Starting THREAD1\n");
    while (1) {
	sleep(4);
    	printf ("THREAD1 is going back to sleep\n");
    }
}


void * run_thread2 (void *arg)
{
    printf ("Starting THREAD2\n");
    while (1) {
	sleep(4);
    	printf ("THREAD2 is going back to sleep\n");
    }
}

int
main (int argc, char **argv)
{
    int i;
    pthread_t thread1;
    pthread_t thread2;

    pthread_create (&thread1, NULL, run_thread1, NULL);
    pthread_create (&thread2, NULL, run_thread2, NULL);
    sleep (1);

    while (1) {
	sleep(4);
    	printf ("Main thread is going back to sleep\n");
    }
}

^ permalink raw reply	[flat|nested] 5+ messages in thread
[parent not found: <1127244795.20581@horse.he.net>]

end of thread, other threads:[~2005-09-20 19:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-20 18:50 GDB problem with statically linked application Ajay Patel
2005-09-20 19:08 ` David Highley
2005-09-20 19:14   ` Daniel Jacobowitz
     [not found] <1127244795.20581@horse.he.net>
2005-09-20 19:53 ` David Highley
2005-09-20 19:59   ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).