diff options
| author | Avi Kivity <avi@redhat.com> | 2010-09-19 10:33:57 -0400 |
|---|---|---|
| committer | Steven Rostedt <rostedt@goodmis.org> | 2010-09-23 18:28:25 -0400 |
| commit | 84d78973993710e0964aa801d5dcf1b5c4690216 (patch) | |
| tree | 410a804a6937b18162f8870c817c223ba77159ef /Makefile | |
| parent | af41ffe13947069a95dad4738da0159ebd0fe84c (diff) | |
plugin_kvm: Disassemble instructions for kvm_emulate_insn
Override kvm_emulate_insn formatting to use a disassembler to format
the emulated instruction. If a disassembler (udis86) is not available,
fall back to showing the instruction bytes in hex.
Signed-off-by: Avi Kivity <avi@redhat.com>
LKML-Reference: <1284906837-2431-1-git-send-email-avi@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 11 |
1 files changed, 10 insertions, 1 deletions
| @@ -74,6 +74,14 @@ ifeq ($(shell sh -c "python-config --includes > /dev/null 2>&1 && echo y"), y) | |||
| 74 | PYTHON_PY_INSTALL := event-viewer.install tracecmd.install tracecmdgui.install | 74 | PYTHON_PY_INSTALL := event-viewer.install tracecmd.install tracecmdgui.install |
| 75 | endif | 75 | endif |
| 76 | 76 | ||
| 77 | # $(call test-build, snippet, ret) -> ret if snippet compiles | ||
| 78 | # -> empty otherwise | ||
| 79 | test-build = $(if $(shell $(CC) -o /dev/null -c -x c - > /dev/null 2>&1 \ | ||
| 80 | <<<'$1' && echo y), $2) | ||
| 81 | |||
| 82 | # have udis86 disassembler library? | ||
| 83 | udis86-flags := $(call test-build,\#include <udis86.h>,-DHAVE_UDIS86 -ludis86) | ||
| 84 | |||
| 77 | ifeq ("$(origin O)", "command line") | 85 | ifeq ("$(origin O)", "command line") |
| 78 | BUILD_OUTPUT := $(O) | 86 | BUILD_OUTPUT := $(O) |
| 79 | endif | 87 | endif |
| @@ -188,6 +196,7 @@ CFLAGS ?= -g -Wall | |||
| 188 | 196 | ||
| 189 | # Append required CFLAGS | 197 | # Append required CFLAGS |
| 190 | override CFLAGS += $(CONFIG_FLAGS) $(INCLUDES) $(PLUGIN_DIR_SQ) | 198 | override CFLAGS += $(CONFIG_FLAGS) $(INCLUDES) $(PLUGIN_DIR_SQ) |
| 199 | override CFLAGS += $(udis86-flags) | ||
| 191 | 200 | ||
| 192 | ifeq ($(VERBOSE),1) | 201 | ifeq ($(VERBOSE),1) |
| 193 | Q = | 202 | Q = |
| @@ -228,7 +237,7 @@ do_compile_plugin_obj = \ | |||
| 228 | 237 | ||
| 229 | do_plugin_build = \ | 238 | do_plugin_build = \ |
| 230 | ($(print_plugin_build) \ | 239 | ($(print_plugin_build) \ |
| 231 | $(CC) -shared -nostartfiles -o $@ $<) | 240 | $(CC) $(CFLAGS) -shared -nostartfiles -o $@ $<) |
| 232 | 241 | ||
| 233 | do_build_static_lib = \ | 242 | do_build_static_lib = \ |
| 234 | ($(print_static_lib_build) \ | 243 | ($(print_static_lib_build) \ |
