Received: from eggs.gnu.org ([2001:4830:134:3::10]:47513) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cnkLE-0004qd-AS for qemu-devel@nongnu.org; Tue, 14 Mar 2017 07:10:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cnkLA-0004m1-Tk for qemu-devel@nongnu.org; Tue, 14 Mar 2017 07:10:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43412) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cnkLA-0004kM-NA for qemu-devel@nongnu.org; Tue, 14 Mar 2017 07:10:08 -0400 References: <20170314100838.12647-1-roman.penyaev@profitbricks.com> <20170314100838.12647-2-roman.penyaev@profitbricks.com> From: Paolo Bonzini Message-ID: Date: Tue, 14 Mar 2017 12:10:06 +0100 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/1] scripts/qemugdb/coroutine.py: get pthread pointer from '(gdb) thread info $id' output List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Roman Penyaev Cc: Stefan Hajnoczi , qemu-devel 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