From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x541.google.com (mail-ed1-x541.google.com [IPv6:2a00:1450:4864:20::541]) by sourceware.org (Postfix) with ESMTPS id 04021385EC56 for ; Tue, 25 Aug 2020 15:47:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 04021385EC56 Received: by mail-ed1-x541.google.com with SMTP id l23so11644856edv.11 for ; Tue, 25 Aug 2020 08:47:10 -0700 (PDT) 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=heWFd+IaaAfWtIxrxHcWR0TJWHhUwbHj8foJlLZtWk4=; b=fnLKxdYdjsvjYMfE/kknTJZEiIpi+KH5UK79GtKKUsHtQauF1fU0+AprzK6IBHJVSo ZJbZYk0iHnQp6nJ0Sn6B7NtKD8ZIiomwpgEvrgpYVerflVXPPojasqdR6r9Q55Uybr29 Uj9Fc/o7JG1FuVCwnD65UDSMhaJbpZma1dU5la93sPncsnBMsmzEp79SllRO5S2h5cG3 xDWJDYUF7NQvV96S7akoigntGzjk+hRAO/10fm9gftUVRPmBzIE60YDb3fT/ox2dXwuH GJYgUrf+qUiotJk0X310nxE3WOQ/5OaaJLqYUZ1BCmj5RYDabk744dAoDPCnJj50SOsv 5ZcQ== X-Gm-Message-State: AOAM531yxUB6t396gDFDhj6TBFqRhokNxive/RDy0wZ0L9rDt/MUv2D9 zu7wabaz914hwks/0PfzbxbqjSDhIQ6NEfwA X-Google-Smtp-Source: ABdhPJxZoSuK4H0AuZ0dmv0UhrELaT/MdwskLovFNrGqZ6Uul8OIyGsxhtUW7WM4LmVEBL1bUpWvPw== X-Received: by 2002:a50:93a2:: with SMTP id o31mr11093751eda.203.1598370429720; Tue, 25 Aug 2020 08:47:09 -0700 (PDT) Received: from atlantis.home ([2a03:1b20:3:f011::6d]) by smtp.gmail.com with ESMTPSA id yh29sm13091713ejb.0.2020.08.25.08.47.08 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Aug 2020 08:47:08 -0700 (PDT) From: Shahab Vahedi To: gdb-patches@sourceware.org Cc: Shahab Vahedi , Shahab Vahedi , Simon Marchi , Tom Tromey , Eli Zaretskii , Anton Kolesov , Francois Bedard Subject: [PUSHED 0/4] arc: Add GNU/Linux support Date: Tue, 25 Aug 2020 17:47:00 +0200 Message-Id: <20200825154704.29312-1-shahab.vahedi@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200326125206.13120-1-shahab.vahedi@gmail.com> References: <20200326125206.13120-1-shahab.vahedi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org 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: , X-List-Received-Date: Tue, 25 Aug 2020 15:47:12 -0000 From: Shahab Vahedi This is a series of changes to enable debugging ARC targets that are running on a native ARC GNU/Linux system. Since this heavily relies on XML target descriptions provided for different targets, that piece of code has been refactored to accommodate flexible register support. After this series, there will come patches that add support for native ARC gdb/gdbserver. v6: Add backward compatibility for obsolete feature names arc-tdep.c: - "find_obsolete_[core,aux]_names()" implemented gdb/NEWS: - Updated with information about these feature name changes. v5: Changes per remarks of Simon [1] and on my own (documentation and tests) arc.h: - Made "reg_size" and "isa" constant in "arc_gdbarch_features". arc.c: - Fix some malformed indentations. arc-tdep.h: - Inclusion of "gdbarch.h" has its own patch now. arc-tdep.c - Use "nullptr" instead of "NULL". - Remove unnecessary "break"s after "return"s. - "determine_core_reg_feature_set" will assert if wrong input is given. - Removed dangling comment. - Replaced "const auto *" with "const auto" to be consistent. - in "arc_check_for_hw_loops()": No "nullptr" check for "aux_regset". arc-linux-tdep.c - Remove unnecessary empty lines. - Replace "breakpoint uses" with "breakpoints use" in a comment. - "return condition;" i.s.o. "if (condition) return true; else return false;" gdb.texinfo - Update documentation regarding the new feature files. arc-tdesc-cpu.xml - Use new feature names. [1] Simon's remarks to v4 of the patches https://sourceware.org/pipermail/gdb-patches/2020-July/170975.html https://sourceware.org/pipermail/gdb-patches/2020-August/170993.html https://sourceware.org/pipermail/gdb-patches/2020-August/170994.html v4: Latest changes per remarks of Simon [2] arc-tdep.c - Surround "=" in 2 assignments with space. - Put the return type of "mach_type_to_arc_isa ()" on the first line. - Remove "inline" from "mach_type_to_arc_isa ()". - Add space between the "if" conditions for readability. - Use "featues.isa" instead of "features.reg_size" in one occurrence. - Make "arc_gdbarch_features_init" static - Rename "arc_gdbarch_features_init" to "arc_gdbarch_features_create". - Adapt "arc_gdbarch_features_create" to act as a constructor. arch/arc.c - Add a constructor for "arc_gdbarch_features". - Get rid of "ARC_ISA_NONE" now that there is a constructor. arch/arc.c - Use simple assignments (instead of append) for "architecture". - Use "string_sprintf ()". - Use "target_desc_up" in "arc_tdesc_cache" to avoid memory leakage. arc-linux-tdep.c - Two occurrences: compare "resolver.minsym" against "nullptr". [2] [PATCH v3 1/3] arc: Add ARCv2 XML target along with refactoring https://sourceware.org/pipermail/gdb-patches/2020-July/170427.html v3: Changes after Simon's remarks: The XML files have reduced to minimal comprehensible set. The code is adjusted to work with new reg sets and be platform agnostic. v2: Changes after Tom's remarks: arc-tdep.c - arc_tdesc_init(): Use "ARC_{R58,R59}_REGNUM" to index "core_regs[]". - arc_gdbarch_init(): Use "xfree ()" instead of "XDELETE ()" - arc_gdbarch_init(): return "nullptr" instead of "NULL". - Use explicit number evaluation, e.g: if (a & b) -> if ((a & b) != 0) arc-linux-tdep.c - Use true/false instead of TRUE/FALSE. - arc_linux_sw_breakpoint_from_kind (): Break long lines into two. - arc_linux_sw_breakpoint_from_kind (): Remove starting blank line. - Use explicit number evaluation, e.g: if (a & b) -> if ((a & b) != 0) gdb/configure.tgt - arc*-*-linux*): Remove "build_gdbserver=yes". Anton Kolesov (1): arc: Add GNU/Linux support for ARC Shahab Vahedi (3): arc: Add ARCv2 XML target along with refactoring arc: Add inclusion of "gdbarch.h" in "arc-tdep.h" arc: Add hardware loop detection gdb/ChangeLog | 49 ++ gdb/Makefile.in | 1 + gdb/NEWS | 5 + gdb/arc-linux-tdep.c | 278 +++++++ gdb/arc-tdep.c | 694 ++++++++++++------ gdb/arc-tdep.h | 27 +- gdb/arch/arc.c | 108 ++- gdb/arch/arc.h | 79 +- gdb/configure.tgt | 5 + gdb/doc/ChangeLog | 9 + gdb/doc/gdb.texinfo | 76 +- gdb/features/Makefile | 8 +- .../arc/{aux-arcompact.c => v1-aux.c} | 9 +- .../arc/{aux-arcompact.xml => v1-aux.xml} | 7 +- .../arc/{core-arcompact.c => v1-core.c} | 8 +- .../arc/{core-arcompact.xml => v1-core.xml} | 4 +- gdb/features/arc/{aux-v2.c => v2-aux.c} | 9 +- gdb/features/arc/{aux-v2.xml => v2-aux.xml} | 5 +- gdb/features/arc/{core-v2.c => v2-core.c} | 7 +- gdb/features/arc/{core-v2.xml => v2-core.xml} | 7 +- gdb/testsuite/ChangeLog | 4 + gdb/testsuite/gdb.arch/arc-tdesc-cpu.xml | 4 +- 22 files changed, 1048 insertions(+), 355 deletions(-) create mode 100644 gdb/arc-linux-tdep.c rename gdb/features/arc/{aux-arcompact.c => v1-aux.c} (73%) rename gdb/features/arc/{aux-arcompact.xml => v1-aux.xml} (80%) rename gdb/features/arc/{core-arcompact.c => v1-core.c} (87%) rename gdb/features/arc/{core-arcompact.xml => v1-core.xml} (92%) rename gdb/features/arc/{aux-v2.c => v2-aux.c} (76%) rename gdb/features/arc/{aux-v2.xml => v2-aux.xml} (86%) rename gdb/features/arc/{core-v2.c => v2-core.c} (91%) rename gdb/features/arc/{core-v2.xml => v2-core.xml} (90%) -- 2.28.0