From 80459895c4a89c4057cbfccba5c820f64e9dbe23 Mon Sep 17 00:00:00 2001 From: Paul Floyd Date: Sat, 9 Oct 2021 15:13:50 +0200 Subject: [PATCH] FreeBSD support, last loose ends One merge I missed and make a couple of changes to remove compiler warnings. --- coregrind/Makefile.am | 1 + coregrind/m_coredump/coredump-elf.c | 2 +- coregrind/m_mallocfree.c | 12 ++++++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/coregrind/Makefile.am b/coregrind/Makefile.am index 1de685bb45..76c0aebc9d 100644 --- a/coregrind/Makefile.am +++ b/coregrind/Makefile.am @@ -51,6 +51,7 @@ valgrind_SOURCES = \ endif if VGCONF_OS_IS_FREEBSD valgrind_SOURCES = \ + launcher-freebsd.c \ m_debuglog.c endif diff --git a/coregrind/m_coredump/coredump-elf.c b/coregrind/m_coredump/coredump-elf.c index d0e8a03c94..0d22d01cbb 100644 --- a/coregrind/m_coredump/coredump-elf.c +++ b/coregrind/m_coredump/coredump-elf.c @@ -490,7 +490,7 @@ static void fill_prstatus(const ThreadState *tst, regs[VKI_MIPS32_EF_CP0_EPC] = arch->vex.guest_PC; # undef DO #elif defined(VGP_amd64_freebsd) - regs->rflags = LibVEX_GuestAMD64_get_rflags( &((ThreadArchState*)arch)->vex ); + regs->rflags = LibVEX_GuestAMD64_get_rflags( &arch->vex ); regs->rsp = arch->vex.guest_RSP; regs->rip = arch->vex.guest_RIP; regs->rbx = arch->vex.guest_RBX; diff --git a/coregrind/m_mallocfree.c b/coregrind/m_mallocfree.c index 4bc24f91e5..90c7d9aac9 100644 --- a/coregrind/m_mallocfree.c +++ b/coregrind/m_mallocfree.c @@ -1011,6 +1011,14 @@ Superblock* maybe_findSb ( Arena* a, Addr ad ) /*--- Functions for working with freelists. ---*/ /*------------------------------------------------------------*/ +#if defined(__clang__) +/* The nicely aligned 'returns' in the function below produce + * misleading indentation warnings. Rather than turn the + * warning off globally, just turn it off for the block of code. */ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wmisleading-indentation" +#endif + // Nb: Determination of which freelist a block lives on is based on the // payload size, not block size. @@ -1120,6 +1128,10 @@ UInt pszB_to_listNo_SLOW ( SizeT pszB__divided_by__VG_MIN_MALLOC_SZB ) vg_assert(0); } +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + static inline UInt pszB_to_listNo ( SizeT pszB ) { -- 2.47.2