From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id /6qlN/lnBWcQRQYAWB0awg (envelope-from ) for ; Tue, 08 Oct 2024 13:12:25 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=UK6b4DQ4; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id CDAA01E355; Tue, 8 Oct 2024 13:12:25 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-7.8 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL, RCVD_IN_VALIDITY_SAFE,URIBL_BLOCKED,URIBL_DBL_BLOCKED_OPENDNS autolearn=ham autolearn_force=no version=4.0.0 Received: from server2.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 ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 0E9D91E05C for ; Tue, 8 Oct 2024 13:12:25 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8EF10384DED0 for ; Tue, 8 Oct 2024 17:12:24 +0000 (GMT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id 0F3E43861039 for ; Tue, 8 Oct 2024 17:11:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0F3E43861039 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 0F3E43861039 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1728407517; cv=none; b=vg7XpOIOaWgnvjf4O9vRi2spTF2Irq3Fqp839cYLZCMwy0x7b866lBsWPvOsf7cHZ1aCL+K23RRJSrr8DwAsiR5UGgUK66hI1pAtUhfIwB9iM9judDri7iJz7B6Toi1tDKu5AgUm4pZRMtCN8eEiRPW3EVT4X7gY9tUWHXyt6EU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1728407517; c=relaxed/simple; bh=XLGM4HcAGGDD1Buns+oY1yuJxlQp/KA+jXRjoK66gkU=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=d0RR6j1hTkRfBRaVTRpojkoe4uXFnpvsrPqUShv6X+wZyfiFBqzVIaNFk1lLVJzzI9/tA/4txXe0wreNo7WdBmEOXtPUVm/NXlOc3McPZOKqotvuQXN1rbEaonx3CW/5sRkipO8sRTXn+W41N3xzvsOwcsrz4mS+RMnx/cREtVE= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728407515; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kkO4mrrW4sLR19Gt5O2lRtAR2KgZFtEdei9qAYvQPQs=; b=UK6b4DQ4nBahLcR1WI2EnYBp6BejdoO+lj5qBO+HB6zzagiIBHc2gKKpZaoBbkJwfgvVph zrDWAMVJqZivRfd1M1XOkO3y9TvZI7okYNctTymrjQJ1W974kFpbbYFyFsUaYhw2Hljrbu BS1784ltoEdYRWdmNa/1kXEYh7W4Jwo= Received: from mail-lj1-f197.google.com (mail-lj1-f197.google.com [209.85.208.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-537-48y53gjiNlmTaOdGq-ce2g-1; Tue, 08 Oct 2024 13:11:54 -0400 X-MC-Unique: 48y53gjiNlmTaOdGq-ce2g-1 Received: by mail-lj1-f197.google.com with SMTP id 38308e7fff4ca-2faea3961a3so42647201fa.2 for ; Tue, 08 Oct 2024 10:11:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728407513; x=1729012313; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kkO4mrrW4sLR19Gt5O2lRtAR2KgZFtEdei9qAYvQPQs=; b=kOPbtzXkZ9ecAC+hu+zI71CnoZyuZ+/24eteZJJe4k/RKIGGh9bV+oyqf3lDh40lu3 9JhzKxbdpQhkbfdZyvFKKdt6x6ud92dlgoN8Ov+yu+7FJrXoSfYogKsQFOekJbcg5wbE E2RxM8E7+W3V2YY+TuM9VWemB7HIOxx8pAeNcG0XOsPJDLvusbFY4K19Vf1AX0l3S58y Mhanbcyua6Q3SEj/hSCgNQtQ574z1bSzZLgOTYne0OKNZVcVR08E+zoPfuvXU/PzYAJV y1fWaTLI2/nQiXZfWnh20kcke33xwQZsPFgIfZgKBS4P93W3sPV3VVKV/XdNTfQXt6zr X3mA== X-Gm-Message-State: AOJu0YwS6/oJwLJuitqV/CjZOyMR5l5tp/9NkhCqyaC9gwB99nrgGhRZ zO1im2xkp6P/L2bauNLujjLh2sYJG2arlfiCCqIUisLEjsFNwEsC9pupVVHp/wW8FA2EatL7XG3 5dcHnyGFpEu7MiqR6vEbOKgDF5wLamumwZopd6MMAf/aZqUNIeCexxI75hhzyO/a9EUtXz8iX+b ZRRO1cBnMB8YSHI7PcU4LPntl0F3ynLu0ZnfBtCSq6ojQ= X-Received: by 2002:a2e:e11:0:b0:2f9:c337:aca9 with SMTP id 38308e7fff4ca-2faf3d8e286mr62715851fa.44.1728407512873; Tue, 08 Oct 2024 10:11:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGdC46fD2/Zaa31L4qgdJ6YreJB3ZltOZvchKbYKfzsMWOg3Dc17lOjto7Z3LwAX3NjctfqxA== X-Received: by 2002:a2e:e11:0:b0:2f9:c337:aca9 with SMTP id 38308e7fff4ca-2faf3d8e286mr62715691fa.44.1728407512262; Tue, 08 Oct 2024 10:11:52 -0700 (PDT) Received: from localhost ([195.213.152.26]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c91c527a45sm31765a12.23.2024.10.08.10.11.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Oct 2024 10:11:51 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess , Luis Machado Subject: [PATCH 0/5] Set osabi in remote target descriptions Date: Tue, 8 Oct 2024 18:11:45 +0100 Message-Id: X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true 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 I tried doing some remote debugging of a Window machine from a Linux machine and ran into some problems caused by gdbserver failing to set the osabi in the target description that is sent to GDB. This series fixes this issue. In v2: - Patches 3 & 4 are new. These are refactoring to allow for the updated patch 5. - Patch 5 is mostly the same, except the osabi is now set based on the enum values, rather than the osabi name strings. Thanks, Andrew --- Andrew Burgess (5): gdbserver: make arch and osabi names gdb::unique_xmalloc_ptr gdb: make use of set_tdesc_osabi overload in features/ files gdb: split osabi support between gdb/ and gdbsupport/ directories gdb/gdbserver: change shared set_tdesc_osabi to take gdb_osabi gdbserver: pass osabi to GDB in target description gdb/arch/amd64.c | 3 +- gdb/arch/i386.c | 3 +- gdb/arch/tic6x.c | 3 +- gdb/features/mips-dsp-linux.c | 2 +- gdb/features/mips-linux.c | 2 +- gdb/features/or1k-linux.c | 2 +- gdb/features/sparc/sparc32-solaris.c | 2 +- gdb/features/sparc/sparc64-solaris.c | 2 +- gdb/osabi.c | 120 +++++++-------------------- gdb/osabi.h | 45 ++-------- gdb/target-descriptions.c | 11 +-- gdb/target-descriptions.h | 1 - gdbserver/linux-aarch32-tdesc.cc | 2 +- gdbserver/linux-aarch64-tdesc.cc | 3 +- gdbserver/linux-arc-low.cc | 2 +- gdbserver/linux-arm-tdesc.cc | 2 +- gdbserver/linux-csky-low.cc | 2 +- gdbserver/linux-loongarch-low.cc | 2 +- gdbserver/linux-riscv-low.cc | 2 +- gdbserver/linux-tic6x-low.cc | 2 +- gdbserver/linux-x86-tdesc.cc | 15 +++- gdbserver/netbsd-aarch64-low.cc | 2 +- gdbserver/netbsd-amd64-low.cc | 2 +- gdbserver/netbsd-i386-low.cc | 2 +- gdbserver/tdesc.cc | 24 +++--- gdbserver/tdesc.h | 11 ++- gdbserver/win32-i386-low.cc | 4 +- gdbserver/win32-low.h | 7 ++ gdbsupport/Makefile.am | 1 + gdbsupport/Makefile.in | 15 ++-- gdbsupport/osabi-common.cc | 98 ++++++++++++++++++++++ gdbsupport/osabi-common.def | 57 +++++++++++++ gdbsupport/osabi-common.h | 54 ++++++++++++ gdbsupport/tdesc.h | 4 +- 34 files changed, 319 insertions(+), 190 deletions(-) create mode 100644 gdbsupport/osabi-common.cc create mode 100644 gdbsupport/osabi-common.def create mode 100644 gdbsupport/osabi-common.h base-commit: bcb92f7ba7b22ac882c000cabfd7ca8bea47c184 -- 2.25.4