From d7abe1019dbff66b6abfb32df90d0c13328710ee Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Fri, 15 Apr 2016 21:14:07 +0100 Subject: [PATCH] Fix gdb C++ build when libipt is available MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit With libipt's headers installed, a build with --enable-build-with-cxx fails with: .../src/gdb/btrace.c: In function ‘btrace_insn_flag pt_btrace_insn_flags(const pt_insn*)’: .../src/gdb/btrace.c:734:33: error: invalid conversion from ‘int’ to ‘btrace_insn_flag’ [-fpermissive] enum btrace_insn_flag flags = 0; ^ .../src/gdb/btrace.c:737:11: error: invalid conversion from ‘int’ to ‘btrace_insn_flag’ [-fpermissive] flags |= BTRACE_INSN_FLAG_SPECULATIVE; ^ gdb/ChangeLog: 2016-04-15 Pedro Alves * btrace.c (pt_btrace_insn_flags): Change return type to btrace_insn_flags. Use btrace_insn_flags for local. --- gdb/ChangeLog | 5 +++++ gdb/btrace.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index d628bc10725..f879b8ad346 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2016-04-15 Pedro Alves + + * btrace.c (pt_btrace_insn_flags): Change return type to + btrace_insn_flags. Use btrace_insn_flags for local. + 2016-04-15 Pedro Alves * nat/linux-ptrace.h [__mips__] (GDB_ARCH_IS_TRAP_BRKPT): Also diff --git a/gdb/btrace.c b/gdb/btrace.c index 7c4da093b2f..f2cb7504e47 100644 --- a/gdb/btrace.c +++ b/gdb/btrace.c @@ -728,10 +728,10 @@ pt_reclassify_insn (enum pt_insn_class iclass) /* Return the btrace instruction flags for INSN. */ -static enum btrace_insn_flag +static btrace_insn_flags pt_btrace_insn_flags (const struct pt_insn *insn) { - enum btrace_insn_flag flags = 0; + btrace_insn_flags flags = 0; if (insn->speculative) flags |= BTRACE_INSN_FLAG_SPECULATIVE; -- 2.30.2