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 9F46038582A2 for ; Mon, 11 Jul 2022 10:46:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9F46038582A2 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-230-tirEzA_UNgiXry8CuWpN5w-1; Mon, 11 Jul 2022 06:46:46 -0400 X-MC-Unique: tirEzA_UNgiXry8CuWpN5w-1 Received: by mail-wm1-f72.google.com with SMTP id g22-20020a7bc4d6000000b003a2e0951432so2503694wmk.9 for ; Mon, 11 Jul 2022 03:46:45 -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=F+4GioTSJxxU7mikhEnwGIT38ZBf3DSvKNK1mP8QThs=; b=Rq4oz+8wnmhFQsSZ6+r4qKDej606dGGsp6utUUjAaFkIZaJUFIa0Inp+Yxd3vuu8MK aiXxIAdHxcZtuKsS5tNzTKP0c1MFvIcZtDPsSq97BmLOt199Y4OVgPQ4mcm81nKLruum zYciPB2ooNK6XIlnzxLkZyhzlqAf6rgjNcRE3nR40aT2E96HhUZc6oaRmqV0lDXJ7M3Q 4UaLdJB303G0B+YyqwCe+PVR5+ITZJ6CNS+AGhD1g93AfHfju2psr31LBdxbWPtnPZ5b CN/OT6XjvMJKiwqfiyJqNEP77t8ZTilJk315Kbq1KrPLXjmRY8CENlGm8D5QknPs3kCg E/KQ== X-Gm-Message-State: AJIora9sqHOxisIbR5YAMEkCEtSI+n5DwxNcivr+uw2lG1coZNKFaId0 JotObtXXx+H5tbKAP0JkyXrilp8cBG0fxlixOXXFYohnYVNWdnXC1gRNVs7Ox8qMfc8E0nWrSHh +0H1AVPoECrioSu1ACoAcdnLGgptBRGOOFY35frtRIBzW2zH40aJoazr5NGxvzs1PaOPwMMHgVw == X-Received: by 2002:adf:f281:0:b0:21d:662e:5ce1 with SMTP id k1-20020adff281000000b0021d662e5ce1mr15746693wro.444.1657536404764; Mon, 11 Jul 2022 03:46:44 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s6LkIB19JQSwjg0qkGrIj4IBsuScRenpmQYhQR4/1SV6F/V1rTtttpXpVPTXKlVQQavb0pog== X-Received: by 2002:adf:f281:0:b0:21d:662e:5ce1 with SMTP id k1-20020adff281000000b0021d662e5ce1mr15746651wro.444.1657536404179; Mon, 11 Jul 2022 03:46:44 -0700 (PDT) Received: from localhost (15.72.115.87.dyn.plus.net. [87.115.72.15]) by smtp.gmail.com with ESMTPSA id g1-20020a05600c000100b00397623ff335sm6287454wmc.10.2022.07.11.03.46.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Jul 2022 03:46:43 -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: References: Date: Mon, 11 Jul 2022 11:46:42 +0100 Message-ID: <87pmicsz8t.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=-3.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no 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: Mon, 11 Jul 2022 10:46:55 -0000 Ping! 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