* thread debugging
@ 2004-05-25 9:21 MuthuKumar-15
0 siblings, 0 replies; only message in thread
From: MuthuKumar-15 @ 2004-05-25 9:21 UTC (permalink / raw)
To: gdb
Hello All.
I have a problem in thread debugging with GDB on HP-UX platform.
*** Sample program ***
/* thrd.c */
#include <pthread.h>
#include <stdio.h>
#include <errno.h>
void *func()
{
printf("Thread function\n"); pthread_exit(NULL);
}
main()
{
pthread_t *t1; int result=0;
t1=(pthread_t)malloc(sizeof(pthread_t));
bzero((void *)t1,sizeof(pthread_t));
result = pthread_create(t1, NULL, func, NULL);
if (result == EAGAIN) {
printf("EAGAIN Error\n"); free(t1); exit(1);
}
else if (result == -1) {
printf("Negative return value\n"); free(t1); exit(1);
}
pthread_exit(NULL);
free(t1);
}
**************************
$ cc -g -o thrd thrd.c
gdb execution:
$ gdb -q thrd
gdb> b main
gdb> b func
gdb> r
...
< After finishing the pthread_exit in main(),it is going to func()'s pthread_exit.>
gdb> s
It is hanging over here.........!! It is not responsing.
1. What is the problem on program? How to debug this?
2. Is it good to debug memory leaks with GDB + librtc library on HP-UX platfrom?
Regards,
Muthukumar.
---
=============== It is a "Virus Free Mail" ===============
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.690 / Virus Database: 451 - Release Date: 5/22/2004
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-05-25 9:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-25 9:21 thread debugging MuthuKumar-15
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox