From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id If5vNWANKmpuywAAWB0awg (envelope-from ) for ; Wed, 10 Jun 2026 21:20:32 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=sankhya-com.20251104.gappssmtp.com header.i=@sankhya-com.20251104.gappssmtp.com header.a=rsa-sha256 header.s=20251104 header.b=banswy6D; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id D4E5D1E024; Wed, 10 Jun 2026 21:20:32 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.3 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=unavailable autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::32]) (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 96A741E024 for ; Wed, 10 Jun 2026 21:20:31 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 88FCA4BA9001 for ; Thu, 11 Jun 2026 01:20:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 88FCA4BA9001 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=sankhya-com.20251104.gappssmtp.com header.i=@sankhya-com.20251104.gappssmtp.com header.a=rsa-sha256 header.s=20251104 header.b=banswy6D Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by sourceware.org (Postfix) with ESMTPS id 136534BA2E05 for ; Thu, 11 Jun 2026 01:19:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 136534BA2E05 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 136534BA2E05 Authentication-Results: sourceware.org; arc=pass smtp.remote-ip=2a00:1450:4864:20::62e ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1781140778; cv=pass; b=YixDMHD47YyuwEv29V4xP7i3bxYqzPYAl7F/s8pGLFeQyN7m3ZHKllf+vuh6UdhaJzGZrkZwrDiUUtGlP3rq9/B1fRnfVPieilwF1dJcWOQwWa/APkMrotDOUWfvVFZK1yqx90y/wB5EyRGyMv8UD0Y4kQ7H3ZYHUgJsBF7yh7A= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1781140778; c=relaxed/simple; bh=o7uaSmrNjNdjAV7U8fFkY94DaNPsv8yjQTBEvwWJ6mw=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=Hbb4Vn5QMdpP0N7puS03Yn9ch4Lm8VnpdyLF01WLTDHO/4OFfknwKAUbwcGs1YDUnkijPMsGCH2NiD+oMERi4s9Hb76dQG3cdB4Kh3byPJ5Jfrd/TTfDrpdcz07bng6q8Mi1CxHnheXBVXo+MSGERLQhaCgSCI6Gg/Ed+EuVm0w= ARC-Authentication-Results: i=2; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=sankhya-com.20251104.gappssmtp.com header.i=@sankhya-com.20251104.gappssmtp.com header.a=rsa-sha256 header.s=20251104 header.b=banswy6D DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 136534BA2E05 Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-bf0170c80f7so1265192466b.3 for ; Wed, 10 Jun 2026 18:19:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1781140776; cv=none; d=google.com; s=arc-20240605; b=Xp7aro0Fu23FNHxu0ref8ZkbZbAT40eZdLZcZBSLyPQPMF5Oqf1tvRfgWt9l88y/3U 2XBI7aa61yGVGBS9Hbc33O+iK7bx1HcyZQNwftyt/+MOJF1Xx5zYXnSjrwImu65ZvTit 22+c1H6vjtwAx8J3tqkBMZF/A7HdmItbPz8JS32fS9bjYobIIgEebgzq+ilaCSmsVKdl mTLf4e0Z1NvNrFMoXijO/oVLQFRjOLdxOKRaAD00x/KeGfC6dI7tPMSKrdYJgyZtGCzs uOEnKHtpp8noSOnFRE1pFKDiWT97wXPpX938gVkkKHfMownTKqjQaG5f1Wnt1uZdiCqE PAQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=XOWvn2fSF81UKGtPVKjOI27WgRtQ8k0ppHDuBbrAHCs=; fh=0yt9zxLv4vMGbBa8jTUAWVGtptGanMMzHxhZsQyweag=; b=gWUFlE/s+EjVV50ZibahY6X9AQQwvsQOm69/UocD5tMDH4B7SjblxptOvUCsTcfJHz 2ryixVqTzYsOsrimG++p7HuPs04jrtbOMz6SUCM9M55g6pYmKceBIZiDOaNRBHOhCSYm M5g1fEq4pTrRvc9JUFJH9VH0z80+piZyBbgbFdUAu2SYDNO+wk6UT+w+WueCyBBnJvwq yHbU1beZBevLLZpS1u0KmXdqti8hB7PgIw6T2mcW+G3d6suMimZ+NYC+kc5Q2BNboDjv waAvhyLCcKOjXg+25HysJer/xcu3NtNWKaRj/gkSV/3GxJUE41Hug+FmhOuAMofgOR5E fCxA==; darn=sourceware.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sankhya-com.20251104.gappssmtp.com; s=20251104; t=1781140776; x=1781745576; 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=XOWvn2fSF81UKGtPVKjOI27WgRtQ8k0ppHDuBbrAHCs=; b=banswy6DOCMNihuKaW0NMexU/Exj8JXyJqGsB7zsHI4kKScpTPRZhsL3vCuvjZT186 xsoa96ETSo2aYy9EmcdjJTV3IUecIpfb3VBhhZ0mTxA3XIW/UNajmzOUT6Xh2OBq/Qg3 1cYzt0DlFiMFsUkHNdHJ36Ra8Vppcvp7bDJL2m9RXMyEa0SDAIBkDo2Qc3/+R5GSXPr+ bYBdHadzvXyqfseRf2DDLy+5ikzRSy1XTlUhPurRX+homRT5soCgIwjMDWv/S97oA/K2 ajx7cOYmLYANe1k4lyNTtncZzaxESFIpJ4fNE8VfbbrddSOPuRcCn4MIOspxtiGM7iXl 4VSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781140776; x=1781745576; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=XOWvn2fSF81UKGtPVKjOI27WgRtQ8k0ppHDuBbrAHCs=; b=HqTc2VjMDbCjk66Utz3f9dHQr7sfTCU2nEVI3MC4pB7cKdsHRrJYt/+/Qi233V+iyg rEJF654ETlY6WyBWRtw+LvwkmsCgdxhVRIueqg8mdOoOaMoxO6EBHjhv0JEnGHdQKHan BxMuu32H1VTY1u1aFca+oUQl1PsfsLCtxQFycVDQfPsbpee1TWTj6q6t+tnQh+DmsRKJ lyQSCqnp4x4pG0fv9YHPUbsmTD25bMEaZpQ01cI56T1i3/XTss1lsC8MRm+gzze1D8pF BkQfKiq0GYDOfBT5pDxLEDlDfKaTV5+dpIqpGPA0Gm6UZOGGACcqXXI1LWEQ69Q5FHHo IGUQ== X-Forwarded-Encrypted: i=1; AFNElJ8iTmCzxC3UxkhNSAsk3bZgu2wQUC00Vzozjb4VEYQNnTRtQ+KdYuw3r0ePthtyJ2E8d5Coy/hOxm0VZQ==@sourceware.org X-Gm-Message-State: AOJu0YwEVGJSidaiLzwluf+5+oQxEcXl+OdNYhgInKZuqi9bWubHuZYd lEUqNPpeobYIIybtXGqpKlQNiqimOgxgg10Uda/dK3gZyTF2zg36OyMbSOiDccTtTXdPvKJDdwK 84sIKGyy1eaH0Cj996b/CLR6SYp43baeK9f1CwcAcOw== X-Gm-Gg: Acq92OEIPVsD1fgAsSWF5+8aV506RdHgyS+YW/QeIvUmq7wi0YjGvHpQW/g4qeMwL+v CT7gsODNI1Sd8vLwTMCO9gc1gc9hvpebhIV0BLEqto/aZ4iZvvMGofbO/u2kQ2OJzj8dd8LmP0z 7oxS9/+6Fjcr5kgPlTXHhNnlQjjz/sDiz8ke+PXmCQPvbKRR7LVL6EZ5Lrn9a2GJju09lXr2gGf T48D+BY3NIe5StIcw0k3/iRnd62m3Z31V6BWW99CH2hf9wQ0LDcBo3pKeRi0IbA9Ysg0Tc80Vl3 pVyUO/1qNqaqm9GOarG64mfTBRsgHdi0L7+XexTSB18qKf926mFW9C3vwtjildWlscwbFj4k3Ay iihxBQ/+j8/aMeB56MsAK66gdr9aaTeSR+gXMm2YGlEdWJZXhbSQ9mA+XLmoC5jTmUQs1kHda42 5L2U5gK3O3g6TQPZEJMoBXaZfZ X-Received: by 2002:a17:907:a08a:b0:bf4:ae01:29e1 with SMTP id a640c23a62f3a-bfc89134bb1mr9842966b.48.1781140776115; Wed, 10 Jun 2026 18:19:36 -0700 (PDT) MIME-Version: 1.0 References: <874ijq5knu.fsf@tromey.com> <09e2a40b-2f9f-4f8e-af31-0235baf61acd@eagercon.com> In-Reply-To: <09e2a40b-2f9f-4f8e-af31-0235baf61acd@eagercon.com> From: Gopi Kumar Bulusu Date: Thu, 11 Jun 2026 06:49:21 +0530 X-Gm-Features: AVVi8CfkDmgfKKddKOramrZLWq9hmHS6UHYGEpa0JCUa5McVT9nJbOl-PEgJk7Y Message-ID: Subject: Re: [PATCH v2] gdb/MicroBlaze: Add support for native linux gdb To: Michael Eager Cc: binutils@sourceware.org, gdb-patches@sourceware.org, Tom Tromey , Simon Marchi Content-Type: multipart/alternative; boundary="000000000000416f830653f0279a" 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 --000000000000416f830653f0279a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable namaskaaram On Thu, Jun 11, 2026, 6:09 AM Michael Eager wrote: > Hi Gopi -- > > I (or more accurately, git) fixed several whitespace issues. > Please share. I did check all the whitespace issues flagged by git-diff. > Since this is a revised patch, has it been retested? > Yes, it has been retested. dhanyavaadaaha gopi > On 6/1/26 10:05 PM, Gopi Kumar Bulusu wrote: > > namaskaaram > > > > Attached is the updated patch. All the changes suggested on PATCH v1 > > have been made and tested. > > > > I did not remove the (sal.line !=3D 0) check as it seemed trivial. > > However, I can make that a separate patch if necessary. > > > > Our sysadm In the process of setting up a git compatible email - the > > process may take more time; until then appreciate your patience with > > the attachments. > > > > Important Note: > > > > 1) gdb appears to have an elaborate scheme to handle C++ exceptions > > and "tunnel" them through exception unaware C code. This code is with > > readline. Anytime > > an error is discovered (even a syntax error) by a module, > > gdb_exception_error() thrown is tunneled through readline using the > > TRY_SJLJ/CATCH_SJLJ macros > > implemented using setjmp/longjmp. > > > > 2) There is an issue that I came across while testing; native gdb goes > > into an infinite loop when handling errors. I analyzed it and found it > > to be an obvious glibc > > sysdeps/unix/sysv/linux/microblaze/____longjmp_chk.S issue and > > reported it to AMD. It is possible I missed out a glibc patch; At this > > time - this is not a gdb issue. > > > > 3) Plan to follow through [2] and ensure a gcc/glibc defect report is > > created if needed. > > > > dhanyavaadaaha > > gopi > > > > On Tue, Jun 2, 2026 at 5:58=E2=80=AFAM Michael Eager = wrote: > >> > >> Please post an updated patch for review. > >> > >> On 5/31/26 11:38 PM, Gopi Kumar Bulusu wrote: > >>> On Fri, May 29, 2026 at 8:26=E2=80=AFPM Tom Tromey w= rote: > >>>> > >>>>>>>>> Gopi Kumar Bulusu writes: > >>>> > >>>>> Attached is a patch to add native linux support for gdb including > >>>>> cache target support.. > >>>> > >>>> Thanks for the patch. > >>>> > >>>> I read through it and have some nits. There's nothing very serious > >>>> except this: > >>>> > >>>>> The original sources for the patch come from Xilinx/AMD Yocto git > >>>>> repository (2025.2) > >>>> > >>>> Who wrote them and are they covered by the copyright assignment? > >>>> > >>>> This is the most important consideration, the patch can't land witho= ut > >>>> this being clear. > >>> > >>> This work is being performed under a contract with Xilinx/AMD as > >>> confirmed in a different response to > >>> Simon and therefore covered by the copyright assignment. > >>> > >>> I will make the changes as described below and retest. > >>> > >>> Approved for commit ? > >>> > >>> dhanyavaadaaha > >>> gopi > >>> > >>>> > >>>>> From a3328b4cdfc58783b5f290f22255b36e26a6fb14 Mon Sep 17 00:00:00 > 2001 > >>>>> From: Gopi Kumar Bulusu > >>>>> Date: Thu, 7 May 2026 17:47:40 +0530 > >>>>> Subject: [PATCH] gdb/MicroBlaze: Add support for native linux gdb > >>>> > >>>> It's best to just git send-email rather than using an attachment. > >>>> > >>>>> bfd/ChangeLog: > >>>> > >>>>> * elf32-microblaze.c (microblaze_elf_grok_prstatus): New > function. > >>>>> (microblaze_elf_grok_psinfo): Likewise. > >>>> > >>>>> gdb/ChangeLog: > >>>> > >>>>> * Makefile.in (HFILES_NO_SRCDIR): Add microblaze-linux-tdep.h > >>>>> ALLDEPFILES: Add microblaze-linux-nat.c > >>>> > >>>> gdb doesn't use ChangeLogs any more and this text should all be > removed. > >>>> > >>>>> +#define MICROBLAZE_TARGET_HAS_GETREGS 0 > >>>>> +#define MICROBLAZE_TARGET_HAS_SETREGS 0 > >>>> > >>>> This seems weird: > >>>> > >>>>> +/* Wrapper function around ptrace. */ > >>>>> + > >>>>> +static void > >>>>> +fetch_target_gp_regs (int tid, elf_gregset_t *gregs) > >>>>> +{ > >>>>> + elf_greg_t *gregp =3D *gregs; > >>>>> + > >>>>> +#if MICROBLAZE_TARGET_HAS_GETREGS > >>>>> + if (ptrace (PTRACE_GETREGS, tid, 0, (long) gregp) < 0) > >>>>> + { > >>>>> + perror_with_name (_("Couldn't get registers")); > >>>>> + return; > >>>>> + } > >>>>> +#error "this configuration did not work during testing" > >>>> > >>>> Normally we don't put new dead code into gdb. > >>>> > >>>> I think this and the defines could just be replaced with a comment > >>>> explaining that PTRACE_GETREGS doesn't work on this platform. > >>>> > >>>>> +++ b/gdb/microblaze-linux-tdep.h > >>>>> @@ -0,0 +1,24 @@ > >>>>> +/* Target-dependent code for GNU/Linux on MicroBlaze. > >>>>> + > >>>>> + Copyright (C) 2021-2026 Free Software Foundation, Inc. > >>>>> + > >>>>> + This file is part of GDB. > >>>>> + > >>>>> + This program is free software; you can redistribute it and/or > modify > >>>>> + it under the terms of the GNU General Public License as > published by > >>>>> + the Free Software Foundation; either version 3 of the License, = or > >>>>> + (at your option) any later version. > >>>>> + > >>>>> + This program is distributed in the hope that it will be useful, > >>>>> + but WITHOUT ANY WARRANTY; without even the implied warranty of > >>>>> + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > >>>>> + GNU General Public License for more details. > >>>>> + > >>>>> + You should have received a copy of the GNU General Public Licen= se > >>>>> + along with this program. If not, see < > http://www.gnu.org/licenses/>. */ > >>>>> +#ifndef MICROBLAZE_LINUX_TDEP_H > >>>>> +#define MICROBLAZE_LINUX_TDEP_H > >>>>> + /* Target descriptions. */ > >>>>> + extern struct target_desc *tdesc_microblaze_linux; > >>>> > >>>> Blank line between the #define and the comment. > >>>> > >>>> Also this define should have a slightly different name, see > >>>> check-include-guards.py. > >>>> > >>>>> non_stack_instruction_found =3D 0; > >>>>> + cache->register_offsets[rd] =3D -imm; > >>>>> continue; > >>>> > >>>> Indentation looks wrong, probably not using tabs. > >>>> > >>>>> @@ -399,8 +400,7 @@ microblaze_skip_prologue (struct gdbarch > *gdbarch, CORE_ADDR start_pc) > >>>>> { > >>>>> sal =3D find_sal_for_pc (func_start, 0); > >>>> > >>>>> - if (sal.end < func_end > >>>>> - && start_pc <=3D sal.end) > >>>>> + if (sal.line !=3D 0 && sal.end <=3D func_end && start_pc <= =3D > sal.end) > >>>>> start_pc =3D sal.end; > >>>> > >>>> No objection from me but this seems somewhat unrelated. > >>>> > >>>> > >>>>> /* Call for side effects. */ > >>>>> - get_frame_func (next_frame); > >>>>> + cache->pc =3D get_frame_func (next_frame); > >>>> > >>>> Please remove that comment as it is now wrong. > >>>> > >>>>> + if (regnum =3D=3D MICROBLAZE_SP_REGNUM) > >>>>> + regnum =3D 1; > >>>> > >>>> Wrong indentation. > >>>> > >>>>> + if (regnum =3D=3D -1) { > >>>>> + int i; > >>>>> + > >>>>> + for (i =3D 0; i < MICROBLAZE_REDR_REGNUM; i++) { > >>>>> + regcache->raw_supply (i, regs + i * MICROBLAZE_REGISTER_SIZE= ); > >>>>> + } > >>>> > >>>> Wrong brace placement in this hunk. > >>>> > >>>>> + cb (".reg", tdep->sizeof_gregset, tdep->sizeof_gregset, > tdep->gregset, NULL, > >>>>> + cb_data); > >>>> > >>>> Normally in new code we're using 'nullptr' now. Best would be to go > >>>> through the whole patch and check for this. You don't have to fix > >>>> pre-existing code that is using NULL though. > >>>> > >>>>> gdbarch *gdbarch > >>>>> =3D gdbarch_alloc (&info, gdbarch_tdep_up (new > microblaze_gdbarch_tdep)); > >>>> > >>>>> + microblaze_gdbarch_tdep *tdep > >>>>> + =3D gdbarch_tdep (gdbarch); > >>>>> + > >>>>> + tdep->gregset =3D NULL; > >>>>> + tdep->sizeof_gregset =3D 0; > >>>>> + tdep->fpregset =3D NULL; > >>>>> + tdep->sizeof_fpregset =3D 0; > >>>> > >>>> Here it would be better to just add inline initializers to the new > >>>> fields in microblaze_gdbarch_tdep. Then they'll automatically be > >>>> initialized by the 'new'. > >>>> > >>>> Tom > >>> > >> > > -- > Michael Eager > > --000000000000416f830653f0279a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

