r"""list all bthreads, print format is 'id\ttid\tfunction\thas stack
(debugger, command, result, internal_dict)
| 204 | |
| 205 | |
| 206 | def bthread_list(debugger, command, result, internal_dict): |
| 207 | r"""list all bthreads, print format is 'id\ttid\tfunction\thas stack'""" |
| 208 | if not global_state.started: |
| 209 | print("Not in bthread debug mode") |
| 210 | return |
| 211 | |
| 212 | print("id\t\ttid\t\tfunction\t\t\t\thas stack\t\t\ttotal:{}".format( |
| 213 | len(global_state.bthreads))) |
| 214 | for i, t in enumerate(global_state.bthreads): |
| 215 | tid = get_child(t, "tid").GetValueAsUnsigned() |
| 216 | fn = get_child(t, "fn") |
| 217 | has_stack = get_child(t, "stack").GetLocation() == "0x0" |
| 218 | print("#{}\t\t{}\t\t{}\t\t{}".format( |
| 219 | i, tid, fn, "no" if has_stack else "yes")) |
| 220 | |
| 221 | |
| 222 | def bthread_num(debugger, command, result, internal_dict): |