def METHOD_NAME(self, *args: str) -> str:
    """
    Run a GDB command (and wait for it to finish).
    **Example**:
    .. code-block:: python
        gdb.exec("break", "main")
        # Returns once the program hits a breakpoint
        gdb.exec("run")
        gdb.exec("backtrace")
    """
    cmd = self.escape(*args)
    with tbot.log_event.command(self.name, cmd) as ev:
        self.ch.sendline(cmd, read_back=True)
        with self.ch.with_stream(ev, show_prompt=False):
            out = self.ch.read_until_prompt()
            # Get rid of bracketed paste and similar escapes
            out = tbot_contrib.utils.strip_ansi_escapes(out)
        ev.data["stdout"] = out
    return out