From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 2EA7A384BC00 for ; Thu, 21 Jul 2022 18:21:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2EA7A384BC00 Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-480-yd6znFSqN-uGMEza4mSBNQ-1; Thu, 21 Jul 2022 14:21:06 -0400 X-MC-Unique: yd6znFSqN-uGMEza4mSBNQ-1 Received: by mail-ed1-f71.google.com with SMTP id f9-20020a056402354900b0043a902b7452so1567039edd.13 for ; Thu, 21 Jul 2022 11:21:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:in-reply-to:references:date :message-id:mime-version; bh=s/QgQOTdYQehq9j4uZwAFTGfc0vlMQSyUc0KrLUvuso=; b=0Z0bEF6s39yA1qBs8Ful8Bl7JZLA8+hl8mS/dg6TVC3jzN9qq8EjR1MThjhfn/9PLo Q4+tVu52udkdAA8rAPe4ZCuXMQ0R/sjyylV+Fbvj+EC3MlDZq3IztqDhDhIXD8fm8of9 XfWh7AdeJi9gDOvip++8qIAh2TXDyOLCNK5OoViBca01L96+iSU2n/OU+ZOdfaIyCGHu 9MGWGti6E08C6gb56r2kf6UlrWFv+6wsgNMGYxM6O7DQtyjKSzXkDooz3Eo+KWp5OWDT qxhOF3p3YCRBLb+CFTdQkdht2s1ANNpjIxzOm2mM4acu1DCaGtyjegBjLtT+6q1VJFZq dCVA== X-Gm-Message-State: AJIora+GG36WQ/4oyOo90NRsq8KLa9eogM2fTvpgzjSKFH0nracGdkBG siL8ogMkcwnOGEuL6OUR3Od94bnNC4nynI7Aldh0R6GtfzlJxsGYtWP1wYYBwu+CpcY58FscCQH U+Ne5DdcGdmdYLAiwX3k8xbnb+Vrz/NUQm7ROqQr9w592ibCnh1cpunqc7TzGxDdTp/FXXUYLew == X-Received: by 2002:a17:906:478b:b0:72b:5cd6:3f50 with SMTP id cw11-20020a170906478b00b0072b5cd63f50mr40861852ejc.514.1658427665241; Thu, 21 Jul 2022 11:21:05 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v9JOvDYw046CMWNHEV7rsRHNeWU2sl8ECIJF7HDlNmCi3NnCgjIKYmieNtTvVlsAAVGW243g== X-Received: by 2002:a17:906:478b:b0:72b:5cd6:3f50 with SMTP id cw11-20020a170906478b00b0072b5cd63f50mr40861831ejc.514.1658427664847; Thu, 21 Jul 2022 11:21:04 -0700 (PDT) Received: from localhost (92.40.179.56.threembb.co.uk. [92.40.179.56]) by smtp.gmail.com with ESMTPSA id v10-20020a170906292a00b006fef0c7072esm1118814ejd.144.2022.07.21.11.21.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Jul 2022 11:21:04 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Subject: Re: [PATCHv4 0/6] Detect invalid casts of gdbarch_tdep structures In-Reply-To: <87pmicsz8t.fsf@redhat.com> References: <87pmicsz8t.fsf@redhat.com> Date: Thu, 21 Jul 2022 19:21:01 +0100 Message-ID: <87bktiqqcy.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, 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.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jul 2022 18:21:10 -0000 Andrew Burgess writes: > Ping! I've now merged this series. Let me know if there are any problems. Thanks, Andrew > > Andrew Burgess writes: > >> Changes since v3: >> >> - Title of series has changed as the last patch, relating to >> detection of incorrect architecture with a native target, have been >> dropped. >> >> - Patches #1 and #2 are unchanged, >> >> - Patch #3 has had minor updates based on feedback from Luis and Pedro, >> >> - Patch #4 is unchanged, >> >> - Patch #5 is new, based on Pedro's feedback, >> >> - Patch #6 has been updated to make use of the work added in patch >> #5. >> >> Changes since v2: >> >> - Patch #3 has been replaced after feedback from Luis. New patch >> fixes sider issues for arm, mips, and frv targets, this includes >> the issue the v2 patch fixed. >> >> - Nothing else has changed. >> >> Changes since v1: >> >> - Patches #1 and #2 are unchanged. >> >> - Patch #3 is new in this version. >> >> - Patch #4 is unchanged (was patch 3). >> >> - Patch #5 is updated inline with John's feedback (was patch 4). >> >> - Patch #6 is extended to handle multi-arch case for rs6000/ppc and >> arm/aarch64, commit message is updated to discuss these cases, as >> well as mentioning i386/x86-64 (was patch 5). >> >> --- >> >> Andrew Burgess (6): >> gdb/arm: move fetch of arm_gdbarch_tdep to a more inner scope >> gdb/mips: rewrite show_mask_address >> gdb: select suitable thread for gdbarch_adjust_breakpoint_address >> gdb: move the type cast into gdbarch_tdep >> gdbsupport: add checked_static_cast >> gdb: ensure the cast in gdbarch_tdep is valid >> >> gdb/aarch64-fbsd-nat.c | 4 +- >> gdb/aarch64-fbsd-tdep.c | 6 +- >> gdb/aarch64-linux-nat.c | 20 ++-- >> gdb/aarch64-linux-tdep.c | 10 +- >> gdb/aarch64-newlib-tdep.c | 2 +- >> gdb/aarch64-tdep.c | 48 ++++----- >> gdb/aix-thread.c | 28 +++--- >> gdb/alpha-linux-tdep.c | 2 +- >> gdb/alpha-netbsd-tdep.c | 2 +- >> gdb/alpha-obsd-tdep.c | 2 +- >> gdb/alpha-tdep.c | 14 +-- >> gdb/amd64-darwin-tdep.c | 2 +- >> gdb/amd64-fbsd-nat.c | 4 +- >> gdb/amd64-fbsd-tdep.c | 4 +- >> gdb/amd64-linux-tdep.c | 8 +- >> gdb/amd64-netbsd-tdep.c | 2 +- >> gdb/amd64-obsd-tdep.c | 2 +- >> gdb/amd64-sol2-tdep.c | 2 +- >> gdb/amd64-tdep.c | 34 +++---- >> gdb/amd64-windows-tdep.c | 2 +- >> gdb/arc-linux-tdep.c | 4 +- >> gdb/arc-newlib-tdep.c | 2 +- >> gdb/arc-tdep.c | 8 +- >> gdb/arch-utils.c | 6 +- >> gdb/arm-fbsd-nat.c | 4 +- >> gdb/arm-fbsd-tdep.c | 6 +- >> gdb/arm-linux-nat.c | 8 +- >> gdb/arm-linux-tdep.c | 4 +- >> gdb/arm-netbsd-nat.c | 8 +- >> gdb/arm-netbsd-tdep.c | 4 +- >> gdb/arm-none-tdep.c | 2 +- >> gdb/arm-obsd-tdep.c | 2 +- >> gdb/arm-tdep.c | 142 ++++++++++++++------------- >> gdb/arm-wince-tdep.c | 2 +- >> gdb/avr-tdep.c | 12 +-- >> gdb/bfin-tdep.c | 4 +- >> gdb/breakpoint.c | 27 +++-- >> gdb/cris-linux-tdep.c | 2 +- >> gdb/cris-tdep.c | 18 ++-- >> gdb/csky-tdep.c | 8 +- >> gdb/frv-tdep.c | 4 +- >> gdb/ft32-tdep.c | 2 +- >> gdb/gdbarch.h | 27 ++++- >> gdb/hppa-bsd-tdep.c | 2 +- >> gdb/hppa-linux-tdep.c | 4 +- >> gdb/hppa-tdep.c | 12 +-- >> gdb/i386-bsd-tdep.c | 2 +- >> gdb/i386-darwin-tdep.c | 4 +- >> gdb/i386-fbsd-tdep.c | 4 +- >> gdb/i386-gnu-tdep.c | 2 +- >> gdb/i386-go32-tdep.c | 2 +- >> gdb/i386-linux-tdep.c | 4 +- >> gdb/i386-netbsd-tdep.c | 4 +- >> gdb/i386-nto-tdep.c | 6 +- >> gdb/i386-obsd-tdep.c | 2 +- >> gdb/i386-sol2-tdep.c | 2 +- >> gdb/i386-tdep.c | 98 +++++++++--------- >> gdb/i386-windows-tdep.c | 2 +- >> gdb/i387-tdep.c | 20 ++-- >> gdb/ia64-linux-tdep.c | 2 +- >> gdb/ia64-tdep.c | 12 +-- >> gdb/loongarch-linux-tdep.c | 2 +- >> gdb/loongarch-tdep.c | 4 +- >> gdb/m32c-tdep.c | 58 +++++------ >> gdb/m68hc11-tdep.c | 12 +-- >> gdb/m68k-bsd-tdep.c | 2 +- >> gdb/m68k-linux-tdep.c | 2 +- >> gdb/m68k-tdep.c | 38 +++---- >> gdb/mep-tdep.c | 6 +- >> gdb/mips-linux-tdep.c | 4 +- >> gdb/mips-tdep.c | 85 ++++++++-------- >> gdb/mn10300-tdep.c | 2 +- >> gdb/mn10300-tdep.h | 2 +- >> gdb/msp430-tdep.c | 12 +-- >> gdb/nds32-tdep.c | 20 ++-- >> gdb/nios2-linux-tdep.c | 2 +- >> gdb/nios2-tdep.c | 4 +- >> gdb/or1k-tdep.c | 8 +- >> gdb/ppc-fbsd-nat.c | 4 +- >> gdb/ppc-fbsd-tdep.c | 8 +- >> gdb/ppc-linux-nat.c | 22 ++--- >> gdb/ppc-linux-tdep.c | 18 ++-- >> gdb/ppc-netbsd-nat.c | 6 +- >> gdb/ppc-netbsd-tdep.c | 2 +- >> gdb/ppc-obsd-nat.c | 4 +- >> gdb/ppc-obsd-tdep.c | 2 +- >> gdb/ppc-sysv-tdep.c | 22 ++--- >> gdb/ppc64-tdep.c | 2 +- >> gdb/riscv-linux-tdep.c | 2 +- >> gdb/riscv-tdep.c | 26 ++--- >> gdb/rl78-tdep.c | 8 +- >> gdb/rs6000-aix-nat.c | 6 +- >> gdb/rs6000-aix-tdep.c | 16 +-- >> gdb/rs6000-lynx178-tdep.c | 4 +- >> gdb/rs6000-tdep.c | 132 ++++++++++++------------- >> gdb/rx-tdep.c | 2 +- >> gdb/s390-linux-tdep.c | 20 ++-- >> gdb/s390-tdep.c | 42 ++++---- >> gdb/sh-linux-tdep.c | 2 +- >> gdb/sh-netbsd-tdep.c | 2 +- >> gdb/sh-tdep.c | 8 +- >> gdb/sparc-linux-tdep.c | 4 +- >> gdb/sparc-netbsd-tdep.c | 2 +- >> gdb/sparc-sol2-tdep.c | 2 +- >> gdb/sparc-tdep.c | 14 +-- >> gdb/sparc64-fbsd-tdep.c | 2 +- >> gdb/sparc64-linux-tdep.c | 4 +- >> gdb/sparc64-netbsd-tdep.c | 2 +- >> gdb/sparc64-obsd-tdep.c | 2 +- >> gdb/sparc64-sol2-tdep.c | 2 +- >> gdb/sparc64-tdep.c | 10 +- >> gdb/tic6x-linux-tdep.c | 6 +- >> gdb/tic6x-tdep.c | 6 +- >> gdb/v850-tdep.c | 6 +- >> gdb/windows-nat.c | 2 +- >> gdb/xtensa-linux-nat.c | 4 +- >> gdb/xtensa-linux-tdep.c | 2 +- >> gdb/xtensa-tdep.c | 54 +++++----- >> gdb/z80-tdep.c | 8 +- >> gdbsupport/gdb-checked-static-cast.h | 68 +++++++++++++ >> 120 files changed, 811 insertions(+), 700 deletions(-) >> create mode 100644 gdbsupport/gdb-checked-static-cast.h >> >> -- >> 2.25.4