[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/1] scripts/qemugdb/coroutine.py: get pthread p
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 1/1] scripts/qemugdb/coroutine.py: get pthread pointer from '(gdb) thread info $id' output |
Date: |
Tue, 14 Mar 2017 12:10:06 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 |
On 14/03/2017 12:00, Roman Penyaev wrote:
> Linux is always the same, no worries, take a look
>
> gdb/linux-thread-db.c: thread_db_pid_to_str():
> snprintf (buf, sizeof (buf), "Thread 0x%lx (LWP %ld)",
>
> but e.g. bsd output should be different:
>
> gdb/bsd-uthread.c: bsd_uthread_pid_to_str():
> xsnprintf (buf, sizeof buf, "process %d, thread 0x%lx",
>
> If this is the issue I can add third variant of getting correct
> pthread_self() and make the priority:
>
> 1. parse 'info thread'
> 2. parse 'start_thread(arg=XXX)'
> 3. go to arch_prctl() invocation.
>
> But frankly this is far from simplification, from what I've started :)
I think it's okay. Absence of libc debugging symbols is not an issue,
but the existing code was Linux-specific anyway and your version has
some advantages for robustness.
Paolo