diff --git a/src/libfibre/libfibre.so-gdb.py b/src/libfibre/libfibre.so-gdb.py index 68f7e12e69722a50d5e5027142d03145025248c8..2f42dce203e3fa52857572c5d83e8895c602c6c8 100644 --- a/src/libfibre/libfibre.so-gdb.py +++ b/src/libfibre/libfibre.so-gdb.py @@ -19,6 +19,7 @@ class FibreSupport(): FibreSupport.rsp = str(gdb.parse_and_eval("$rsp")).split(None, 1)[0] FibreSupport.rbp = str(gdb.parse_and_eval("$rbp")).split(None, 1)[0] FibreSupport.rip = str(gdb.parse_and_eval("$rip")).split(None, 1)[0] + FibreSupport.currStack = str(gdb.parse_and_eval("Context::currStack")) FibreSupport.saved = True # traverse runtime stack list to build internal list of fibres _globalStackList = gdb.parse_and_eval("_globalStackList") @@ -53,6 +54,7 @@ class FibreSupport(): gdb.execute("set $rsp = " + str(FibreSupport.rsp)) gdb.execute("set $rbp = " + str(FibreSupport.rbp)) gdb.execute("set $rip = " + str(FibreSupport.rip)) + gdb.execute("set Context::currStack = " + str(FibreSupport.currStack)) FibreSupport.saved = False def prep_frame(): @@ -94,6 +96,8 @@ class FibreSupport(): gdb.execute("set $rsp = " + str(rsp)) gdb.execute("set $rbp = " + str(rbp)) gdb.execute("set $rip = " + str(rip)) + # set Context::currStack to point to the correct stack + gdb.execute("set Context::currStack = " + argstr) return True def backtrace(arg): @@ -120,6 +124,7 @@ class FibreSupport(): tmprsp = str(gdb.parse_and_eval("$rsp")).split(None, 1)[0] tmprbp = str(gdb.parse_and_eval("$rbp")).split(None, 1)[0] tmprip = str(gdb.parse_and_eval("$rip")).split(None, 1)[0] + tmpcurrStack = str(gdb.parse_and_eval("Context::currStack")) result = None try: # execute backtrace, if possible @@ -134,6 +139,7 @@ class FibreSupport(): gdb.execute("set $rbp = " + str(tmprbp)) gdb.execute("set $rip = " + str(tmprip)) # restore stack frame + tmpcurrStack = gdb.execute("set Context::currStack = " + tmpcurrStack) currframe.select() return result