avocado app: Remove options --gdb-path and --gdbserver-path from 'avocado run'

Those are not necessary in the avocado options and can
safely stay as a config file only option.
Signed-off-by: NLucas Meneghel Rodrigues <lmr@redhat.com>
上级 167d8f3c
......@@ -17,6 +17,7 @@
from avocado import runtime
from avocado.utils import path as utils_path
from avocado.plugins import plugin
from avocado.settings import settings
class GDB(plugin.Plugin):
......@@ -52,21 +53,6 @@ class GDB(plugin.Plugin):
' inferior process received a fatal signal '
'such as SIGSEGV or SIGABRT'))
system_gdb_path = utils_path.find_command('gdb', '/usr/bin/gdb')
gdb_grp.add_argument('--gdb-path',
default=system_gdb_path, metavar='PATH',
help=('Path to the GDB executable, should you '
'need to use a custom GDB version. Current: '
'"%(default)s"'))
system_gdbserver_path = utils_path.find_command('gdbserver',
'/usr/bin/gdbserver')
gdb_grp.add_argument('--gdbserver-path',
default=system_gdbserver_path, metavar='PATH',
help=('Path to the gdbserver executable, should you '
'need to use a custom version. Current: '
'"%(default)s"'))
self.configured = True
def activate(self, app_args):
......@@ -80,7 +66,13 @@ class GDB(plugin.Plugin):
else:
runtime.GDB_PRERUN_COMMANDS[''] = commands
runtime.GDB_ENABLE_CORE = True if app_args.gdb_coredump == 'on' else False
runtime.GDB_PATH = app_args.gdb_path
runtime.GDBSERVER_PATH = app_args.gdbserver_path
system_gdb_path = utils_path.find_command('gdb', '/usr/bin/gdb')
runtime.GDB_PATH = settings.get_value('gdb.paths', 'gdb',
default=system_gdb_path)
system_gdbserver_path = utils_path.find_command('gdbserver',
'/usr/bin/gdbserver')
runtime.GDBSERVER_PATH = settings.get_value('gdb.paths',
'gdbserver',
default=system_gdbserver_path)
except AttributeError:
pass
[gdb.paths]
gdb = /usr/bin/gdb
gdbserver = /usr/bin/gdbserver
......@@ -348,13 +348,14 @@ when you disconnect from and exit gdb.
If, for some reason you have a custom GDB, or your system does not put
GDB on what avocado believes to be the standard location (`/usr/bin/gdb`),
you can override that with::
you can override that in the section `gdb.paths` of your documentation::
$ avocado run --gdb-path=~/code/gdb/gdb --gdb-run-bin=foo:main footest
[gdb.paths]
gdb = /usr/bin/gdb
gdbserver = /usr/bin/gdbserver
The same applies to `gdbserver`, which can be chosen with a command line like::
$ avocado run --gdbserver-path=~/code/gdb/gdbserver --gdb-run-bin=foo:main footest
So running avocado after setting those will use the appropriate gdb/gdbserver
path.
If you are debugging a special application and need to setup GDB in custom
ways by running GDB commands, you can do that with the `--gdb-prerun-commands`
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册