From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id zfAbLi89rV/FTAAAWB0awg (envelope-from ) for ; Thu, 12 Nov 2020 08:48:31 -0500 Received: by simark.ca (Postfix, from userid 112) id AE9D71F08B; Thu, 12 Nov 2020 08:48:31 -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 C69091E58E for ; Thu, 12 Nov 2020 08:48:30 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 54C91384A00F; Thu, 12 Nov 2020 13:48:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 54C91384A00F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1605188910; bh=OI22f+WDxad7hS/uWrpZtHJsR4IPaJR+VDawrY7ut3s=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=LekuCh7jJh0bCUpzYbwizKak/8WqMViOuUYau6vqEkWFTpfKvwZkxhGQWbNUrtUof QEMOxKI5tELVaBwrN+gDWvo5l8rL8r6P+h6xD/8MfzAk0M54ME8NMJVkkMoXzF8wvm WaZf+vfznh6aSc/soDOolZ3wQKJyA4DVcMPOGnvI= Received: from mail-ed1-x544.google.com (mail-ed1-x544.google.com [IPv6:2a00:1450:4864:20::544]) by sourceware.org (Postfix) with ESMTPS id 9FF623858006 for ; Thu, 12 Nov 2020 13:48:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 9FF623858006 Received: by mail-ed1-x544.google.com with SMTP id t11so6179629edj.13 for ; Thu, 12 Nov 2020 05:48:27 -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:mime-version :content-transfer-encoding; bh=OI22f+WDxad7hS/uWrpZtHJsR4IPaJR+VDawrY7ut3s=; b=fZdFHW9XeZd9YxrRDIHIAzwLo0xAQz5cIeSXDkWQhEB5cy4SS9DoHJ2kueyqVn3pPU GUyYPekQHyQoBuFmG9lpBtEtjkLDX6cS7aOXh2XkBiPffqUtYOpVwpg3iHj8iewItero yLLIrRdB3mapaoWBzE9CIoVcv1mwlE0zvDKvg4kSNJCXOCgeqYQyY4fXUpzE+jmQUcFd KJcnJm/aa3jFckuZY83XN9ge1DzBydUByKwE34Mz66PjH9nnl27CSO8TaI/ZrlsGydCA 8BxbwhzeNGPzzc9ctWxRm4IXSEmoZ1rn5uCyPq7CndGCn5lgBMa2E79sFWHuScCGUzXB p6xw== X-Gm-Message-State: AOAM5335TdBNWR7quZ5VLYN3O1z+a7JtbpUtOM6Gn0L+A1Y+4MmMoL5E pDBXmH+kscIeZCJHP6dIez98f1KJXrhScQ== X-Google-Smtp-Source: ABdhPJztLoLApyHZtt4g4jcRZlteJ8divPAB+8Rueq7kQmrSwChQg/kLIIa69rBZ4hOwzM9UakYQxw== X-Received: by 2002:a05:6402:144f:: with SMTP id d15mr5353810edx.300.1605188906353; Thu, 12 Nov 2020 05:48:26 -0800 (PST) Received: from atlantis.home ([2a03:1b20:3:f011::6d]) by smtp.gmail.com with ESMTPSA id j7sm2198617ejk.14.2020.11.12.05.48.25 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Nov 2020 05:48:25 -0800 (PST) To: gdb-patches@sourceware.org Subject: [PATCH 0/2] Add native GNU/Linux support for ARC in GDB Date: Thu, 12 Nov 2020 14:48:09 +0100 Message-Id: <20201112134811.9074-1-shahab.vahedi@gmail.com> X-Mailer: git-send-email 2.29.2 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 , Anton Kolesov , 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 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 | 321 +++++++++++++++++++++++++++++++++++++++++++ gdb/arc-linux-tdep.c | 41 ++++-- gdb/configure.host | 3 + gdb/configure.nat | 4 + 5 files changed, 361 insertions(+), 9 deletions(-) create mode 100644 gdb/arc-linux-nat.c -- 2.29.2