From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 74517 invoked by alias); 11 Feb 2016 15:15:53 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 73033 invoked by uid 89); 11 Feb 2016 15:15:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=bullet, sk:gdbserv, get-next-pcs, u16 X-HELO: mail-pf0-f171.google.com Received: from mail-pf0-f171.google.com (HELO mail-pf0-f171.google.com) (209.85.192.171) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 11 Feb 2016 15:15:51 +0000 Received: by mail-pf0-f171.google.com with SMTP id x65so30852671pfb.1 for ; Thu, 11 Feb 2016 07:15:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type :content-transfer-encoding; bh=oj1jM2G4YW7QwOYdZpLrrV09POOFk33L82oSguuSCFw=; b=U7SPupyvPAXlinFknaYEF+ZeY3WyTXr3DtFu1pSf9MY29P1+FEqsxYzL4IRQUt+pLA Gy60vzUZOWyI2M3/ll08Br9JjUO7KNOA7C+EgtkEFXElOVkcWbD7+kAqR3Qq6/OyQ3Kx kRic4cTtKQD2ZZvtOX3EuRXVubleL/wvhM8jTeCrdvIRSejYY1xbOPulcPG/pTvq8GYo RF4bPUTUDfdPR3qdWhe22ZPckis9wCiYH3+608S16Ew26vmKVYhIo4sERMJ5hcD9b5gK fATlGszZcmxu/0nqE1z9JgofroR11b3S5apcIaHCjy4WVUo9e1/lKuEA8nvDOLUaPipj 48QQ== X-Gm-Message-State: AG10YOSiL+OLwCMGpKiO47uFLbJyr0bfxHZ55lXvd+5gg6Bnrfk3zSlMVXHdpBd5Z5nRQg== X-Received: by 10.98.12.8 with SMTP id u8mr38025856pfi.36.1455203749553; Thu, 11 Feb 2016 07:15:49 -0800 (PST) Received: from E107787-LIN (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id 17sm13054007pfp.96.2016.02.11.07.15.47 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Thu, 11 Feb 2016 07:15:48 -0800 (PST) From: Yao Qi To: Pedro Alves Cc: Yao Qi , gdb-patches@sourceware.org Subject: Re: [PATCH] Clear *VAL in regcache_raw_read_unsigned References: <1455029644-6197-1-git-send-email-yao.qi@linaro.org> <86egckqztq.fsf@gmail.com> <56BB6ADB.6070909@redhat.com> <86a8n8qxyp.fsf@gmail.com> <56BB7512.2030507@redhat.com> <8660xvr1wr.fsf@gmail.com> <56BC829B.8060102@redhat.com> Date: Thu, 11 Feb 2016 15:15:00 -0000 In-Reply-To: <56BC829B.8060102@redhat.com> (Pedro Alves's message of "Thu, 11 Feb 2016 12:46:19 +0000") Message-ID: <864mdfp9b3.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2016-02/txt/msg00351.txt.bz2 Pedro Alves writes: > uint8_t u8; > uint16_t u16; > uint32_t u32; > uint64_t u64; > > switch (size) > { > case 1: > collect_register (regcache, regnum, &u8); > *val =3D u8; > break; > case 2: > collect_register (regcache, regnum, &u16); > *val =3D u16; > break; > case 4: > collect_register (regcache, regnum, &u32); > *val =3D u32; > break; > case 8: > collect_register (regcache, regnum, &u64); > *val =3D u64; > break; > } > > This should work in either endianess, and the '*val =3D 0' is no longer > necessary either. I think this is better than 'make gdbserver use extract_unsigned_integer', which looks overkill to me. > > Or maybe better, just byte the bullet and make gdbserver use > extract_unsigned_integer, like gdb. > > The problem with that is that gdbserver can't currently use 'enum bfd_end= ian', > which IIRC, was already an issue in the get-next-pcs stuff. I've attache= d a get-next-pcs stuff needs endianness in GDB side. In GDBserver, endianness is not needed. > patch series that handles that by moving bfd_endian to a separate header. > I've pushed it to the users/palves/gdbserver-extract-unsigned-integer bra= nch > as well. > > If you agree with this, I'll run the bfd_endian patch by the binutils fol= ks. Since the endianness of GDBserver is always identical to the endianness of the program, I am not sure sharing extract_unsigned_integer between GDB and GDBserver is necessary. --=20 Yao (=E9=BD=90=E5=B0=A7)