namaskaaram= =C2=A0

On Thu, Ju= n 11, 2026, 6:09 AM Michael Eager <eager@eagercon.com> wrote:
Hi Gopi --

I (or more accurately, git) fixed several whitespace issues.

Please share. I did c= heck all the whitespace issues flagged by git-diff.
=

Since this is a revised patch, has it been retested?
=


Y= es, it has been retested.

dhanyavaadaaha
gopi


On 6/1/26 10:05 PM, Gopi Kumar Bulusu wrote:
> namaskaaram
>
> Attached is the updated patch. All the changes suggested on PATCH v1 > have been made and tested.
>
> I did not remove the (sal.line !=3D 0) check as it seemed trivial.
> However, I can make that a separate patch if necessary.
>
> Our sysadm In the process of setting up a git compatible email - the > process may take more time; until then appreciate your patience with > the attachments.
>
> Important Note:
>
> 1) gdb appears to have an elaborate scheme to handle C++ exceptions > and "tunnel" them through exception unaware C code. This cod= e is with
> readline. Anytime
> an error is discovered (even a syntax error) by a module,
> gdb_exception_error() thrown is tunneled through readline using the > TRY_SJLJ/CATCH_SJLJ macros
> implemented using setjmp/longjmp.
>
> 2) There is an issue that I came across while testing; native gdb goes=
> into an infinite loop when handling errors. I analyzed it and found it=
> to be an obvious glibc
> sysdeps/unix/sysv/linux/microblaze/____longjmp_chk.S issue and
> reported it to AMD. It is possible I missed out a glibc patch; At this=
> time - this is not a gdb issue.
>
> 3) Plan to follow through [2] and ensure a gcc/glibc defect report is<= br> > created if needed.
>
> dhanyavaadaaha
> gopi
>
> On Tue, Jun 2, 2026 at 5:58=E2=80=AFAM Michael Eager <eager@eagerm.co= m> wrote:
>>
>> Please post an updated patch for review.
>>
>> On 5/31/26 11:38 PM, Gopi Kumar Bulusu wrote:
>>> On Fri, May 29, 2026 at 8:26=E2=80=AFPM Tom Tromey <tom@tromey.= com> wrote:
>>>>
>>>>>>>>> Gopi Kumar Bulusu <gopi@sankhya.com> writes:
>>>>
>>>>> Attached is a patch to add native linux support for gd= b including
>>>>> cache target support..
>>>>
>>>> Thanks for the patch.
>>>>
>>>> I read through it and have some nits.=C2=A0 There's no= thing very serious
>>>> except this:
>>>>
>>>>> The original sources for the patch come from Xilinx/AM= D Yocto git
>>>>> repository (2025.2)
>>>>
>>>> Who wrote them and are they covered by the copyright assig= nment?
>>>>
>>>> This is the most important consideration, the patch can= 9;t land without
>>>> this being clear.
>>>
>>> This work is being performed under a contract with Xilinx/AMD = as
>>> confirmed in a different response to
>>> Simon and therefore covered by the copyright assignment.
>>>
>>> I will make the changes as described below and retest.
>>>
>>> Approved for commit ?
>>>
>>> dhanyavaadaaha
>>> gopi
>>>
>>>>
>>>>>=C2=A0 =C2=A0From a3328b4cdfc58783b5f290f22255b36e26a6f= b14 Mon Sep 17 00:00:00 2001
>>>>> From: Gopi Kumar Bulusu <
gopi@sankhya.com>
>>>>> Date: Thu, 7 May 2026 17:47:40 +0530
>>>>> Subject: [PATCH] gdb/MicroBlaze: Add support for nativ= e linux gdb
>>>>
>>>> It's best to just git send-email rather than using an = attachment.
>>>>
>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0bfd/ChangeLog:
>>>>
>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0* elf32-microblaze.c (microb= laze_elf_grok_prstatus): New function.
>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(microblaze_elf_grok_= psinfo): Likewise.
>>>>
>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0gdb/ChangeLog:
>>>>
>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0* Makefile.in (HFILES_NO_SRC= DIR): Add microblaze-linux-tdep.h
>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ALLDEPFILES: Add micr= oblaze-linux-nat.c
>>>>
>>>> gdb doesn't use ChangeLogs any more and this text shou= ld all be removed.
>>>>
>>>>> +#define MICROBLAZE_TARGET_HAS_GETREGS 0
>>>>> +#define MICROBLAZE_TARGET_HAS_SETREGS 0
>>>>
>>>> This seems weird:
>>>>
>>>>> +/* Wrapper function around ptrace.=C2=A0 */
>>>>> +
>>>>> +static void
>>>>> +fetch_target_gp_regs (int tid, elf_gregset_t *gregs)<= br> >>>>> +{
>>>>> +=C2=A0 elf_greg_t *gregp =3D *gregs;
>>>>> +
>>>>> +#if MICROBLAZE_TARGET_HAS_GETREGS
>>>>> +=C2=A0 if (ptrace (PTRACE_GETREGS, tid, 0, (long) gre= gp) < 0)
>>>>> +=C2=A0 =C2=A0 {
>>>>> +=C2=A0 =C2=A0 =C2=A0 perror_with_name (_("Couldn= 't get registers"));
>>>>> +=C2=A0 =C2=A0 =C2=A0 return;
>>>>> +=C2=A0 =C2=A0 }
>>>>> +#error "this configuration did not work during t= esting"
>>>>
>>>> Normally we don't put new dead code into gdb.
>>>>
>>>> I think this and the defines could just be replaced with a= comment
>>>> explaining that PTRACE_GETREGS doesn't work on this pl= atform.
>>>>
>>>>> +++ b/gdb/microblaze-linux-tdep.h
>>>>> @@ -0,0 +1,24 @@
>>>>> +/* Target-dependent code for GNU/Linux on MicroBlaze.=
>>>>> +
>>>>> +=C2=A0 =C2=A0Copyright (C) 2021-2026 Free Software Fo= undation, Inc.
>>>>> +
>>>>> +=C2=A0 =C2=A0This file is part of GDB.
>>>>> +
>>>>> +=C2=A0 =C2=A0This program is free software; you can r= edistribute it and/or modify
>>>>> +=C2=A0 =C2=A0it under the terms of the GNU General Pu= blic License as published by
>>>>> +=C2=A0 =C2=A0the Free Software Foundation; either ver= sion 3 of the License, or
>>>>> +=C2=A0 =C2=A0(at your option) any later version.
>>>>> +
>>>>> +=C2=A0 =C2=A0This program is distributed in the hope = that it will be useful,
>>>>> +=C2=A0 =C2=A0but WITHOUT ANY WARRANTY; without even t= he implied warranty of
>>>>> +=C2=A0 =C2=A0MERCHANTABILITY or FITNESS FOR A PARTICU= LAR PURPOSE.=C2=A0 See the
>>>>> +=C2=A0 =C2=A0GNU General Public License for more deta= ils.
>>>>> +
>>>>> +=C2=A0 =C2=A0You should have received a copy of the G= NU General Public License
>>>>> +=C2=A0 =C2=A0along with this program.=C2=A0 If not, s= ee <http://www.gnu.org/licenses/>.=C2=A0 */
>>>>> +#ifndef MICROBLAZE_LINUX_TDEP_H
>>>>> +#define MICROBLAZE_LINUX_TDEP_H
>>>>> + /* Target descriptions.=C2=A0 */
>>>>> + extern struct target_desc *tdesc_microblaze_linux; >>>>
>>>> Blank line between the #define and the comment.
>>>>
>>>> Also this define should have a slightly different name, se= e
>>>> check-include-guards.py.
>>>>
>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0non_stack_inst= ruction_found =3D 0;
>>>>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 cache->register= _offsets[rd] =3D -imm;
>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0continue;
>>>>
>>>> Indentation looks wrong, probably not using tabs.
>>>>
>>>>> @@ -399,8 +400,7 @@ microblaze_skip_prologue (struct g= dbarch *gdbarch, CORE_ADDR start_pc)
>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 {
>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 sal =3D find_sal_for= _pc (func_start, 0);
>>>>
>>>>> -=C2=A0 =C2=A0 =C2=A0 if (sal.end < func_end
>>>>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0&& start_pc <= =3D sal.end)
>>>>> +=C2=A0 =C2=A0 =C2=A0 if (sal.line !=3D 0 && s= al.end <=3D func_end=C2=A0 && start_pc <=3D sal.end)
>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0start_pc =3D sal.end;=
>>>>
>>>> No objection from me but this seems somewhat unrelated. >>>>
>>>>
>>>>>=C2=A0 =C2=A0 =C2=A0 /* Call for side effects.=C2=A0 */=
>>>>> -=C2=A0 get_frame_func (next_frame);
>>>>> +=C2=A0 cache->pc =3D get_frame_func (next_frame);<= br> >>>>
>>>> Please remove that comment as it is now wrong.
>>>>
>>>>> +=C2=A0 if (regnum =3D=3D MICROBLAZE_SP_REGNUM)
>>>>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 regnum =3D 1;
>>>>
>>>> Wrong indentation.
>>>>
>>>>> +=C2=A0 if (regnum =3D=3D -1) {
>>>>> +=C2=A0 =C2=A0 int i;
>>>>> +
>>>>> +=C2=A0 =C2=A0 for (i =3D 0; i < MICROBLAZE_REDR_RE= GNUM; i++) {
>>>>> +=C2=A0 =C2=A0 =C2=A0 regcache->raw_supply (i, regs= + i * MICROBLAZE_REGISTER_SIZE);
>>>>> +=C2=A0 =C2=A0 }
>>>>
>>>> Wrong brace placement in this hunk.
>>>>
>>>>> +=C2=A0 cb (".reg", tdep->sizeof_gregset,= tdep->sizeof_gregset, tdep->gregset, NULL,
>>>>> +=C2=A0 =C2=A0 =C2=A0 cb_data);
>>>>
>>>> Normally in new code we're using 'nullptr' now= .=C2=A0 Best would be to go
>>>> through the whole patch and check for this.=C2=A0 You don&= #39;t have to fix
>>>> pre-existing code that is using NULL though.
>>>>
>>>>>=C2=A0 =C2=A0 =C2=A0 gdbarch *gdbarch
>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =3D gdbarch_alloc (&inf= o, gdbarch_tdep_up (new microblaze_gdbarch_tdep));
>>>>
>>>>> +=C2=A0 microblaze_gdbarch_tdep *tdep
>>>>> +=C2=A0 =C2=A0 =3D gdbarch_tdep<microblaze_gdbarch_= tdep> (gdbarch);
>>>>> +
>>>>> +=C2=A0 tdep->gregset =3D NULL;
>>>>> +=C2=A0 tdep->sizeof_gregset =3D 0;
>>>>> +=C2=A0 tdep->fpregset =3D NULL;
>>>>> +=C2=A0 tdep->sizeof_fpregset =3D 0;
>>>>
>>>> Here it would be better to just add inline initializers to= the new
>>>> fields in microblaze_gdbarch_tdep.=C2=A0 Then they'll = automatically be
>>>> initialized by the 'new'.
>>>>
>>>> Tom
>>>
>>

--
Michael Eager

--000000000000416f830653f0279a--