Skip to content
Snippets Groups Projects
Commit 1e2fa62a authored by Mohammed Bilal Akhtar's avatar Mohammed Bilal Akhtar
Browse files

Set Context::currStack when changing fibres in gdb debugging

parent a8f508b1
No related branches found
No related tags found
1 merge request!5Set Context::currStack when changing fibres in gdb debugging
...@@ -18,6 +18,7 @@ class FibreSupport(): ...@@ -18,6 +18,7 @@ class FibreSupport():
FibreSupport.rsp = str(gdb.parse_and_eval("$rsp")).split(None, 1)[0] 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.rbp = str(gdb.parse_and_eval("$rbp")).split(None, 1)[0]
FibreSupport.rip = str(gdb.parse_and_eval("$rip")).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 FibreSupport.saved = True
# traverse runtime stack list to build internal list of fibres # traverse runtime stack list to build internal list of fibres
_globalStackList = gdb.parse_and_eval("_globalStackList") _globalStackList = gdb.parse_and_eval("_globalStackList")
...@@ -52,6 +53,7 @@ class FibreSupport(): ...@@ -52,6 +53,7 @@ class FibreSupport():
gdb.execute("set $rsp = " + str(FibreSupport.rsp)) gdb.execute("set $rsp = " + str(FibreSupport.rsp))
gdb.execute("set $rbp = " + str(FibreSupport.rbp)) gdb.execute("set $rbp = " + str(FibreSupport.rbp))
gdb.execute("set $rip = " + str(FibreSupport.rip)) gdb.execute("set $rip = " + str(FibreSupport.rip))
gdb.execute("set Context::currStack = " + str(FibreSupport.currStack))
FibreSupport.saved = False FibreSupport.saved = False
def prep_frame(): def prep_frame():
...@@ -93,6 +95,8 @@ class FibreSupport(): ...@@ -93,6 +95,8 @@ class FibreSupport():
gdb.execute("set $rsp = " + str(rsp)) gdb.execute("set $rsp = " + str(rsp))
gdb.execute("set $rbp = " + str(rbp)) gdb.execute("set $rbp = " + str(rbp))
gdb.execute("set $rip = " + str(rip)) gdb.execute("set $rip = " + str(rip))
# set Context::currStack to point to the correct stack
gdb.execute("set Context::currStack = " + argstr)
return True return True
def backtrace(arg): def backtrace(arg):
...@@ -119,6 +123,7 @@ class FibreSupport(): ...@@ -119,6 +123,7 @@ class FibreSupport():
tmprsp = str(gdb.parse_and_eval("$rsp")).split(None, 1)[0] tmprsp = str(gdb.parse_and_eval("$rsp")).split(None, 1)[0]
tmprbp = str(gdb.parse_and_eval("$rbp")).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] tmprip = str(gdb.parse_and_eval("$rip")).split(None, 1)[0]
tmpcurrStack = str(gdb.parse_and_eval("Context::currStack"))
result = None result = None
try: try:
# execute backtrace, if possible # execute backtrace, if possible
...@@ -133,6 +138,7 @@ class FibreSupport(): ...@@ -133,6 +138,7 @@ class FibreSupport():
gdb.execute("set $rbp = " + str(tmprbp)) gdb.execute("set $rbp = " + str(tmprbp))
gdb.execute("set $rip = " + str(tmprip)) gdb.execute("set $rip = " + str(tmprip))
# restore stack frame # restore stack frame
tmpcurrStack = gdb.execute("set Context::currStack = " + tmpcurrStack)
currframe.select() currframe.select()
return result return result
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment