Skip to content
Snippets Groups Projects
Commit 66a2c50c authored by Nadav Har'El's avatar Nadav Har'El
Browse files

Added to gdb's "osv info threads" each thread's id before its address,

and also to the "osv thread ..." command, you can now use in addition
to the thread's address, also its id - e.g., "osv thread 44" will
go to the thread with id()==44.
parent 122fc52c
No related branches found
No related tags found
No related merge requests found
......@@ -248,6 +248,7 @@ class osv_info_threads(gdb.Command):
for t in state.thread_list:
with thread_context(t, state):
cpu = t['_cpu']
tid = t['_id']
fr = gdb.selected_frame()
sal = fr.find_sal()
status = str(t['_status']['_M_i']).replace('sched::thread::', '')
......@@ -257,8 +258,8 @@ class osv_info_threads(gdb.Command):
fname = '??'
if sal.symtab:
fname = sal.symtab.filename
gdb.write('0x%x cpu%s %-10s %s at %s:%s\n' %
(ulong(t.address),
gdb.write('%d (0x%x) cpu%s %-10s %s at %s:%s\n' %
(tid, ulong(t.address),
cpu['arch']['acpi_id'],
status,
function,
......@@ -279,6 +280,9 @@ class osv_thread(gdb.Command):
for t in state.thread_list:
if t.address.cast(ulong_type) == long(arg, 0):
thread = t
with thread_context(t, state):
if t['_id'] == long(arg, 0):
thread = t
if not thread:
print 'Not found'
return
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment