File tree 1 file changed +27
-0
lines changed
1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 13
13
stack_record_type = utils .CachedType ('struct stack_record' )
14
14
DEPOT_STACK_ALIGN = 4
15
15
16
+ def help ():
17
+ t = """Usage: lx-stack_depot_lookup [Hex handle value]
18
+ Example:
19
+ lx-stack_depot_lookup 0x00c80300\n """
20
+ gdb .write ("Unrecognized command\n " )
21
+ raise gdb .GdbError (t )
22
+
16
23
def stack_depot_fetch (handle ):
17
24
global DEPOT_STACK_ALIGN
18
25
global stack_record_type
@@ -57,3 +64,23 @@ def stack_depot_print(handle):
57
64
gdb .execute ("x /i 0x%x" % (int (entries [i ])))
58
65
except Exception as e :
59
66
gdb .write ("%s\n " % e )
67
+
68
+ class StackDepotLookup (gdb .Command ):
69
+ """Search backtrace by handle"""
70
+
71
+ def __init__ (self ):
72
+ if constants .LX_CONFIG_STACKDEPOT :
73
+ super (StackDepotLookup , self ).__init__ ("lx-stack_depot_lookup" , gdb .COMMAND_SUPPORT )
74
+
75
+ def invoke (self , args , from_tty ):
76
+ if not constants .LX_CONFIG_STACKDEPOT :
77
+ raise gdb .GdbError ('CONFIG_STACKDEPOT is not set' )
78
+
79
+ argv = gdb .string_to_argv (args )
80
+ if len (argv ) == 1 :
81
+ handle = int (argv [0 ], 16 )
82
+ stack_depot_print (gdb .Value (handle ).cast (utils .get_uint_type ()))
83
+ else :
84
+ help ()
85
+
86
+ StackDepotLookup ()
You can’t perform that action at this time.
0 commit comments