or frame.type() == gdb.DUMMY_FRAME
or frame.type() == gdb.SIGTRAMP_FRAME
):
-
return True
return False
import gdb
import gdb.frames
+
# GDB Commands.
class SetFilterPrefixCmd(gdb.Command):
"""Prefix command for 'set' frame-filter related operations."""
self._send_json(result)
events = self.delayed_events
self.delayed_events = []
- for (event, body) in events:
+ for event, body in events:
self.send_event(event, body)
# Got the terminate request. This is handled by the
# JSON-writing thread, so that we can ensure that all
flag_list = []
v = int(self.val)
any_found = False
- for (e_name, e_value) in self.enumerators:
+ for e_name, e_value in self.enumerators:
if v & e_value != 0:
flag_list.append(e_name)
v = v & ~e_value
import gdb
+
# Take a gdb.TargetConnection and return the connection number.
def conn_num(c):
return c.num
gdb.execute(do_test_command, False, True)
def execute_test(self):
-
line_size = 2
for _ in range(1, 12):
# Keep the total size of dcache unchanged, and increase the
from gdb.FrameDecorator import FrameDecorator
import copy
+
# A FrameDecorator that just returns gdb.Frame.pc () from 'function'.
# We want to ensure that GDB correctly handles this case.
class Function_Returns_Address(FrameDecorator):
# thrown.
name_error = RuntimeError
+
# A simple decorator that gives an error when computing the function.
class ErrorInName(FrameDecorator):
def __init__(self, frame):
# object sent to us in the new_inferior event.
inf = None
+
# Register the new_inferior event handler.
def new_inferior_handler(event):
global inf
# originating from this script.
filters = [tracemalloc.Filter(True, "*py-inferior-leak.py")]
+
# Add a new inferior, and return the number of the new inferior.
def add_inferior():
output = gdb.execute("add-inferior", False, True)
# Flag to make NoStringContainerPrinter throw an exception.
exception_flag = False
+
# Test a printer where to_string is None
class NoStringContainerPrinter(object):
def __init__(self, val):
class TestUnwinder(Unwinder):
-
count = 0
@classmethod
self.recurse_level = 0
def __call__(self, pending_frame):
-
if self.recurse_level > 0:
gdb.write("TestUnwinder: Recursion detected - returning early.\n")
return None
TestUnwinder.inc_count()
if TestUnwinder.test == "check_user_reg_pc":
-
pc = pending_frame.read_register("pc")
pc_as_int = int(pc.cast(gdb.lookup_type("int")))
# gdb.write("In unwinder: pc=%x\n" % pc_as_int)
elif TestUnwinder.test == "check_pae_pc":
-
pc = gdb.parse_and_eval("$pc")
pc_as_int = int(pc.cast(gdb.lookup_type("int")))
# gdb.write("In unwinder: pc=%x\n" % pc_as_int)
elif TestUnwinder.test == "check_undefined_symbol":
-
try:
val = gdb.parse_and_eval("undefined_symbol")
import xml.etree.ElementTree as ET
import gdb
+
# Make use of gdb.RemoteTargetConnection.send_packet to fetch the
# thread list from the remote target.
#
gdb.register_window_type("test", TestWindow)
+
# Call REMOVE_TITLE on the global window object.
def delete_window_title():
the_window.remove_title()