aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2010-09-19 10:33:57 -0400
committerSteven Rostedt <rostedt@goodmis.org>2010-09-23 18:28:25 -0400
commit84d78973993710e0964aa801d5dcf1b5c4690216 (patch)
tree410a804a6937b18162f8870c817c223ba77159ef /Makefile
parentaf41ffe13947069a95dad4738da0159ebd0fe84c (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--Makefile11
1 files changed, 10 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 5282f94..fe34d1c 100644
--- a/Makefile
+++ b/Makefile
@@ -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
75endif 75endif
76 76
77# $(call test-build, snippet, ret) -> ret if snippet compiles
78# -> empty otherwise
79test-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?
83udis86-flags := $(call test-build,\#include <udis86.h>,-DHAVE_UDIS86 -ludis86)
84
77ifeq ("$(origin O)", "command line") 85ifeq ("$(origin O)", "command line")
78 BUILD_OUTPUT := $(O) 86 BUILD_OUTPUT := $(O)
79endif 87endif
@@ -188,6 +196,7 @@ CFLAGS ?= -g -Wall
188 196
189# Append required CFLAGS 197# Append required CFLAGS
190override CFLAGS += $(CONFIG_FLAGS) $(INCLUDES) $(PLUGIN_DIR_SQ) 198override CFLAGS += $(CONFIG_FLAGS) $(INCLUDES) $(PLUGIN_DIR_SQ)
199override CFLAGS += $(udis86-flags)
191 200
192ifeq ($(VERBOSE),1) 201ifeq ($(VERBOSE),1)
193 Q = 202 Q =
@@ -228,7 +237,7 @@ do_compile_plugin_obj = \
228 237
229do_plugin_build = \ 238do_plugin_build = \
230 ($(print_plugin_build) \ 239 ($(print_plugin_build) \
231 $(CC) -shared -nostartfiles -o $@ $<) 240 $(CC) $(CFLAGS) -shared -nostartfiles -o $@ $<)
232 241
233do_build_static_lib = \ 242do_build_static_lib = \
234 ($(print_static_lib_build) \ 243 ($(print_static_lib_build) \