From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id R4L3D19azl+LSQAAWB0awg (envelope-from ) for ; Mon, 07 Dec 2020 11:37:51 -0500 Received: by simark.ca (Postfix, from userid 112) id 3964D1F071; Mon, 7 Dec 2020 11:37:51 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from 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 RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 6567B1EF4B for ; Mon, 7 Dec 2020 11:37:50 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 21D0E3896C3B; Mon, 7 Dec 2020 16:37:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 21D0E3896C3B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1607359070; bh=IVl/MWGPXfsCpOG58heYNH0tOs8faWp9BkTl9mP8l+s=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=fgbend3Al+vMm1aYwrNRIcq93xrE7s61dIH/J3m/Fj/AXPMU+d1SroiJXk15sxviv af9CdpVlcWmai2P8OpOdoJ4UkPwnhohVV5Jiw4wrD0/yW6Gfk55KKoeGGo1p8TCylO Jy4A27JmRQTBwr588hadZzCQUxFGx6iqACY266D0= Received: from mail-ed1-x543.google.com (mail-ed1-x543.google.com [IPv6:2a00:1450:4864:20::543]) by sourceware.org (Postfix) with ESMTPS id 7B7F93851C33 for ; Mon, 7 Dec 2020 16:37:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7B7F93851C33 Received: by mail-ed1-x543.google.com with SMTP id cm17so14427731edb.4 for ; Mon, 07 Dec 2020 08:37:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IVl/MWGPXfsCpOG58heYNH0tOs8faWp9BkTl9mP8l+s=; b=KN3mK4Yc9Jh471jgweMx+X1sK+dPa8f8IARqj2IJX1K3d8Z9oXkMTPP6Zx5GonsYhI +M6j6iuCNfEGsr33yrHafoNaJ1+y401D/VaXROFCwmGjgOFa60PwedMT4dfFY086hVbr xq3Tb+jk1tAF56MHFe4hqW6l2QjBfRi2C056gsotmBc4r1vcNFhZoH1lSaJw1KS1FPxm 1ML1Z7xAN/rcgyzhQxfvJHHUg3rXWLbPATgir3zjV9LbNskHsd9agJLjdLaxd+7qUhpn VmS1DijCws+IeQbC5jiQfcTyyU8szjC3OSwdW/GJ+PRb8AmEb3svxe5CT6lixMyge15g eWmA== X-Gm-Message-State: AOAM532KA29Pwyjg2qS0R4w6/I2eL9cEgXzBz675/6YtEXGsCrc1dzT6 a8KuKszhXOuCCzxtWMvGWteZmrsQFBXC9cLgTic= X-Google-Smtp-Source: ABdhPJwlDJJpP+vIltRQIu+LNPBSC02vd8O9eF8SMFOfoOWEhuw+OulH98XX7pLKLg1pY4ovZ094vg== X-Received: by 2002:a05:6402:c95:: with SMTP id cm21mr14976511edb.294.1607359066214; Mon, 07 Dec 2020 08:37:46 -0800 (PST) Received: from atlantis.home ([2a03:1b20:3:f011::6d]) by smtp.gmail.com with ESMTPSA id a10sm12052682ejk.92.2020.12.07.08.37.45 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Dec 2020 08:37:45 -0800 (PST) To: gdb-patches@sourceware.org Subject: [PATCH v2 0/2] Add native GNU/Linux support for ARC in GDB Date: Mon, 7 Dec 2020 17:37:38 +0100 Message-Id: <20201207163740.9128-1-shahab.vahedi@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201112134811.9074-1-shahab.vahedi@gmail.com> References: <20201112134811.9074-1-shahab.vahedi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Shahab Vahedi via Gdb-patches Reply-To: Shahab Vahedi Cc: Shahab Vahedi , Shahab Vahedi , Tom Tromey , Francois Bedard Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" From: Shahab Vahedi This patch series is mainly about adding a native GNU/Linux support for ARC in GDB ("[PATCH 2/2] gdb: Add native support for ARC in GNU/Linux"). During the process of mulling over that change, I noticed that the ARC target support could become more efficient in some of the target hooks in "arc-linux-tdep.c"; namely the "arc_linux_supply_*()" and the "arc_linux_collect_v2_regset()". In those hooks, REGNUM is completely ignored and every register is fetched/overwritten. These hooks are used by the "arc-linux-nat.c" (the second patch) and it relies on them: Therefore, the first patch of this series: "[PATCH 1/2]: arc: Take into account the REGNUM in supply/collect gdb hooks". To summarize: [PATCH 1/2] -> Respect REGNUM in hooks. [PATCH 2/2] -> Add native ARC GNU/Linux support while using those hooks. One last remark: The native GDB works correctly along with this fix [1]. Therefore, if you want to give it a try, please also apply that patch. [1] [PATCH] arc: Write correct "eret" value during register collection https://sourceware.org/pipermail/gdb-patches/2020-November/173202.html How to build: Get the "Linux/{glibc,uClibc} ARC HS" toolchain from: https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain/releases and extract it somewhere. Update the PATHs so you can find "arc-linux-gcc": $ export PATH=/extracted/dir/bin:$PATH $ export LD_LIBRARY_PATH=/extracted/dir/lib:$LD_LIBRARY_PATH $ cd /to/gdb/src $ host=arc-snps-linux-gnu # or arc-snps-linux-uclibc $ configure --prefix=/usr \ --host=$host \ --disable-build-with-cxx \ --disable-gas \ --disable-ld \ --disable-binutils $ make -j $(nproc) $ arc-linux-strip ./gdb/gdb v2: Because there was only some remarks about the second patch in this series, that is the one that has been reworked. Look at its commit message to see what has exactly changed. Anton Kolesov (1): gdb: Add native support for ARC in GNU/Linux Shahab Vahedi (1): arc: Take into account the REGNUM in supply/collect gdb hooks gdb/Makefile.in | 1 + gdb/arc-linux-nat.c | 320 +++++++++++++++++++++++++++++++++++++++++++ gdb/arc-linux-tdep.c | 41 ++++-- gdb/configure.host | 3 + gdb/configure.nat | 4 + 5 files changed, 360 insertions(+), 9 deletions(-) create mode 100644 gdb/arc-linux-nat.c -- 2.29.2