summaryrefslogtreecommitdiff
path: root/gdb-helpers
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2024-12-09 12:24:52 -0700
committerLuke T. Shumaker <lukeshu@lukeshu.com>2024-12-09 12:24:52 -0700
commit87646c7959726bc0556d28f78fb730edd8365410 (patch)
tree087f074391f4beccc08626f966d945d0cad60aba /gdb-helpers
parent96a751d8a5d20b2acea5ae8d10ac3d051466c2c3 (diff)
parentb1414723ab4171a7ca5fc5e8a5ac7c4eb43331e2 (diff)
Merge commit 'b1414723ab4171a7ca5fc5e8a5ac7c4eb43331e2'
Diffstat (limited to 'gdb-helpers')
-rw-r--r--gdb-helpers/libcr.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/gdb-helpers/libcr.py b/gdb-helpers/libcr.py
index c07b679..3ffafce 100644
--- a/gdb-helpers/libcr.py
+++ b/gdb-helpers/libcr.py
@@ -26,6 +26,14 @@ def gdb_unregister_unwinder(
gdb.invalidate_cached_frames()
+def gdb_is_on_os() -> bool:
+ try:
+ gdb.execute("info proc", to_string=True)
+ return True
+ except gdb.error:
+ return False
+
+
class gdb_JmpBuf:
"""Our own in-Python GDB-specific implementation of `jmp_buf`"""
@@ -105,7 +113,8 @@ class CrGlobals:
self._breakpoint.enabled = True
gdb.execute(f"call (void)cr_gdb_readjmp({env_ptr_expr})")
self._breakpoint.enabled = False
- gdb.execute("queue-signal SIGWINCH")
+ if gdb_is_on_os():
+ gdb.execute("queue-signal SIGWINCH")
return self._breakpoint.env
def _on_cont(self, event: gdb.Event) -> None: