From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id Xsx9BzapGWqSHicAWB0awg (envelope-from ) for ; Fri, 29 May 2026 10:56:54 -0400 Authentication-Results: simark.ca; dkim=fail reason="signature verification failed" (768-bit key; unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=T7SNsnbD; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 0AB1B1E062; Fri, 29 May 2026 10:56:54 -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.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,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 vm01.sourceware.org (vm01.sourceware.org [38.145.34.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 DFDED1E062 for ; Fri, 29 May 2026 10:56:52 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 11DA44BA79AD for ; Fri, 29 May 2026 14:56:52 +0000 (GMT) Received: from omta36.uswest2.a.cloudfilter.net (omta36.uswest2.a.cloudfilter.net [35.89.44.35]) by sourceware.org (Postfix) with ESMTPS id B96194BA2E25 for ; Fri, 29 May 2026 14:56:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B96194BA2E25 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B96194BA2E25 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=35.89.44.35 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780066601; cv=none; b=JZSBdD9GasQ47XB1qYBmBuKFMsqF1qR41DZ5RJ1RuU7mZ8hU1KsSOiWB2Dn0oPS9ZAmTuBTKAHQ/KLpUYQ/Sd6Q8jm/jdYa1YZkOpLRTNl8g+8co+eA7vMscZAFftYC1YBvpme0YLWp5d+Edmd+KRxaA4IfuIXn8wrjMRgEmaN4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780066601; c=relaxed/simple; bh=izSO2ueDrLXOkb6/NtAWDYdfAgrNRT8lkTl12oyjrDY=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=KmjbOMnN3iM0zu4piDNXK/m7J4EWoqA15+0TKUOA9z76COJCJiodqnnrFM8+LvPkg2yeZo4ZzRTG3OSIgcrBVq44PJWMhM/7VJiQZixsBhSMLMbdVDc3ypskhBaNYut+3CdmjjRlzZkzYy99eh7VFPntJGWST1BHBDxdmWoYsy0= ARC-Authentication-Results: i=1; sourceware.org; dkim=policy (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=T7SNsnbD reason="signing key too small" DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B96194BA2E25 Authentication-Results: sourceware.org; dkim=policy reason="signing key too small" (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=T7SNsnbD Received: from eig-obgw-5004b.ext.cloudfilter.net ([10.0.29.208]) by cmsmtp with ESMTPS id Ss8RwjR2bPpWVSydbwppAm; Fri, 29 May 2026 14:56:39 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id SydawTziCnfJUSydbwyD4S; Fri, 29 May 2026 14:56:39 +0000 X-Authority-Analysis: v=2.4 cv=KajSsRYD c=1 sm=1 tr=0 ts=6a19a927 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=NGcC8JguVDcA:10 a=ItBw4LHWJt0A:10 a=mDV3o1hIAAAA:8 a=E6ZecXN6AAAA:8 a=oQUtHoSwsWee-Wso1bUA:9 a=LGaSgpbYh3Ydf5_0dFZ6:22 a=DCx65vhANUyCzuf5D8fC:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To :Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=pDz5irvXLwLfXWRwfAuX7XmbNPjPZx37F5lVy3TBges=; b=T7SNsnbDh2YRU3RmgaM+Ur9h+F W5w8yl19S17sHpYZXttTvloWEGlcd2Pd9c620jacVNLF22fonWN3OpGBC2FEzaMRzY2Bnx/Lp86hy omGGjjntMqDgETgdUhKpwkv5+; Received: from 75-166-225-82.hlrn.qwest.net ([75.166.225.82]:51282 helo=bapiya) by box5379.bluehost.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.99.2) (envelope-from ) id 1wSyda-00000003Hys-1eOi; Fri, 29 May 2026 08:56:38 -0600 From: Tom Tromey To: Gopi Kumar Bulusu Cc: binutils@sourceware.org, gdb-patches@sourceware.org, Michael Eager Subject: Re: [PATCH] gdb/MicroBlaze: Add support for native linux gdb In-Reply-To: (Gopi Kumar Bulusu's message of "Tue, 26 May 2026 17:02:42 +0530") References: X-Attribution: Tom Date: Fri, 29 May 2026 08:56:37 -0600 Message-ID: <874ijq5knu.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 75.166.225.82 X-Source-L: No X-Exim-ID: 1wSyda-00000003Hys-1eOi X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 75-166-225-82.hlrn.qwest.net (bapiya) [75.166.225.82]:51282 X-Source-Auth: tom+tromey.com X-Email-Count: 5 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfM5KVa7cpZZkmxD0rldPhV3WWX5S+B9e1GW5q+Vx3g1njsN9cK9GQfFbZLzF9xBX1N8Gwan5R7Ty4ycEAndsRsMrRDZcuYkWXJLH5jSuFIrLcGs9YsxT 2+ynEzyavT9Hf/2iMNbhBqyfMc6vDV8IfNuzI696yOvSeQ0gcnwLrd1sb3tae42r7C+ba3u6hlP0/scE6E2FSvGDbYuckWwRNGg= 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 >>>>> 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. > 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 = *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 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 = 0; > + cache->register_offsets[rd] = -imm; > continue; Indentation looks wrong, probably not using tabs. > @@ -399,8 +400,7 @@ microblaze_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR start_pc) > { > sal = find_sal_for_pc (func_start, 0); > - if (sal.end < func_end > - && start_pc <= sal.end) > + if (sal.line != 0 && sal.end <= func_end && start_pc <= sal.end) > start_pc = sal.end; No objection from me but this seems somewhat unrelated. > /* Call for side effects. */ > - get_frame_func (next_frame); > + cache->pc = get_frame_func (next_frame); Please remove that comment as it is now wrong. > + if (regnum == MICROBLAZE_SP_REGNUM) > + regnum = 1; Wrong indentation. > + if (regnum == -1) { > + int i; > + > + for (i = 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 > = gdbarch_alloc (&info, gdbarch_tdep_up (new microblaze_gdbarch_tdep)); > + microblaze_gdbarch_tdep *tdep > + = gdbarch_tdep (gdbarch); > + > + tdep->gregset = NULL; > + tdep->sizeof_gregset = 0; > + tdep->fpregset = NULL; > + tdep->sizeof_fpregset = 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