From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 57302 invoked by alias); 3 Dec 2015 10:28:50 -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 57292 invoked by uid 89); 3 Dec 2015 10:28:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f45.google.com Received: from mail-pa0-f45.google.com (HELO mail-pa0-f45.google.com) (209.85.220.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 03 Dec 2015 10:28:48 +0000 Received: by pacej9 with SMTP id ej9so66979725pac.2 for ; Thu, 03 Dec 2015 02:28:47 -0800 (PST) X-Received: by 10.66.222.101 with SMTP id ql5mr11992991pac.144.1449138527189; Thu, 03 Dec 2015 02:28:47 -0800 (PST) Received: from E107787-LIN (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id ud10sm9800820pab.27.2015.12.03.02.28.43 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Thu, 03 Dec 2015 02:28:45 -0800 (PST) From: Yao Qi To: Antoine Tremblay Cc: Subject: Re: [PATCH v4 3/6] Refactor arm_software_single_step to use regcache. References: <1449062264-18565-1-git-send-email-antoine.tremblay@ericsson.com> <1449062264-18565-4-git-send-email-antoine.tremblay@ericsson.com> Date: Thu, 03 Dec 2015 10:28:00 -0000 In-Reply-To: <1449062264-18565-4-git-send-email-antoine.tremblay@ericsson.com> (Antoine Tremblay's message of "Wed, 2 Dec 2015 08:17:41 -0500") Message-ID: <86egf3u8py.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: 2015-12/txt/msg00039.txt.bz2 Antoine Tremblay writes: Hi Antoine, > * common/common-regcache.h (register_status) New enum. > (regcache_raw_read_unsigned): New declaration. > * regcache.h (enum register_status): Move to common-regcache.h. > (regcache_raw_read_unsigned): Likewise. > > gdb/gdbserver/ChangeLog: > > * regcache.c (regcache_raw_read_unsigned): New function. > * regcache.h (REG_UNAVAILABLE, REG_VALID): Replaced by shared > register_status enum. > (init_register_cache): Initialize cache to REG_UNAVAILABLE. Adding regcache_raw_read_unsigned in GDBserver looks unrelated to this patch. I know patch #4 will use regcache_raw_read_unsigned in GDBserver, so this change can be patch 3.5. > another breakpoint by our caller. */ >=20=20 > static CORE_ADDR > -thumb_get_next_pc_raw (struct frame_info *frame, CORE_ADDR pc) > +thumb_get_next_pc_raw (struct regcache *regcache, struct frame_info *fra= me, > + CORE_ADDR pc) Do we still need frame? it should be removed. > @@ -4746,20 +4775,22 @@ thumb_get_next_pc_raw (struct frame_info *frame, = CORE_ADDR pc) > address. */ >=20=20 > static CORE_ADDR > -arm_get_next_pc_raw (struct frame_info *frame, CORE_ADDR pc) > +arm_get_next_pc_raw (struct regcache *regcache, struct frame_info *frame, > + CORE_ADDR pc) Likewise. > @@ -5019,14 +5057,15 @@ arm_get_next_pc_raw (struct frame_info *frame, CO= RE_ADDR pc) > loop is detected. */ >=20=20 > CORE_ADDR > -arm_get_next_pc (struct frame_info *frame, CORE_ADDR pc) > +arm_get_next_pc (struct regcache *regcache, struct frame_info *frame, > + CORE_ADDR pc) > { Likewise. > diff --git a/gdb/gdbserver/regcache.c b/gdb/gdbserver/regcache.c > index b9311fe..c608bf3 100644 > --- a/gdb/gdbserver/regcache.c > +++ b/gdb/gdbserver/regcache.c > @@ -145,8 +145,9 @@ init_register_cache (struct regcache *regcache, > =3D (unsigned char *) xcalloc (1, tdesc->registers_size); > regcache->registers_owned =3D 1; > regcache->register_status > - =3D (unsigned char *) xcalloc (1, tdesc->num_registers); > - gdb_assert (REG_UNAVAILABLE =3D=3D 0); > + =3D (unsigned char *) xmalloc (tdesc->num_registers); > + memset ((void *) regcache->register_status, REG_UNAVAILABLE, > + tdesc->num_registers); Odd indentation. > #else > gdb_assert_not_reached ("can't allocate memory from the heap"); > #endif > @@ -435,6 +436,27 @@ collect_register (struct regcache *regcache, int n, = void *buf) > register_size (regcache->tdesc, n)); > } >=20=20 > +enum register_status > +regcache_raw_read_unsigned (struct regcache *regcache, int regnum, > + ULONGEST *val) Odd indentation. --=20 Yao (=E9=BD=90=E5=B0=A7)