Message ID | 20240321-disassemble-cleanup-v1-0-77448506f4ab@adacore.com |
---|---|
Headers |
Return-Path: <gdb-patches-bounces+patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C5B9E3858425 for <patchwork@sourceware.org>; Thu, 21 Mar 2024 18:11:09 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-io1-xd2e.google.com (mail-io1-xd2e.google.com [IPv6:2607:f8b0:4864:20::d2e]) by sourceware.org (Postfix) with ESMTPS id 03EC93858CD1 for <gdb-patches@sourceware.org>; Thu, 21 Mar 2024 18:10:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 03EC93858CD1 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 03EC93858CD1 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::d2e ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711044636; cv=none; b=H3h0VZ6F9JqkpofnIutwf8GiIhvGKpRKXwHfv++a2ug2B0mCLp7L3c3u5e1Sf7al4gfChWqnoqq8GgJM4BYx9OXNXvB5FRbn5ZC5ckn3G/2xQZcMpnHjZEAa4my8Hrd9b6OXzbskFfV6p0U+7DSPs//YbybDmiWCr0viak52mL8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711044636; c=relaxed/simple; bh=AQi1ggSphPueHBFHlgkL3u7cwBwS0vNI630AB4qcTBg=; h=DKIM-Signature:From:Subject:Date:Message-Id:MIME-Version:To; b=vyedBpxJGNI0fK3XSqm+RbGD/FzoTF/kumKUJjVSqhZrpXHieu6UbaK7ruG7zBGquv4ktI6xYpzxT4Z6JxL2IvtPqov5+hIJvNpcQUr9/1yJ3Gyx/UJ1H1RBpRtBvt+ONPHlKK1VzrbnL4ndO6UpoguPypHG+jTb/TB8sZ0BxoU= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-io1-xd2e.google.com with SMTP id ca18e2360f4ac-7cf25c1ee7aso52923939f.2 for <gdb-patches@sourceware.org>; Thu, 21 Mar 2024 11:10:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1711044633; x=1711649433; darn=sourceware.org; h=to:content-transfer-encoding:mime-version:message-id:date:subject :from:from:to:cc:subject:date:message-id:reply-to; bh=MVpVAf+19BGLchNZFLEuWyLf7BJe9FuLYr2dusfdsE0=; b=fTr1tyk7I42nz74zyCuY9zcKqfLNbAOW4YfYjflY2pqAU8tbuQ0vY3r8zY3orouAnB 9M4K3iCG9Xy5ZUYElZS07tAHsYmLR2loK5c2vA+QfjRNN5pWT3VsBzixzJPZ8mG2In/2 gspcIoQ3h0qM4cYqFT2msNZiiieZ8jdiwW7hg+KwxgaQRn96GEgeeD8/yOayzvAbVB+P 0Cacy4xQ9K/DZZePLVMdO37B/TJzVUygXUeoucLZ7aEFAmDIcJWRmjCEHgq2x/jtoI2y ttI4qwC98y7xuiF/j4XfpS2ZO/c766kJmYIadcQKtgODXDIh7PvyI2YglFJ5IjwK1P+i GVqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711044633; x=1711649433; h=to:content-transfer-encoding:mime-version:message-id:date:subject :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=MVpVAf+19BGLchNZFLEuWyLf7BJe9FuLYr2dusfdsE0=; b=Pok9Htm6PHvAbP4LSQb6GirEFrTGyy3rv5mT/lZVgz6m/Jl/T8M8qbGLu3Dy8jAAP0 GzSlTVUNh5Kbhz2soJfoC9ue9AWm/Z/fjq7ALH6viiGMUFMGL7fEUIg++hNTd8oktM7Q ZrStYcW/A4+OtsPXAnU65Uyx7W5exIBhK9DDlbdAxm2qo4PE69DaTK3p/UVCzwe7Xa+l OepM4QWqNMJanN2ErLU0/DkRD2mNR3m2+RjXn/qXqjhlmfl4RrM/UBWNTry7DkK9CNaU xvWbEpfRp7b2BmJthe2sSiTr6vYzA4FqOJy/wzDQNxRIpj1XhX36Z/s4UpVDV7ilbiPe oMRg== X-Gm-Message-State: AOJu0YzLdVXb6qKVfbiw2/2+jCM50mpkPXD9xMREdW41RzXiE9jBzwas x3/FHzrhsZyt6QKNN8238eA0qVZNJQEtAFa35ivrIzh8XAkbMrz0AYw7pnqY01kryTwB45RVy64 = X-Google-Smtp-Source: AGHT+IFMHd/Xc545Xdi6y0PomB3eCT/E6b/TmJUhsjhBCvKTw2KiULzRY4capNBT7Spp776WexAU7A== X-Received: by 2002:a5d:8912:0:b0:7c8:e878:db39 with SMTP id b18-20020a5d8912000000b007c8e878db39mr222569ion.16.1711044633204; Thu, 21 Mar 2024 11:10:33 -0700 (PDT) Received: from localhost.localdomain (97-122-82-115.hlrn.qwest.net. [97.122.82.115]) by smtp.gmail.com with ESMTPSA id r23-20020a5e9517000000b007cf05417adbsm76582ioj.22.2024.03.21.11.10.32 for <gdb-patches@sourceware.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 11:10:32 -0700 (PDT) From: Tom Tromey <tromey@adacore.com> Subject: [PATCH 0/3] Minor cleanups in disassemble code Date: Thu, 21 Mar 2024 12:10:31 -0600 Message-Id: <20240321-disassemble-cleanup-v1-0-77448506f4ab@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIABd4/GUC/x3MQQrCMBBG4auUWTuQxBTBq4iLSfJrB9pYMipC6 d2NLr/FexsZmsLoPGzU8FbTR+3wh4HyJPUO1tJNwYXojsFzURMzLGkG5xlSXyuPRZyXEEecIvV ybbjp53+9XLuTGDg1qXn6vRaxJxrt+xfmOmoMfgAAAA== To: gdb-patches@sourceware.org X-Mailer: b4 0.12.4 X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list <gdb-patches.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=subscribe> Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org |
Series |
Minor cleanups in disassemble code
|
|
Message
Tom Tromey
March 21, 2024, 6:10 p.m. UTC
I happened to look at the disassemble code today, and I saw a few minor changes that, IMO, make it a bit cleaner. Regression tested on x86-64 Fedora 38. --- Tom Tromey (3): Constify get_disassembler_options Remove some unnecessary casts Use std::string for disassembler options gdb/arc-tdep.c | 15 +++++++-------- gdb/arch-utils.c | 6 +++--- gdb/arm-tdep.c | 6 +++--- gdb/disasm.c | 22 +++++++++------------- gdb/disasm.h | 2 +- gdb/gdbarch-gen.h | 4 ++-- gdb/gdbarch.c | 6 +++--- gdb/gdbarch_components.py | 2 +- gdb/mips-tdep.c | 14 +++++++------- gdb/riscv-tdep.c | 2 +- gdb/rs6000-tdep.c | 2 +- gdb/s390-tdep.c | 2 +- 12 files changed, 39 insertions(+), 44 deletions(-) --- base-commit: acaf48b921453c37fc2df4151699c912940bcd25 change-id: 20240321-disassemble-cleanup-5da01a245e74 Best regards,
Comments
On 3/21/24 11:10 AM, Tom Tromey wrote: > I happened to look at the disassemble code today, and I saw a few > minor changes that, IMO, make it a bit cleaner. > > Regression tested on x86-64 Fedora 38. > > --- > Tom Tromey (3): > Constify get_disassembler_options > Remove some unnecessary casts > Use std::string for disassembler options > > gdb/arc-tdep.c | 15 +++++++-------- > gdb/arch-utils.c | 6 +++--- > gdb/arm-tdep.c | 6 +++--- > gdb/disasm.c | 22 +++++++++------------- > gdb/disasm.h | 2 +- > gdb/gdbarch-gen.h | 4 ++-- > gdb/gdbarch.c | 6 +++--- > gdb/gdbarch_components.py | 2 +- > gdb/mips-tdep.c | 14 +++++++------- > gdb/riscv-tdep.c | 2 +- > gdb/rs6000-tdep.c | 2 +- > gdb/s390-tdep.c | 2 +- > 12 files changed, 39 insertions(+), 44 deletions(-) > --- > base-commit: acaf48b921453c37fc2df4151699c912940bcd25 > change-id: 20240321-disassemble-cleanup-5da01a245e74 > > Best regards, These all seem sensible. It seems a bit odd to me that gdbarch_disassembler_options returns a pointer to the string rather than the string, but that was true before and not related to your changes. Approved-By: John Baldwin <jhb@FreeBSD.org>
>>>>> "John" == John Baldwin <jhb@FreeBSD.org> writes:
John> These all seem sensible. It seems a bit odd to me that
John> gdbarch_disassembler_options returns a pointer to the string rather
John> than the string, but that was true before and not related to your
John> changes.
I guess it's so it can be set and fetched with a single api, and so
there can be a default of not letting the user touch the options for an
arch. It is a little weird though now that you mention it. Like why
have globals. Cleanup for another day perhaps.
Tom