Files
linux-kernel-module-cheat/run-gdbserver
Ciro Santilli 六四事件 法轮功 9693c23fe6 gdb userland and gdbserver are perfect
2018-11-03 00:00:01 +00:00

29 lines
800 B
Python
Executable File

#!/usr/bin/env python3
import os
import subprocess
import sys
import common
parser = common.get_argparse(argparse_args={
'description':'Connect to gdbserver running on the guest.'
})
parser.add_argument(
'executable',
help='Path to the executable to be debugged relative to the Buildroot build directory.'
)
parser.add_argument(
'break_at', default='main', nargs='?'
)
args = common.setup(parser)
sys.exit(subprocess.Popen([
common.get_toolchain_tool('gdb'),
'-q',
'-ex', 'set sysroot {}'.format(common.buildroot_staging_dir),
'-ex', 'target remote localhost:{}'.format(common.qemu_hostfwd_generic_port),
'-ex', 'tbreak {}'.format(args.break_at),
'-ex', 'continue',
os.path.join(common.buildroot_build_build_dir, common.resolve_userland(args.executable)),
]).wait())