From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id O2m+ESeDuWiX4xMAWB0awg (envelope-from ) for ; Thu, 04 Sep 2025 08:16:39 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=sankhya-com.20230601.gappssmtp.com header.i=@sankhya-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=mz3iB0Rh; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 314A91E023; Thu, 04 Sep 2025 08:16:39 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 057B91E023 for ; Thu, 04 Sep 2025 08:16:38 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7D7343858C53 for ; Thu, 4 Sep 2025 12:16:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7D7343858C53 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=sankhya-com.20230601.gappssmtp.com header.i=@sankhya-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=mz3iB0Rh Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by sourceware.org (Postfix) with ESMTPS id 507BB3858C50 for ; Thu, 4 Sep 2025 12:14:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 507BB3858C50 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=sankhya.com Authentication-Results: sourceware.org; spf=none smtp.mailfrom=sankhya.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 507BB3858C50 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::52a ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1756988070; cv=none; b=O7Cd+cKO47OSKXKfKi/UKrWnkvgda36kKJBUvxAizGELzgkIUkK1tkCd9KvJnD5T3t8Z/WYqrm6IZZLDhgH9E55MzU0q2wYK5rTSi/T08HtoDVC4iCc5MDvtSkyNrwU7zyh52ep1B9HpszsQuGbM8dbqvED1Ul890DSpTm0/v58= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1756988070; c=relaxed/simple; bh=XKbXpEec0o0njvLJGk4PvrQ3aQpDYE+f4nWsDCinn7Q=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=udZTFIPPNb8N1m98g/uAxg1cdq3TsuK5kh19nFUFUxfVmyjvG+4EeWNMMLoW41IHbE1t/sZRcTrvmLcTNNg/oAg0/1ggl1UGlYbhxb/PGY+VYzAh6ligvOKsHaRAbYb9TD+nw2tzUUH98Eyvx+uSQVZIVIex8YvmShOwvg/jR4A= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 507BB3858C50 Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-61cb4370e7bso1431813a12.3 for ; Thu, 04 Sep 2025 05:14:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sankhya-com.20230601.gappssmtp.com; s=20230601; t=1756988069; x=1757592869; darn=sourceware.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=iokgvqpNM5HBYQNZn5bxJgCQ+cEijU3GfA7RzVrUCbM=; b=mz3iB0RhUdSF3ms1rDy9XCInGEdrxbXJMiwYnWusjXQSGTSB4TguUtFRYvC7aYA2wM UcJLEt/G86xyZA0QEmQU3OutVc6kYu1oM40kDocb2+jhdte/2tPjZWhaxEOebKlcbSy+ u6k10MQMBzK+HchZjh5x5/BEZP2kq2S0Gfci8Gz4MdiRiMixUVoxZ2mnnyuyn/kvht6+ S5mKIF5cqjq37/wL6ID5JGE1ygezE8faGEC8ZS4lgGQwIkfD2XdBN84Fb0VPxmAK98D3 0KxidUAiAcEj8xXmZdRBMtzoXgcLDeOG9I8L3/k/QZBboh4YgTDt9F9L5RTMoAetz6FV BBpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756988069; x=1757592869; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=iokgvqpNM5HBYQNZn5bxJgCQ+cEijU3GfA7RzVrUCbM=; b=aANYCd1Gr6fJpxb8RYrvgyZcbsX35MmovYj3Q33EySxV/bXd8Q2bf1Kna1kbjEaex7 FKDgiTqHC2Qtm2FBMenMd3eeH1NZou2iRUFF1elD3+Ew76XhXXmKH4qL+sXOg1H4oWwb WlheHauj4cvpToYV+rf/Zt3fEHcoMSMKFMgjrJWZE24ADl8yOZJQogzd0SAmsV4g2jux CZdR/B4IMyyCQe+owVHwzTSGFT+NbrexLTJV4d9OlyOtlyhln+rTPPc9ThOACQX9IJU1 xnvrk+rT5mrcRqVkuR9/bKmFdTWozgrLuvzncOH1A6KWBRdnGDCQ6lMl0AGBHjruDlnL FI6Q== X-Forwarded-Encrypted: i=1; AJvYcCXl65DDHR8G+18cXwkyfxW95Nosjyl81WHeAotMJD3EA/ZYLH99qWJ6kfJcDGXFdsXbqiVLXESA/V0xtg==@sourceware.org X-Gm-Message-State: AOJu0YwoALcC8k1Q45VVxZxM5ONfAZ57JlKiUVBImrjiaZ4DDvJPr0A0 D6zfSTftrazOULrMUt5FTFyxU7BKf0uwPr6gY6Qf7HkV+1Ou8WvD9LZ6KXPHpTqgPwVLgcg1AkQ OhfQIViPmj9ye5NLXqIS2L3kH9aGkhGtZ2DJtU3AzTA== X-Gm-Gg: ASbGnctZIk/SMT924h8hOnCll2FxSZgyUVIKB06Q7/NrdGO24MeviBao6zRhOm5thAx rtS+58qCg4FZhk7x/FCIq3zUG7Xk/dHhqFTWuJwZoQ8BhQ+hTL0BOSEAWJb2cQmZWFPRVDSnfUt Ic3Tl+5VGlIieERRJB9/bEsi5sCrnC5DJgMuyzeV+IMbncwlq56Fl/XiviiXmXTVaYuDZMbzhLs P/vO3Wh X-Google-Smtp-Source: AGHT+IE+LvIjujYWciKXmAg547Yo5r1XSFQXkadofNbCAQa8C4TDiWgoD9qWMcWoaqfancEaHkUSf5SB8DIdGJrhp5I= X-Received: by 2002:a05:6402:2349:b0:61a:9385:c77e with SMTP id 4fb4d7f45d1cf-61d26ec4d13mr17196181a12.35.1756988068448; Thu, 04 Sep 2025 05:14:28 -0700 (PDT) MIME-Version: 1.0 References: <3bdebc70-e678-44e7-98ec-18c6b23dccca@simark.ca> <93642dcc-4922-4a15-84ae-2404e9d54a17@simark.ca> <33ea6f2a-2585-404f-aded-565f33ffa40c@eagercon.com> In-Reply-To: <33ea6f2a-2585-404f-aded-565f33ffa40c@eagercon.com> From: Gopi Kumar Bulusu Date: Thu, 4 Sep 2025 17:13:53 +0530 X-Gm-Features: Ac12FXzyU7_v-QU5LIfc3S4NKE3jd3g88qhrYjpI1BGAFoSi-qSWqa8x-LkArW8 Message-ID: Subject: Re: [PATCH v2 ] MicroBlaze: Add microblaze_get_next_pcs To: Michael Eager Cc: Simon Marchi , gdb-patches@sourceware.org Content-Type: multipart/alternative; boundary="000000000000b21e67063df8a99c" X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org --000000000000b21e67063df8a99c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello Mike, On Wed, Sep 3, 2025 at 11:32=E2=80=AFPM Michael Eager = wrote: > Please submit revised patch. > Working on it. I will push the patch v3 and post it here as well. dhanyavaadaaha gopi > On 9/3/25 10:57 AM, Simon Marchi wrote: > > On 9/2/25 8:27 AM, Gopi Kumar Bulusu wrote: > >> From 7f2bacc6fffa6830991da36c2044431237bacba1 Mon Sep 17 00:00:00 200= 1 > >> From: Gopi Kumar Bulusu > >> Date: Tue, 12 Aug 2025 09:42:48 +0530 > >> Subject: [PATCH v2] MicroBlaze: Add microblaze_get_next_pcs > >> > >> This patch enables software single stepping for gdbserver target > >> > >> * gdb/microblaze-tdep.c: Add microblaze_get_next_pcs > >> > >> Signed-off-by: David Holsgrove > >> Signed-off-by: Nathan Rossi > >> Signed-off-by: Mahesh Bodapati > >> Signed-off-by: Gopi Kumar Bulusu > >> --- > >> gdb/microblaze-tdep.c | 91 +++++++++++++++++++++++++++++++++++++++++= ++ > >> 1 file changed, 91 insertions(+) > >> > >> diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c > >> index 7b58220871c..cacec8ba186 100644 > >> --- a/gdb/microblaze-tdep.c > >> +++ b/gdb/microblaze-tdep.c > >> @@ -590,6 +590,95 @@ microblaze_stabs_argument_has_addr (struct gdbarc= h > *gdbarch, struct type *type) > >> return (type->length () =3D=3D 16); > >> } > >> > >> +/* Return next pc values : next in sequence and/or branch/return > target. */ > >> + > >> +static std::vector > >> +microblaze_get_next_pcs (regcache *regcache) > >> +{ > >> + CORE_ADDR pc =3D regcache_read_pc (regcache); > >> + long insn =3D microblaze_fetch_instruction (pc); > >> + > >> + enum microblaze_instr_type insn_type; > >> + short delay_slots; > >> + bool isunsignednum; > >> + > >> + /* If the current instruction is an imm, look at the inst after. *= / > >> + > >> + get_insn_microblaze (insn, &isunsignednum, &insn_type, &delay_slots= ); > >> + > >> + int imm; > >> + bool immfound =3D false; > >> + > >> + if (insn_type =3D=3D immediate_inst) > >> + { > >> + int rd, ra, rb; > >> + immfound =3D true; > >> + microblaze_decode_insn (insn, &rd, &ra, &rb, &imm); > >> + pc +=3D INST_WORD_SIZE; > >> + insn =3D microblaze_fetch_instruction (pc); > >> + get_insn_microblaze (insn, &isunsignednum, &insn_type, > &delay_slots); > >> + } > >> + > >> + std::optional next_pc, branch_or_return_pc; > >> + > >> + /* Compute next instruction address - skip delay slots if any. */ > >> + > >> + if (insn_type !=3D return_inst) > >> + next_pc =3D pc + INST_WORD_SIZE + (delay_slots * INST_WORD_SIZE); > >> + > >> + microblaze_debug ("single-step insn_type=3D0x%x pc=3D0x%lx insn=3D0= x%lx\n", > >> + insn_type, pc, insn); > > > > You shouldn't need the trailing \n. Apply elsewhere too. > > > >> + > >> + /* Compute target instruction address for branch or return > instruction. */ > >> + if (insn_type =3D=3D branch_inst || insn_type =3D=3D return_inst) > >> + { > >> + int limm; > >> + int lrd, lra, lrb; > >> + long ra, rb; > >> + bool targetvalid; > >> + bool unconditionalbranch; > > > > Declare when first use, where possible (ra and rb). > > > > ra and rb should probably be of the type ULONGEST. > > > >> + > >> + microblaze_decode_insn (insn, &lrd, &lra, &lrb, &limm); > >> + ra =3D regcache_raw_get_unsigned (regcache, lra); > >> + rb =3D regcache_raw_get_unsigned (regcache, lrb); > >> + > >> + branch_or_return_pc =3D microblaze_get_target_address (insn, > immfound, > >> + imm, pc, ra, rb, &targetvalid, &unconditionalbranch= ); > > > > Format like this: > > > > branch_or_return_pc > > =3D microblaze_get_target_address (insn, immfound, > > imm, pc, ra, rb, &targetvalid, > > &unconditionalbranch); > > > >> + > >> + microblaze_debug ( > >> + "single-step uncondbr=3D%d targetvalid=3D%d > target=3D0x%lx\n", > >> + unconditionalbranch, targetvalid, > >> + branch_or_return_pc.value () ); > > > > Format like this: > > > > microblaze_debug ("single-step uncondbr=3D%d targetvalid=3D%d > target=3D0x%lx", > > unconditionalbranch, targetvalid, > > branch_or_return_pc.value ()); > > > >> + > >> + /* Can't reach next address. */ > >> + if (unconditionalbranch) > >> + next_pc.reset (); > >> + > >> + /* Can't reach a distinct (not here) target address. */ > >> + if (! targetvalid || branch_or_return_pc =3D=3D pc || > >> + (next_pc && (branch_or_return_pc =3D=3D next_pc))) > >> + branch_or_return_pc.reset (); > > > > Format like this: > > > > /* Can't reach a distinct (not here) target address. */ > > if (!targetvalid > > || branch_or_return_pc =3D=3D pc > > || (next_pc.has_value () && branch_or_return_pc =3D=3D next_pc)= ) > > branch_or_return_pc.reset (); > > > > > >> + } /* if (branch or return instruction). */ > >> + > >> + /* Create next_pcs vector to return. */ > >> + > >> + std::vector next_pcs; > >> + > >> + if (next_pc) > > > > .has_value () > > > >> + { > >> + next_pcs.push_back (next_pc.value () ); > > > > We typically use `*next_pc` to access the value (apply elsewhere too). > > > > Remove the space before closing parenthesis (apply elsewhere too). > > > >> + microblaze_debug ("push_back next_pc(0x%lx)\n", next_pc.value (= ) > ); > >> + } > >> + > >> + if (branch_or_return_pc) > >> + { > >> + next_pcs.push_back ( branch_or_return_pc.value () ); > >> + microblaze_debug ("push_back branch_or_return_pc(0x%lx)\n", > >> + branch_or_return_pc.value ()); > > > > Align the last line properly. > > > > The patch LGTM with those fixed. Let me know if you need help pushing > > the patch. > > > > Approved-By: Simon Marchi > > > > Simon > > > > -- > Michael Eager > > --000000000000b21e67063df8a99c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello Mike,

On Wed, Sep 3, 2025 at 11:32=E2=80=AFPM Michael Eager <<= a href=3D"mailto:eager@eagercon.com">eager@eagercon.com> wrote:
<= /div>
Please submit revise= d patch.

Working on it.

<= /div>
I will push the patch v3 and post it here as well.
= =C2=A0
dhanyavaadaaha
gopi


On 9/3/25 10:57 AM, Simon Marchi wrote:
> On 9/2/25 8:27 AM, Gopi Kumar Bulusu wrote:
>>=C2=A0 From 7f2bacc6fffa6830991da36c2044431237bacba1 Mon Sep 17 00:= 00:00 2001
>> From: Gopi Kumar Bulusu <gopi@sankhya.com>
>> Date: Tue, 12 Aug 2025 09:42:48 +0530
>> Subject: [PATCH v2] MicroBlaze: Add microblaze_get_next_pcs
>>
>> This patch enables software single stepping for gdbserver target >>
>> * gdb/microblaze-tdep.c: Add microblaze_get_next_pcs
>>
>> Signed-off-by: David Holsgrove <david.holsgrove@petalogix.com> >> Signed-off-by: Nathan Rossi <nathan.rossi@petalogix.com>
>> Signed-off-by: Mahesh Bodapati <mbodapat@xilinx.com>
>> Signed-off-by: Gopi Kumar Bulusu <gopi@sankhya.com>
>> ---
>>=C2=A0 =C2=A0gdb/microblaze-tdep.c | 91 +++++++++++++++++++++++++++= ++++++++++++++++
>>=C2=A0 =C2=A01 file changed, 91 insertions(+)
>>
>> diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c
>> index 7b58220871c..cacec8ba186 100644
>> --- a/gdb/microblaze-tdep.c
>> +++ b/gdb/microblaze-tdep.c
>> @@ -590,6 +590,95 @@ microblaze_stabs_argument_has_addr (struct gd= barch *gdbarch, struct type *type)
>>=C2=A0 =C2=A0 =C2=A0return (type->length () =3D=3D 16);
>>=C2=A0 =C2=A0}
>>=C2=A0 =C2=A0
>> +/* Return next pc values : next in sequence and/or branch/return = target.=C2=A0 */
>> +
>> +static std::vector<CORE_ADDR>
>> +microblaze_get_next_pcs (regcache *regcache)
>> +{
>> +=C2=A0 CORE_ADDR pc =3D regcache_read_pc (regcache);
>> +=C2=A0 long insn =3D microblaze_fetch_instruction (pc);
>> +
>> +=C2=A0 enum microblaze_instr_type insn_type;
>> +=C2=A0 short delay_slots;
>> +=C2=A0 bool isunsignednum;
>> +
>> +=C2=A0 /* If the current instruction is an imm, look at the inst = after.=C2=A0 */
>> +
>> +=C2=A0 get_insn_microblaze (insn, &isunsignednum, &insn_t= ype, &delay_slots);
>> +
>> +=C2=A0 int imm;
>> +=C2=A0 bool immfound =3D false;
>> +
>> +=C2=A0 if (insn_type =3D=3D immediate_inst)
>> +=C2=A0 =C2=A0 {
>> +=C2=A0 =C2=A0 =C2=A0 int rd, ra, rb;
>> +=C2=A0 =C2=A0 =C2=A0 immfound =3D true;
>> +=C2=A0 =C2=A0 =C2=A0 microblaze_decode_insn (insn, &rd, &= ra, &rb, &imm);
>> +=C2=A0 =C2=A0 =C2=A0 pc +=3D INST_WORD_SIZE;
>> +=C2=A0 =C2=A0 =C2=A0 insn =3D microblaze_fetch_instruction (pc);<= br> >> +=C2=A0 =C2=A0 =C2=A0 get_insn_microblaze (insn, &isunsignednu= m, &insn_type, &delay_slots);
>> +=C2=A0 =C2=A0 }
>> +
>> +=C2=A0 std::optional<CORE_ADDR> next_pc, branch_or_return_p= c;
>> +
>> +=C2=A0 /* Compute next instruction address - skip delay slots if = any.=C2=A0 */
>> +
>> +=C2=A0 if (insn_type !=3D return_inst)
>> +=C2=A0 =C2=A0 next_pc =3D pc + INST_WORD_SIZE + (delay_slots * IN= ST_WORD_SIZE);
>> +
>> +=C2=A0 microblaze_debug ("single-step insn_type=3D0x%x pc=3D= 0x%lx insn=3D0x%lx\n",
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 insn_type= , pc, insn);
>
> You shouldn't need the trailing \n.=C2=A0 Apply elsewhere too.
>
>> +
>> +=C2=A0 /* Compute target instruction address for branch or return= instruction.=C2=A0 */
>> +=C2=A0 if (insn_type =3D=3D branch_inst || insn_type =3D=3D retur= n_inst)
>> +=C2=A0 =C2=A0 {
>> +=C2=A0 =C2=A0 =C2=A0 int limm;
>> +=C2=A0 =C2=A0 =C2=A0 int lrd, lra, lrb;
>> +=C2=A0 =C2=A0 =C2=A0 long ra, rb;
>> +=C2=A0 =C2=A0 =C2=A0 bool targetvalid;
>> +=C2=A0 =C2=A0 =C2=A0 bool unconditionalbranch;
>
> Declare when first use, where possible (ra and rb).
>
> ra and rb should probably be of the type ULONGEST.
>
>> +
>> +=C2=A0 =C2=A0 =C2=A0 microblaze_decode_insn (insn, &lrd, &= ;lra, &lrb, &limm);
>> +=C2=A0 =C2=A0 =C2=A0 ra =3D regcache_raw_get_unsigned (regcache, = lra);
>> +=C2=A0 =C2=A0 =C2=A0 rb =3D regcache_raw_get_unsigned (regcache, = lrb);
>> +
>> +=C2=A0 =C2=A0 =C2=A0 branch_or_return_pc =3D microblaze_get_targe= t_address (insn, immfound,
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 im= m, pc, ra, rb, &targetvalid, &unconditionalbranch);
>
> Format like this:
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 branch_or_return_pc
>=C2=A0 =C2=A0 =C2=A0 =C2=A0=3D microblaze_get_target_address (insn, imm= found,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 imm, = pc, ra, rb, &targetvalid,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &= unconditionalbranch);
>
>> +
>> +=C2=A0 =C2=A0 =C2=A0 microblaze_debug (
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &q= uot;single-step uncondbr=3D%d targetvalid=3D%d target=3D0x%lx\n",
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 un= conditionalbranch, targetvalid,
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 br= anch_or_return_pc.value () );
>
> Format like this:
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 microblaze_debug ("single-step uncondb= r=3D%d targetvalid=3D%d target=3D0x%lx",
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0unconditionalbranch, targetvalid,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0branch_or_return_pc.value ());
>
>> +
>> +=C2=A0 =C2=A0 =C2=A0 /* Can't reach next address.=C2=A0 */ >> +=C2=A0 =C2=A0 =C2=A0 if (unconditionalbranch)
>> +=C2=A0 =C2=A0 next_pc.reset ();
>> +
>> +=C2=A0 =C2=A0 =C2=A0 /* Can't reach a distinct (not here) tar= get address.=C2=A0 */
>> +=C2=A0 =C2=A0 =C2=A0 if (! targetvalid || branch_or_return_pc =3D= =3D pc ||
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (n= ext_pc && (branch_or_return_pc =3D=3D next_pc)))
>> +=C2=A0 =C2=A0 =C2=A0 branch_or_return_pc.reset ();
>
> Format like this:
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 /* Can't reach a distinct (not here) ta= rget address.=C2=A0 */
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (!targetvalid
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|| branch_or_return_pc =3D=3D pc
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|| (next_pc.has_value () && b= ranch_or_return_pc =3D=3D next_pc))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0branch_or_return_pc.reset ();
>
>
>> +=C2=A0 =C2=A0 } /* if (branch or return instruction).=C2=A0 */ >> +
>> +=C2=A0 /* Create next_pcs vector to return.=C2=A0 */
>> +
>> +=C2=A0 std::vector<CORE_ADDR> next_pcs;
>> +
>> +=C2=A0 if (next_pc)
>
> .has_value ()
>
>> +=C2=A0 =C2=A0 {
>> +=C2=A0 =C2=A0 =C2=A0 next_pcs.push_back (next_pc.value () );
>
> We typically use `*next_pc` to access the value (apply elsewhere too).=
>
> Remove the space before closing parenthesis (apply elsewhere too).
>
>> +=C2=A0 =C2=A0 =C2=A0 microblaze_debug ("push_back next_pc(0x= %lx)\n", next_pc.value () );
>> +=C2=A0 =C2=A0 }
>> +
>> +=C2=A0 if (branch_or_return_pc)
>> +=C2=A0 =C2=A0 {
>> +=C2=A0 =C2=A0 =C2=A0 next_pcs.push_back ( branch_or_return_pc.val= ue () );
>> +=C2=A0 =C2=A0 =C2=A0 microblaze_debug ("push_back branch_or_= return_pc(0x%lx)\n",
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 br= anch_or_return_pc.value ());
>
> Align the last line properly.
>
> The patch LGTM with those fixed.=C2=A0 Let me know if you need help pu= shing
> the patch.
>
> Approved-By: Simon Marchi <simon.marchi@efficios.com>
>
> Simon
>

--
Michael Eager

--000000000000b21e67063df8a99c--