From patchwork Fri Apr 7 00:32:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pip Cet X-Patchwork-Id: 19886 Received: (qmail 31804 invoked by alias); 7 Apr 2017 00:33:30 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 31792 invoked by uid 89); 7 Apr 2017 00:33:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.3 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-wr0-f195.google.com Received: from mail-wr0-f195.google.com (HELO mail-wr0-f195.google.com) (209.85.128.195) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 07 Apr 2017 00:33:27 +0000 Received: by mail-wr0-f195.google.com with SMTP id u18so7639250wrc.1 for ; Thu, 06 Apr 2017 17:33:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=mXpDQZRWTPHhFLN9Y3E4RDHor+SmOaOT9n+IBQoqvrE=; b=rk5ehqGAYUQ9Uk1O4vhec3C/ydKVb0Qmt10kknVuvLfk7stBfjlGpyYCPBZmV6YYpb D0e1f6B18pRMuJHJvnI9z+k/F7KTl4BMR3QU6pmgSJTlntABm7cTMOXpfWXQ33dgQkH1 srP94FH0BajIZ3YCMlnWqnmBFWfexrpj9ZHqjeILtRR99uqkqbOG0NCxkW023gUicfyu qk2uniREeBWq1e8dOkbCAw94F0RoNqnYmKHAco6E0pj3vRSrtynZW8sO1BlZpYZHOraF +zPkmOF76I+dtKHncI5nfMIjum7rjgZj89r7zABUazQeUI+ccXld4zOgT63GVQwah89A zd/Q== X-Gm-Message-State: AFeK/H0H53uxtnjHX1RZTvzoD3l4sM5VnzxW36xJO5+4K5wDiXj53omscPmgVrazZggqiOShZA3KqTQo1JNbWQ== X-Received: by 10.28.166.208 with SMTP id p199mr26079603wme.25.1491525206636; Thu, 06 Apr 2017 17:33:26 -0700 (PDT) MIME-Version: 1.0 Received: by 10.80.195.15 with HTTP; Thu, 6 Apr 2017 17:32:45 -0700 (PDT) In-Reply-To: References: From: Pip Cet Date: Fri, 7 Apr 2017 00:32:45 +0000 Message-ID: Subject: Re: Oh dear. I regret to inform you that commit 'Add support for disassembling WebAssembly opcodes.' might be unfortunate To: gdb-patches@sourceware.org Sorry about that. I'm attaching a patch to fix this build issue. Suggested change log entry: 2017-04-06 Pip Cet * wasm32-dis.c (print_insn_wasm32): Use a fixed value (valid for IEEE 754 doubles) instead of DECIMAL_DIG. On Fri, Apr 7, 2017 at 12:25 AM, wrote: > My lords, ladies, gentlemen, members of the public. > > It is a matter of great regret and sadness to inform you that commit: > > Add support for disassembling WebAssembly opcodes. > 62ecb94c4a2929c1aace3fb5470d2a5100255811 > > might have made GDB unwell. Since I am just your Butler BuildBot, > I kindly ask that a human superior officer double-check this. > > Please note that if you are reading this message on gdb-patches, there might > be other builders broken. > > You can find more details about the unfortunate breakage below. > > Cheers, > > Your GDB BuildBot. > > +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ > > > Buildslave: > ubuntu-trusty-aarch32-1 > > Full Build URL: > > > Commit(s) tested: > 62ecb94c4a2929c1aace3fb5470d2a5100255811 > > Author(s) (in the same order as the commits): > Pip Cet > > Subject: > Add support for disassembling WebAssembly opcodes. > > Testsuite log (gdb.sum and gdb.log) URL(s): > > > *** Failed to compiled GDB. *** > ============================ > > +++ The full log is too big to be posted here. > +++ These are the last 100 lines of it. > > checking netinet/in.h presence... yes > checking for netinet/in.h... yes > checking for sys/socket.h... (cached) yes > checking netdb.h usability... yes > checking netdb.h presence... yes > checking for netdb.h... yes > checking netinet/tcp.h usability... yes > checking netinet/tcp.h presence... yes > checking for netinet/tcp.h... yes > checking arpa/inet.h usability... yes > checking arpa/inet.h presence... yes > checking for arpa/inet.h... yes > checking for pid_t... (cached) yes > checking for vfork.h... (cached) no > checking for fork... (cached) yes > checking for vfork... (cached) yes > checking for working fork... (cached) yes > checking for working vfork... (cached) yes > checking for getauxval... (cached) yes > checking for pread... (cached) yes > checking for pwrite... (cached) yes > checking for pread64... (cached) yes > checking for setns... (cached) yes > checking for ANSI C header files... (cached) yes > checking for working alloca.h... (cached) yes > checking for alloca... (cached) yes > checking for nl_langinfo and CODESET... (cached) yes > checking for linux/perf_event.h... (cached) yes > checking for locale.h... (cached) yes > checking for memory.h... (cached) yes > checking for signal.h... (cached) yes > checking for sys/resource.h... (cached) yes > checking for sys/socket.h... (cached) yes > checking for sys/syscall.h... (cached) yes > checking for sys/un.h... (cached) yes > checking for sys/wait.h... (cached) yes > checking for thread_db.h... (cached) yes > checking for wait.h... (cached) yes > checking for fdwalk... (cached) no > checking for getrlimit... (cached) yes > checking for pipe... (cached) yes > checking for pipe2... (cached) yes > checking for socketpair... (cached) yes > checking for sigaction... (cached) yes > checking whether strerror is declared... (cached) yes > checking whether strstr is declared... (cached) yes > checking for sigsetjmp... (cached) yes > checking for sys/ptrace.h... (cached) yes > checking for ptrace.h... (cached) no > checking whether ptrace is declared... (cached) yes > checking return type of ptrace... (cached) long > checking types of arguments for ptrace... (cached) enum __ptrace_request,int,long,long > checking for ust... no > checking compiler warning flags... -Wall -Wpointer-arith -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wempty-body -Wunused-but-set-parameter -Wunused-but-set-variable -Wno-sign-compare -Wno-narrowing -Wformat-nonliteral -Werror > checking for dladdr... yes > checking for long long... (cached) yes > checking size of long long... (cached) 8 > checking whether basename is declared... (cached) yes > checking whether ffs is declared... (cached) yes > checking whether asprintf is declared... (cached) yes > checking whether vasprintf is declared... (cached) yes > checking whether snprintf is declared... (cached) yes > checking whether vsnprintf is declared... (cached) yes > checking whether strtol is declared... (cached) yes > checking whether strtoul is declared... (cached) yes > checking whether strtoll is declared... (cached) yes > checking whether strtoull is declared... (cached) yes > checking whether strverscmp is declared... (cached) yes > checking whether strerror is declared... (cached) yes > checking whether perror is declared... yes > checking whether vasprintf is declared... (cached) yes > checking whether vsnprintf is declared... (cached) yes > checking for struct stat.st_blocks... (cached) yes > checking for struct stat.st_blksize... (cached) yes > checking for struct user_regs_struct.fs_base... (cached) no > checking for struct user_regs_struct.gs_base... (cached) no > checking for socklen_t... (cached) yes > checking for Elf32_auxv_t... yes > checking for Elf64_auxv_t... yes > checking for PTRACE_GETREGS... yes > checking for PTRACE_GETFPXREGS... yes > checking for lwpid_t in sys/procfs.h... (cached) yes > checking for psaddr_t in sys/procfs.h... (cached) yes > checking for prgregset_t in sys/procfs.h... (cached) yes > checking for prfpregset_t in sys/procfs.h... (cached) yes > checking for elf_fpregset_t in sys/procfs.h... yes > checking for dlopen in -ldl... yes > checking for the dynamic export flag... -Wl,--dynamic-list > checking for TD_VERSION... yes > checking whether the target supports __sync_*_compare_and_swap... yes > checking whether ADDR_NO_RANDOMIZE is declared... (cached) yes > configure: updating cache .././config.cache > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status: executing depdir commands > mkdir -p -- .deps > make[1]: Leaving directory `/home/qiyao/buildbot/ubuntu-aarch32-m32/build' > make: *** [all] Error 2 > ============================ > diff --git a/opcodes/wasm32-dis.c b/opcodes/wasm32-dis.c index 80e4ffe81a..f150163a80 100644 --- a/opcodes/wasm32-dis.c +++ b/opcodes/wasm32-dis.c @@ -23,13 +23,22 @@ #include "opintl.h" #include "safe-ctype.h" #include "floatformat.h" -#include #include "libiberty.h" #include "elf-bfd.h" #include "elf/internal.h" #include "elf/wasm32.h" #include +/* Number of decimal digits, n, such that any floating-point number in the + widest supported floating type with pmax radix b digits can be rounded + to a floating-point number with n decimal digits and back again without + change to the value, + + pmax * log10(b) if b is a power of 10 + ceil(1 + pmax * log10(b)) otherwise +*/ +#define DECIMAL_DIG_IEEE754 17 + /* Type names for blocks and signatures. */ #define BLOCK_TYPE_NONE 0x40 #define BLOCK_TYPE_I32 0x7f @@ -405,7 +414,7 @@ print_insn_wasm32 (bfd_vma pc, struct disassemble_info *info) if (ret < 0) return -1; len += ret; - prin (stream, " %.*g", DECIMAL_DIG, fconstant); + prin (stream, " %.*g", DECIMAL_DIG_IEEE754, fconstant); break; case wasm_constant_f64: @@ -413,7 +422,7 @@ print_insn_wasm32 (bfd_vma pc, struct disassemble_info *info) if (ret < 0) return -1; len += ret; - prin (stream, " %.*g", DECIMAL_DIG, fconstant); + prin (stream, " %.*g", DECIMAL_DIG_IEEE754, fconstant); break; case wasm_call: