From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id FfC1GrspHWr0Ji0AWB0awg (envelope-from ) for ; Mon, 01 Jun 2026 02:42:03 -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=wSUaISDC; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 4B54A1E0A3; Mon, 01 Jun 2026 02:42:03 -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,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham 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 AFC761E062 for ; Mon, 01 Jun 2026 02:42:01 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 701064BA2E0F for ; Mon, 1 Jun 2026 06:41:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 701064BA2E0F 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=wSUaISDC Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by sourceware.org (Postfix) with ESMTPS id 16F784BA2E15 for ; Mon, 1 Jun 2026 06:41:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 16F784BA2E15 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 16F784BA2E15 Authentication-Results: sourceware.org; arc=pass smtp.remote-ip=2a00:1450:4864:20::632 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1780296087; cv=pass; b=aoVrSKeO1ojp/QSRGG97VJGyMgI+t+bHtM0f8zrgecqz+hMMP9OBlveVHRnWYTT1nByKB0iGaDMFn4XV5qDMu0uCFWbGgpi4+f5mJimrBu89U87k8qGK5cygk7eIgaJSI+3WKhezEf3OqWqG5kiWVzyPvV3Zl+jq3Cf5Gx3lKEw= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1780296087; c=relaxed/simple; bh=V86/lVDn1APB7fkZS1BkEYdAu9hifLLwlQf6J40aVDI=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=XdzIJ7Gx0dR9cvhoHvoSm0vituv8BEYTMutfjPEAqyotSktL2RdFvPuDAcyMFsob1RdIh4E4kIZePTNMWw20669TDoph+DblH+sXIkJcYMPVTitCxmC/clykOWVXYg5CRjVDlWgs3QdlpG6NRI1W67jCW0Zbzy36FdBOPDFGMWU= 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=wSUaISDC DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 16F784BA2E15 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-bec423a5265so184573666b.1 for ; Sun, 31 May 2026 23:41:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1780296086; cv=none; d=google.com; s=arc-20240605; b=VizkniTVgwN5Z3eW6yIkhdY8CHkgE9Ay1kB4jazNfEGa7/2tLPpv05XVaHQsghOy60 cxhvLBr/tejEEjflwBx9wp9Gexq3t7KZAHSnEKo08X+IQkRe62G/jJnKgFcEKhzKXo2m 8nQop83/QDnrTDbA4VbIgQM8xU0L5gyzcJzvdrgie3wwQUTDrEr7mbrf2KJJ3/zsp0kK xkcmxtgBJRe7Yw7fAhR6Y0IESHeu1u+TjlkSxbyvp83ktVQyqobWd1P+T6Q0L8G0ly73 ICq6pwUoTmTG4eg3HcNKLtoENHQ61t8VSvKVyxUO5iPSGWQEOarjL1AuuvRsp6h91hCN y2qA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=O9hoMptS4/Fchb9AliOHP7+sx6ktQVTHbJk3/SCGg2g=; fh=nz7HxvfrugSWMrJAlFDSS7NEbG1X9a7s9h6e2dGvXoE=; b=WP62bQjviz9WOBWaVvY+cp6hwhdysmBMCgW1cAGx4OApZyeS7lqfWwFIW65FQuFz8U WE47s1OeD4xIQHudUmlNQYpCNEUFlp7S4zTLfiSuSJAgDxrxB4y5Ok1IhpW6JVBMfXLG 1FbMpGFcuWCkeYUArPh+z8p5tLEc3/l9u5ca6usduKXv+p6UlKXxtO3JChNosSTholOO yUE/ikZGhfJihxyeGQzzvh6cF7UyK0Ewnx0BrDw0SZ+V/DfhKqdjSGFned4WOczdoqqE K3bF6ji8Jd/opOu3bUU0orJQKF9JbnO2aEHne/tS8okxPY2eFpUjW17hpJZ4kzpGziiH zF/A==; 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=1780296086; x=1780900886; darn=sourceware.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=O9hoMptS4/Fchb9AliOHP7+sx6ktQVTHbJk3/SCGg2g=; b=wSUaISDC2wHk1mS6V1+L2vtEEl5FZRaws7EQgwBJD17pKofBeBtKYKBMM7voT3bDD4 Ry/RqGoUPAVIcEVFa8vDAe+mbxymdEhwibRzeUZmhXlzgVd+M02F4e0kA+omItf5bJF/ 04DvkAf94IwzN8BhYdXe7oBiHAoV0XNRjPWhQbKlqIDTmgi274JGcEidO9UIuP63CXHk z7LazkdVyG7sPvYK7SpkS7f4j5xqdfPVJS6vP3SIk2NqVGxva2mKVgp3iRZVJkqe/3r/ 3B1uC5y2YGRUYBAPSlK1MeX3dQ9oP3+XELDY0OS4AUOlQSdzmKp111kHj0ZWBS0KhhX9 oNKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780296086; x=1780900886; h=content-transfer-encoding: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=O9hoMptS4/Fchb9AliOHP7+sx6ktQVTHbJk3/SCGg2g=; b=Y8HQr3tZMO9d/DlWOuYupUn7ECfy91Vg028gu7iPrf0f7POmGonVcCQHo7FQA7h/qv dhPfjCE0VWyQ5MhlYHOhp8+tyfgY1H18W9/HQCqBQ7/P7Vk/sRzV/7uLe3XOhshdHPb/ C/e/Pwr0FksDIz3/iWvnW8zCZysSTCKfsWOFVn37qmwv69mLAq7ANHcEDob8Vpx003Sy aOb70IDQDS1JxfxC46jJ+H5bRV4pSeGEq1KT9uqnsshL0iJrphWkDIZ/4WMbE2i7vxZm rgMrqee3DGbS9i24hpu83l9T6CfK9Pk7sWRZR/wvs3wEuVu8W4ktf1NLUM5b0SG5ajIV Pf1A== X-Forwarded-Encrypted: i=1; AFNElJ9MWU7tJwJ1lYB8cM7sAa/ogLQrF1DfdYfaxSLnYmpw7DgcbPdsdRXR5Lv9EMD2fzynh6AmOLQk80tfyw==@sourceware.org X-Gm-Message-State: AOJu0YzIasnjcgfY/nzG7zTIMST9nn3K00H2R5jqeg/4ILJCHf7A8TcL C1k1PT6gsA5TsdNy7p/5xWq03ICcq5pHb8QsTd6B0TqjL2BaDI8sCmdfywffL5cb3gFeMJggUjj SEPRxaxq5IjXTVdFLJXgcUzFCQY3iacrmwDCALZEpKPAEp8Wc43eMbnM= X-Gm-Gg: Acq92OEFq0ZyCTJP4wnNNeDNqg+3c7jLE4KBsvuHpBOlaUlgcx8gkS6mxbJavSV66YP R539uqMBHUTZ637v1JaW52MFzHzahtIqtolTr527Ccruf9BN3h02DrYoWc5nHDXGW47M5PYpyK6 yWOFNFwDvUW5UR12jVHogaiX2ekuh0aC8013dsNamNX/4vjMUnbfx9bvFSk7lYr7Nk85Nk7aQJZ lMmwLeznW8cTi8q/3M0miDZaueEhs+iNcOBLIp2BqYDOO1XNzS/14NeuaAU+5ODpvloQ3NjgfBJ DE0rWmsGB3NSsfwYXGH8dpeofrfmMFDSw5PVO4mlF+DLSD1o0mdruj2hrP5E8SIRijYl2weyqAO XXWojKCyszUqmu85cG5XMrHIplT92cWZvwXTd6/AmcCUegjNPHQOqq/LYc4JCo+9C+PcJKPylnw == X-Received: by 2002:a17:906:2081:b0:beb:2de3:1ba1 with SMTP id a640c23a62f3a-beb2de3249amr251616366b.11.1780296085955; Sun, 31 May 2026 23:41:25 -0700 (PDT) MIME-Version: 1.0 References: <874ijq5knu.fsf@tromey.com> In-Reply-To: <874ijq5knu.fsf@tromey.com> From: Gopi Kumar Bulusu Date: Mon, 1 Jun 2026 12:08:46 +0530 X-Gm-Features: AVHnY4ITrtsxci5f_Q3vPNcQNRPyKV3WKzr2g-1ruJjz2zEYLU2xlSccnABPb2A Message-ID: Subject: Re: [PATCH] gdb/MicroBlaze: Add support for native linux gdb To: Tom Tromey Cc: binutils@sourceware.org, gdb-patches@sourceware.org, Michael Eager Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 On Fri, May 29, 2026 at 8:26=E2=80=AFPM Tom Tromey wrote: > > >>>>> 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 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 > > > 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 modif= y > > + it under the terms of the GNU General Public License as published b= y > > + 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 License > > + along with this program. If not, see . */ > > +#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 s= al.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->gregse= t, 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