from .typecheck import type_check
+@in_gdb_thread
+def _bp_modified(event):
+ send_event(
+ "breakpoint",
+ {
+ "reason": "changed",
+ "breakpoint": _breakpoint_descriptor(event),
+ },
+ )
+
+
+@in_gdb_thread
+def _bp_created(event):
+ send_event(
+ "breakpoint",
+ {
+ "reason": "new",
+ "breakpoint": _breakpoint_descriptor(event),
+ },
+ )
+
+
+@in_gdb_thread
+def _bp_deleted(event):
+ send_event(
+ "breakpoint",
+ {
+ "reason": "removed",
+ "breakpoint": _breakpoint_descriptor(event),
+ },
+ )
+
+
+gdb.events.breakpoint_created.connect(_bp_created)
+gdb.events.breakpoint_modified.connect(_bp_modified)
+gdb.events.breakpoint_deleted.connect(_bp_deleted)
+
+
# Map from the breakpoint "kind" (like "function") to a second map, of
# breakpoints of that type. The second map uses the breakpoint spec
# as a key, and the gdb.Breakpoint itself as a value. This is used to
@in_gdb_thread
-def breakpoint_descriptor(bp):
+def _breakpoint_descriptor(bp):
"Return the Breakpoint object descriptor given a gdb Breakpoint."
result = {
"id": bp.number,
# Reaching this spot means success.
breakpoint_map[kind][keyspec] = bp
- result.append(breakpoint_descriptor(bp))
+ result.append(_breakpoint_descriptor(bp))
# Exceptions other than gdb.error are possible here.
except Exception as e:
log_stack()
from .server import send_event
from .startup import in_gdb_thread, Invoker, log
-from .breakpoint import breakpoint_descriptor
from .modules import is_module, make_module
)
-@in_gdb_thread
-def _bp_modified(event):
- send_event(
- "breakpoint",
- {
- "reason": "changed",
- "breakpoint": breakpoint_descriptor(event),
- },
- )
-
-
-@in_gdb_thread
-def _bp_created(event):
- send_event(
- "breakpoint",
- {
- "reason": "new",
- "breakpoint": breakpoint_descriptor(event),
- },
- )
-
-
@in_gdb_thread
def thread_event(event, reason):
send_event(
thread_event(event, "exited")
-@in_gdb_thread
-def _bp_deleted(event):
- send_event(
- "breakpoint",
- {
- "reason": "removed",
- "breakpoint": breakpoint_descriptor(event),
- },
- )
-
-
@in_gdb_thread
def _new_objfile(event):
if is_module(event.new_objfile):
gdb.events.stop.connect(_on_stop)
gdb.events.exited.connect(_on_exit)
-gdb.events.breakpoint_created.connect(_bp_created)
-gdb.events.breakpoint_modified.connect(_bp_modified)
-gdb.events.breakpoint_deleted.connect(_bp_deleted)
gdb.events.new_thread.connect(_new_thread)
gdb.events.thread_exited.connect(_thread_exited)
gdb.events.cont.connect(_cont)