[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 11:21:32 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 |
On 14/03/2017 11:08, Roman Pen wrote:
> For sure under corefile debugging it is not possible to invoke
> any syscalls, like arch_prctl(), so avoid doing that. That will
> simplify the script.
Is the issue that start_thread only works in the main thread stack (i.e.
not on coroutines)?
> + num = gdb.selected_thread().num
> + thr = gdb.execute('info thread %d' % num, to_string=True)
What versions of gdb support gdb.execute? Also, what happens if
localization is in effect?
Paolo
> + thr = thr.split('\n')[1]
> try:
> - return f.read_var("arg")
> - except ValueError:
> - return get_fs_base()
> + return re.search('Thread ([0-9a-zx]+)', thr).group(1)
> + except:
> + raise ValueError("Unable to find pthread address in 'info thread %d'
> output.\n"
> + "Probably version mismatch of libthread_db.so
> library?" %
> + num)