1
2 import vtrace
3 import vdb.extensions.windows as vdb_windows
4
6 '''
7 Display information about the currently stopped ethread.
8
9 Usage: ethread
10 #FIXME support listing them
11 #FIXME support ethread interp arbitrary address
12 '''
13 t = db.getTrace()
14 t.requireNotRunning()
15 fsbase = t.getVariable('fsbase')
16 kpcr = t.getStruct('nt.KPCR', fsbase)
17 ethraddr = kpcr.PrcbData.CurrentThread
18 ethr = t.getStruct('nt.ETHREAD', ethraddr)
19 db.vprint(ethr.tree(va=ethraddr))
20
22 '''
23 Display information about the currently stopped eprocess.
24
25 Usage: eprocess
26 #FIXME support listing
27 #FIXME support eprocess interp address
28 '''
29 t = db.getTrace()
30 t.requireNotRunning()
31 fsbase = t.getVariable('fsbase')
32 kpcr = t.getStruct('nt.KPCR', fsbase)
33 ethraddr = kpcr.PrcbData.CurrentThread
34 ethr = t.getStruct('nt.ETHREAD', ethraddr)
35 eprocaddr = ethr.Tcb.ApcState.Process
36 eproc = t.getStruct('nt.EPROCESS', eprocaddr)
37 db.vprint(eproc.tree(va=eprocaddr))
38
50
51
52
54 '''
55 Show / set the 'mode' of the arm core between arm and thumb.
56
57 Usage: armcore [arm|thumb]
58 '''
59 t = db.getTrace()
60 t.requireNotRunning()
61
62 if line:
63 if line not in ('arm','thumb'):
64 return db.do_help('armcore')
65 cmdstr = t._monitorCommand('arm core_state %s' % line)
66 else:
67 cmdstr = t._monitorCommand('arm core_state')
68
69 mode = cmdstr.split(':')[1].strip()
70 db.vprint('Arm Core Mode: %s' % mode)
71
73
77
78 - def notify(self, event, trace):
104
105
107 '''
108 Issue a gdb "monitor" command which allows access to the extensions
109 inside the gdb stub.
110
111 Example: gdbmon r fs
112
113 (try: "gdbmon help" for info on supported commands in the target stub)
114 '''
115 if len(line) == 0:
116 return db.do_help('gdbmon')
117 t = db.getTrace()
118
119 resp = t._monitorCommand(line)
120 db.vprint('gdb> %s' % line)
121 db.vprint(resp)
122
127