Skip to content

Commit

Permalink
dbgutil: log out qemu arguments when spawning
Browse files Browse the repository at this point in the history
  • Loading branch information
Qix- committed Jul 30, 2024
1 parent b99bf3d commit 5a24686
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
9 changes: 9 additions & 0 deletions dbgutil/oro_debug_suite/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,12 @@ def error(*args, **kwargs):
# TODO(qix-): This adds a space between the last arg and the color reset message;
# TODO(qix-): it really shouldn't. Just a minor nitpick.
print("\x1b[38;5;129moro\x1b[38;5;160m", *args, "\x1b[m", **kwargs)


def debug(*args, **kwargs):
"""
Oro-branded debug function.
"""
# TODO(qix-): This adds a space between the last arg and the color reset message;
# TODO(qix-): it really shouldn't. Just a minor nitpick.
print("\x1b[38;5;129moro\x1b[2m", *args, "\x1b[m", **kwargs)
5 changes: 4 additions & 1 deletion dbgutil/oro_debug_suite/qemu.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
import shutil
import gdb # type: ignore
import threading
from qemu.qmp import QMPClient, Runstate # type:ignore
from qemu.qmp import QMPClient, Runstate # type: ignore
import asyncio
import os
from os import path
from queue import SimpleQueue
import time
import signal
import errno
from .log import debug


class QmpThread(threading.Thread):
Expand Down Expand Up @@ -121,6 +122,8 @@ def __init__(self, args, **kwargs):
"-S",
]

debug("spawning QEMU with args:", repr(args))

self.__process = subprocess.Popen(
args,
**kwargs,
Expand Down

0 comments on commit 5a24686

Please sign in to comment.