summaryrefslogtreecommitdiff
path: root/dbug
diff options
context:
space:
mode:
Diffstat (limited to 'dbug')
-rw-r--r--dbug/dbug.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/dbug/dbug.c b/dbug/dbug.c
index 8b3927d2427..eb7a0e9c4b6 100644
--- a/dbug/dbug.c
+++ b/dbug/dbug.c
@@ -349,6 +349,27 @@ static CODE_STATE *code_state(void)
return cs;
}
+void
+dbug_swap_code_state(void **code_state_store)
+{
+ CODE_STATE *cs, **cs_ptr;
+
+ if (!(cs_ptr= (CODE_STATE**) my_thread_var_dbug()))
+ return;
+ cs= *cs_ptr;
+ *cs_ptr= *code_state_store;
+ *code_state_store= cs;
+}
+
+void dbug_free_code_state(void **code_state_store)
+{
+ if (*code_state_store)
+ {
+ free(*code_state_store);
+ *code_state_store= NULL;
+ }
+}
+
/*
* Translate some calls among different systems.
*/