CliFunction

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-01-22 00:00:00 +00:00
parent 3b0a343647
commit a5ec63dc28
39 changed files with 2630 additions and 2399 deletions

View File

@@ -5,9 +5,9 @@ import os
import sys
import common
rungdb = imp.load_source('rungdb', os.path.join(common.root_dir, 'run-gdb'))
rungdb = imp.load_source('rungdb', os.path.join(kwargs['root_dir'], 'run-gdb'))
parser = common.get_argparse(argparse_args={
parser = self.get_argparse(argparse_args={
'description': '''GDB step debug guest userland processes without gdbserver.
More information at: https://github.com/cirosantilli/linux-kernel-module-cheat#gdb-step-debug-userland-processes
@@ -23,9 +23,9 @@ parser.add_argument(
help='Break at this point, e.g. main.',
nargs='?'
)
args = common.setup(parser)
executable = common.resolve_userland(args.executable)
addr = common.get_elf_entry(os.path.join(common.buildroot_build_build_dir, executable))
args = self.setup(parser)
executable = self.resolve_userland(kwargs['executable'])
addr = self.get_elf_entry(os.path.join(kwargs['buildroot_build_build_dir'], executable))
extra_args = {}
extra_args['before'] = '-ex \"add-symbol-file {} {}\"'.format(executable, hex(addr))
# Or else lx-symbols throws for arm:
@@ -33,5 +33,5 @@ extra_args['before'] = '-ex \"add-symbol-file {} {}\"'.format(executable, hex(ad
# TODO understand better.
# Also, lx-symbols overrides the add-symbol-file commands.
extra_args['no_lxsymbols'] = True
extra_args['break_at'] = args.break_at
extra_args['break_at'] = kwargs['break_at']
sys.exit(rungdb.main(args, extra_args))