linux-user: support -plugin option
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> [ cota: s/instrument/plugin ] Signed-off-by: Emilio G. Cota <cota@braap.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
This commit is contained in:
parent
42229a7539
commit
f308f64e76
@ -34,6 +34,7 @@
|
|||||||
#include "qemu/error-report.h"
|
#include "qemu/error-report.h"
|
||||||
#include "qemu/help_option.h"
|
#include "qemu/help_option.h"
|
||||||
#include "qemu/module.h"
|
#include "qemu/module.h"
|
||||||
|
#include "qemu/plugin.h"
|
||||||
#include "cpu.h"
|
#include "cpu.h"
|
||||||
#include "exec/exec-all.h"
|
#include "exec/exec-all.h"
|
||||||
#include "tcg.h"
|
#include "tcg.h"
|
||||||
@ -398,6 +399,15 @@ static void handle_arg_abi_call0(const char *arg)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static QemuPluginList plugins = QTAILQ_HEAD_INITIALIZER(plugins);
|
||||||
|
|
||||||
|
#ifdef CONFIG_PLUGIN
|
||||||
|
static void handle_arg_plugin(const char *arg)
|
||||||
|
{
|
||||||
|
qemu_plugin_opt_parse(arg, &plugins);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
struct qemu_argument {
|
struct qemu_argument {
|
||||||
const char *argv;
|
const char *argv;
|
||||||
const char *env;
|
const char *env;
|
||||||
@ -449,6 +459,10 @@ static const struct qemu_argument arg_table[] = {
|
|||||||
"", "Seed for pseudo-random number generator"},
|
"", "Seed for pseudo-random number generator"},
|
||||||
{"trace", "QEMU_TRACE", true, handle_arg_trace,
|
{"trace", "QEMU_TRACE", true, handle_arg_trace,
|
||||||
"", "[[enable=]<pattern>][,events=<file>][,file=<file>]"},
|
"", "[[enable=]<pattern>][,events=<file>][,file=<file>]"},
|
||||||
|
#ifdef CONFIG_PLUGIN
|
||||||
|
{"plugin", "QEMU_PLUGIN", true, handle_arg_plugin,
|
||||||
|
"", "[file=]<file>[,arg=<string>]"},
|
||||||
|
#endif
|
||||||
{"version", "QEMU_VERSION", false, handle_arg_version,
|
{"version", "QEMU_VERSION", false, handle_arg_version,
|
||||||
"", "display version information and exit"},
|
"", "display version information and exit"},
|
||||||
#if defined(TARGET_XTENSA)
|
#if defined(TARGET_XTENSA)
|
||||||
@ -643,6 +657,7 @@ int main(int argc, char **argv, char **envp)
|
|||||||
cpu_model = NULL;
|
cpu_model = NULL;
|
||||||
|
|
||||||
qemu_add_opts(&qemu_trace_opts);
|
qemu_add_opts(&qemu_trace_opts);
|
||||||
|
qemu_plugin_add_opts();
|
||||||
|
|
||||||
optind = parse_args(argc, argv);
|
optind = parse_args(argc, argv);
|
||||||
|
|
||||||
@ -650,6 +665,9 @@ int main(int argc, char **argv, char **envp)
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
trace_init_file(trace_file);
|
trace_init_file(trace_file);
|
||||||
|
if (qemu_plugin_load_list(&plugins)) {
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
/* Zero out regs */
|
/* Zero out regs */
|
||||||
memset(regs, 0, sizeof(struct target_pt_regs));
|
memset(regs, 0, sizeof(struct target_pt_regs));
|
||||||
|
Loading…
Reference in New Issue
Block a user