Skip to content
Snippets Groups Projects
Commit f564e23a authored by Martin Karsten's avatar Martin Karsten
Browse files

Merge branch 'bugfix-stackcontext' into 'master'

Set Context::currStack when changing fibres in gdb debugging

See merge request !5
parents a88da570 1e2fa62a
No related branches found
No related tags found
1 merge request!5Set Context::currStack when changing fibres in gdb debugging
......@@ -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
......
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