This is the mail archive of the gdb-prs@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gdb/669: GDB/MI -thread-list-ids diffferent then "info threads"


>Number:         669
>Category:       gdb
>Synopsis:       GDB/MI -thread-list-ids diffferent then "info threads"
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Aug 26 11:38:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     alain@qnx.com
>Release:        unknown-1.0
>Organization:
>Environment:
Solaris/QNX  for some reawson it seems to be ok on GNU/Linux
maybe because threads are created with the clone() syscall??
>Description:
-thread-list-ids does not have the same output has info threads
it does not show newly created thread.

A simple program:
#include <stdio.h>
#include <pthread.h>

void * routine(void *arg) {
        sleep(9);
        printf("hello thread\n");
}

int main() {
        pthread_t tid;
        int x =9;
        x ++;
        pthread_create(&tid, NULL, routine, NULL);
        printf("hello\n");
        printf("hello\n");
        pthread_join(tid, NULL);
        return 10;
}

# gcc -o hello -g hello.c -lpthread -lthread
# gdb -i=mi hello
....
(gdb) 
-thread-list-ids
^done,thread-ids={thread-id="4",thread-id="3",thread-id="2",thread-id="1"},number-of-threads="4"
(gdb) 
info threads
&"info threads\n"
~"  7 Thread 3          "
~"  6 Thread 2 (LWP 2)  "
~"  5 Thread 1          "
~"\n"
~"   * 4 Thread 4 (LWP 1)  "
~"  3 LWP    3          "
~"  2 LWP    2          "
~"\n"
~"     1 LWP    1          "
 
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]