From patchwork Wed May 27 10:21:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 6938 Received: (qmail 65942 invoked by alias); 27 May 2015 10:22:09 -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 65858 invoked by uid 89); 27 May 2015 10:22:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pd0-f175.google.com Received: from mail-pd0-f175.google.com (HELO mail-pd0-f175.google.com) (209.85.192.175) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 27 May 2015 10:22:07 +0000 Received: by pdea3 with SMTP id a3so8699237pde.2 for ; Wed, 27 May 2015 03:22:05 -0700 (PDT) X-Received: by 10.68.110.3 with SMTP id hw3mr56752370pbb.128.1432722125397; Wed, 27 May 2015 03:22:05 -0700 (PDT) Received: from E107787-LIN (gcc1-power7.osuosl.org. [140.211.15.137]) by mx.google.com with ESMTPSA id c1sm15766356pdc.45.2015.05.27.03.22.01 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 27 May 2015 03:22:03 -0700 (PDT) From: Yao Qi To: Yao Qi Cc: Edjunior Barbosa Machado , Pedro Alves , gdb-patches@sourceware.org Subject: Re: [PATCH 2/4] Implements aarch64 process record and reverse debugging support References: <1432041752-4638-1-git-send-email-yao.qi@linaro.org> <1432041752-4638-3-git-send-email-yao.qi@linaro.org> <555E3EAE.2080107@redhat.com> <86h9qzr2g2.fsf@gmail.com> <5564D0E9.3000402@linux.vnet.ibm.com> <86d21mqvl0.fsf@gmail.com> Date: Wed, 27 May 2015 11:21:59 +0100 In-Reply-To: <86d21mqvl0.fsf@gmail.com> (Yao Qi's message of "Wed, 27 May 2015 09:21:47 +0100") Message-ID: <868ucaqq0o.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 X-IsSubscribed: yes Yao Qi writes: >> gcc -g -O2 -mminimal-toc -I. -I../../gdb -I../../gdb/common -I../../gdb/config -DLOCALEDIR="\"/usr/local/share/locale\"" -DHAVE_CONFIG_H -I../../gdb/../include/opcode -I../../gdb/../opcodes/.. -I../../gdb/../readline/.. -I../../gdb/../zlib -I../bfd -I../../gdb/../bfd -I../../gdb/../include -I../libdecnumber -I../../gdb/../libdecnumber -I../../gdb/gnulib/import -Ibuild-gnulib/import -DTUI=1 -I/usr/include/python2.7 -I/usr/include/python2.7 -Wall -Wpointer-arith -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wempty-body -Wpointer-sign -Wmissing-prototypes -Wdeclaration-after-statement -Wmissing-parameter-type -Wold-style-declaration -Wold-style-definition -Wformat-nonliteral -Werror -c -o aarch64-tdep.o -MT aarch64-tdep.o -MMD -MP -MF .deps/aarch64-tdep.Tpo ../../gdb/aarch64-tdep.c >> ../../gdb/aarch64-tdep.c: In function ‘aarch64_process_record’: >> ../../gdb/aarch64-tdep.c:2823:23: error: ‘record_buf[0]’ may be used uninitialized in this function [-Werror=maybe-uninitialized] >> memcpy(®S[0], &RECORD_BUF[0], sizeof(uint32_t)*LENGTH); \ >> ^ >> ../../gdb/aarch64-tdep.c:3529:12: note: ‘record_buf[0]’ was declared here >> uint32_t record_buf[2]; >> ^ >> >> The simple patch below intends to fix this. Ok? > > This build error reveals some logic error inside function > aarch64_record_data_proc_simd_fp on decoding instructions. I'll take a look. Here is the patch below, it fixes the build failure on my machine. Does it work for you too? diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c index 8597497..d07b26c 100644 --- a/gdb/aarch64-tdep.c +++ b/gdb/aarch64-tdep.c @@ -3592,7 +3592,7 @@ aarch64_record_data_proc_simd_fp (insn_decode_record *aarch64_insn_r) record_buf[0] = AARCH64_CPSR_REGNUM; } /* Floating point - integer conversions instructions. */ - if (insn_bits12_15 == 0x00) + else if (insn_bits12_15 == 0x00) { /* Convert float to integer instruction. */ if (!(opcode >> 1) || ((opcode >> 1) == 0x02 && !rmode)) @@ -3621,8 +3621,14 @@ aarch64_record_data_proc_simd_fp (insn_decode_record *aarch64_insn_r) else record_buf[0] = reg_rd + AARCH64_V0_REGNUM; } + else + return AARCH64_RECORD_UNKNOWN; } + else + return AARCH64_RECORD_UNKNOWN; } + else + return AARCH64_RECORD_UNKNOWN; } else if ((insn_bits28_31 & 0x09) == 0x00 && insn_bits24_27 == 0x0e) {