summaryrefslogtreecommitdiff
path: root/scripts/gdb/linux/stackdepot.py
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2024-10-02 22:29:16 +0300
committerTakashi Iwai <tiwai@suse.de>2024-10-02 22:29:16 +0300
commit0c436dfe5c25d0931b164b944165259f95e5281f (patch)
tree7b1d3d8d7bc600f218af0ca6ed9a4f7527f88e5f /scripts/gdb/linux/stackdepot.py
parent3f7f36a4559ef78a6418c5f0447fbfbdcf671956 (diff)
parenteb1df4bbf53c29babf68fcb36e80d9c62a345257 (diff)
downloadlinux-0c436dfe5c25d0931b164b944165259f95e5281f.tar.xz
Merge tag 'asoc-fix-v6.12-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v6.12 A bunch of fixes here that came in during the merge window and the first week of release, plus some new quirks and device IDs. There's nothing major here, it's a bit bigger than it might've been due to there being no fixes sent during the merge window due to your vacation.
Diffstat (limited to 'scripts/gdb/linux/stackdepot.py')
-rw-r--r--scripts/gdb/linux/stackdepot.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/scripts/gdb/linux/stackdepot.py b/scripts/gdb/linux/stackdepot.py
index bb3a0f843931..37313a5a51a0 100644
--- a/scripts/gdb/linux/stackdepot.py
+++ b/scripts/gdb/linux/stackdepot.py
@@ -13,6 +13,13 @@ if constants.LX_CONFIG_STACKDEPOT:
stack_record_type = utils.CachedType('struct stack_record')
DEPOT_STACK_ALIGN = 4
+def help():
+ t = """Usage: lx-stack_depot_lookup [Hex handle value]
+ Example:
+ lx-stack_depot_lookup 0x00c80300\n"""
+ gdb.write("Unrecognized command\n")
+ raise gdb.GdbError(t)
+
def stack_depot_fetch(handle):
global DEPOT_STACK_ALIGN
global stack_record_type
@@ -57,3 +64,23 @@ def stack_depot_print(handle):
gdb.execute("x /i 0x%x" % (int(entries[i])))
except Exception as e:
gdb.write("%s\n" % e)
+
+class StackDepotLookup(gdb.Command):
+ """Search backtrace by handle"""
+
+ def __init__(self):
+ if constants.LX_CONFIG_STACKDEPOT:
+ super(StackDepotLookup, self).__init__("lx-stack_depot_lookup", gdb.COMMAND_SUPPORT)
+
+ def invoke(self, args, from_tty):
+ if not constants.LX_CONFIG_STACKDEPOT:
+ raise gdb.GdbError('CONFIG_STACKDEPOT is not set')
+
+ argv = gdb.string_to_argv(args)
+ if len(argv) == 1:
+ handle = int(argv[0], 16)
+ stack_depot_print(gdb.Value(handle).cast(utils.get_uint_type()))
+ else:
+ help()
+
+StackDepotLookup()