|
@@ -36,6 +36,8 @@ def get_args():
|
|
|
parser.add_argument("--gdb-args", help="Additional gdb arguments")
|
|
|
parser.add_argument("--output", help="A file to redirect output to")
|
|
|
parser.add_argument("--stderr", help="A file to redirect stderr to")
|
|
|
+ parser.add_argument("--no-suspend", action="store_true",
|
|
|
+ help="Ask the binary to not wait for GDB connection")
|
|
|
|
|
|
return parser.parse_args()
|
|
|
|
|
@@ -73,10 +75,19 @@ def log(output, msg):
|
|
|
|
|
|
# Launch QEMU with binary
|
|
|
if "system" in args.qemu:
|
|
|
+ if args.no_suspend:
|
|
|
+ suspend = ''
|
|
|
+ else:
|
|
|
+ suspend = ' -S'
|
|
|
cmd = f'{args.qemu} {args.qargs} {args.binary}' \
|
|
|
- f' -S -gdb unix:path={socket_name},server=on'
|
|
|
+ f'{suspend} -gdb unix:path={socket_name},server=on'
|
|
|
else:
|
|
|
- cmd = f'{args.qemu} {args.qargs} -g {socket_name} {args.binary}'
|
|
|
+ if args.no_suspend:
|
|
|
+ suspend = ',suspend=n'
|
|
|
+ else:
|
|
|
+ suspend = ''
|
|
|
+ cmd = f'{args.qemu} {args.qargs} -g {socket_name}{suspend}' \
|
|
|
+ f' {args.binary}'
|
|
|
|
|
|
log(output, "QEMU CMD: %s" % (cmd))
|
|
|
inferior = subprocess.Popen(shlex.split(cmd))
|