[1/2] gdb: move gdbpy_gil into python-internal.h
Checks
Context |
Check |
Description |
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_gdb_build--master-arm |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_gdb_check--master-arm |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 |
success
|
Testing passed
|
Commit Message
Move gdbpy_gil class into python-internal.h, the next
commit wants to make use of this class from a file other
than python.c.
---
gdb/python/python-internal.h | 24 ++++++++++++++++++++++++
gdb/python/python.c | 24 ------------------------
2 files changed, 24 insertions(+), 24 deletions(-)
Comments
>>>>> "Alexandra" == Alexandra Hájková <ahajkova@redhat.com> writes:
Alexandra> Move gdbpy_gil class into python-internal.h, the next
Alexandra> commit wants to make use of this class from a file other
Alexandra> than python.c.
Thank you.
Approved-By: Tom Tromey <tom@tromey.com>
Tom
@@ -772,6 +772,30 @@ class gdbpy_allow_threads
PyThreadState *m_save;
};
+/* A helper class to save and restore the GIL, but without touching
+ the other globals that are handled by gdbpy_enter. */
+
+class gdbpy_gil
+{
+public:
+
+ gdbpy_gil ()
+ : m_state (PyGILState_Ensure ())
+ {
+ }
+
+ ~gdbpy_gil ()
+ {
+ PyGILState_Release (m_state);
+ }
+
+ DISABLE_COPY_AND_ASSIGN (gdbpy_gil);
+
+private:
+
+ PyGILState_STATE m_state;
+};
+
/* Use this after a TRY_EXCEPT to throw the appropriate Python
exception. */
#define GDB_PY_HANDLE_EXCEPTION(Exception) \
@@ -264,30 +264,6 @@ gdbpy_enter::finalize ()
python_gdbarch = current_inferior ()->arch ();
}
-/* A helper class to save and restore the GIL, but without touching
- the other globals that are handled by gdbpy_enter. */
-
-class gdbpy_gil
-{
-public:
-
- gdbpy_gil ()
- : m_state (PyGILState_Ensure ())
- {
- }
-
- ~gdbpy_gil ()
- {
- PyGILState_Release (m_state);
- }
-
- DISABLE_COPY_AND_ASSIGN (gdbpy_gil);
-
-private:
-
- PyGILState_STATE m_state;
-};
-
/* Set the quit flag. */
static void