|
Blue Forest http://www.lslnet.com at 10:18 on June 6, 2006
Gdb debugging multithreaded programming from the time that normal?
[code]#include "Pthread.h>;
#include "Stdio.h>;
#include "Stdlib.h>;
Static int dead = 0
Void *my_thread (void *params)
{
While (dead ====== 0) (
Printf ( "my thread\n");
Sleep (3);
}
Pthread_exit (NULL);
}
Int main (int argc, char *argv[])
{
Int rc, c;
Pthread_t tid
Pthread_attr_t attr;
Pthread_attr_init (&attr);
Pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_JOINABLE);
Rc = pthread_create (&tid, &attr, my_thread, NULL);
While (getc (stdin)> 'q') are;
//dead = 1;
Pthread_cancel (tid);
Pthread_attr_destroy (&attr);
Pthread_exit (NULL);
}[/code]
Direct operating procedures, [color=red] 'q' [/color] normal withdrawal.
If the use of the LINUX operating procedures, [color=red] 'q' [/color] as dead after the general procedures that have failed to respond to any key, the process can kill. What really puzzled. |
Gdb debugging multithreaded programming from the time that normal?
Own up |
Gdb debugging multithreaded programming from the time that normal?
This sounds like gdb hijacked stdin, try this direct operating procedures, the procedures used gdb attach to you, then agent continue in operation procedures by the shell Lane 'q'
Not to put remains of the case, the content posted about LINUX console. Thx |
Gdb debugging multithreaded programming from the time that normal?
I look the way you tried it, or a problem.
[code] (Gdb) attach 6086
Attaching to process 6086
Reading symbols from /home/reach/pthread/b. . . Done.
Using host libthread_db library "/lib/tls/libthread_db.so.1."
Reading symbols from /lib/tls/libpthread.so.0. . . Done.
[Thread Debugging using libthread_db enabled]
[New Thread -1218570016 (en 6086)]
[New Thread -1218573392 (en 6087)]
Loaded symbols for /lib/tls/libpthread.so.0
Reading symbols from /lib/tls/libc.so.6. . . Done.
Loaded symbols for /lib/tls/libc.so.6
Reading symbols from /lib/ld-linux.so.2. . . Done.
Loaded symbols for /lib/ld-linux.so.2
0x0056af31 in __read_nocancel () from /lib/tls/libc.so.6
(Gdb) thread
[Current Thread is 0 (process 6086)]
(Gdb) [threads
2 Thread -1218573392 (en 6087) 0x005458dc in __nanosleep_nocancel () from /lib/tls/libc.so.6
Thread 1 -1218570016 (en 6086) 0x0056af31 in __read_nocancel () from /lib/tls/libc.so.6
(Gdb) c
Continuing.
Program received signal SIGINT, Interrupt.
[Switching To Thread -1218573392 (en 6087)]
0x005458dc in __nanosleep_nocancel () from /lib/tls/libc.so.6
(Gdb) c
Continuing.[/code]
Gdb and debugging procedures are now dead. |
Gdb debugging multithreaded programming from the time that normal?
LINUX start immediately after implementation :
Set auto-solib-add 0 |
Gdb debugging multithreaded programming from the time that normal?
! ! ! ! |
Gdb debugging multithreaded programming from the time that normal?
Set the auto-solib-add 0 doing? Please take a look at how this issue is the case?
(Gdb) set auto-solib-add 0
(Gdb) attach 26328
Attaching to process 26,328
Reading symbols from /usr/local/ace_using/uinbind/bin/uinbind. . . Done.
Thread-db.c:535 gdb-internal-error : : : Assertion thread_db_new_objfile `proc_handle.pid ====== 0 'failed.
An internal GDB error was detected. This may make further
Debugging unreliable. Quit this debugging session? (y or n) |
| |