diff --git a/gdb-port/parser-name-instrumentation-gdb.py b/gdb-port/parser-name-instrumentation-gdb.py
index 202217d958b98f7000e5e03572bfaaeee8e2fb6f..5660aa616b3cb13b5d0c33d1fc357aa090f404e0 100644
--- a/gdb-port/parser-name-instrumentation-gdb.py
+++ b/gdb-port/parser-name-instrumentation-gdb.py
@@ -310,7 +310,7 @@ class HammerParserBacktrace(gdb.Command):
 
 	def invoke(self, arg, from_tty):
 		parserstack = top_level_parse.peek_parserstack()
-		depth = min(len(parserstack), 10) # TODO: configurable max stack depth
+		depth = min(len(parserstack.p_stack), 10) # TODO: configurable max stack depth
 		if depth > 0: # if stack not empty
 			# unsure what the idiomatic python is for handling negative indices starting with -1,
 			# but this addition is to avoid off-by-one errors