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 [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id BC2743858C2C for ; Thu, 30 Sep 2021 19:27:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BC2743858C2C Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-169-qJF1zEXMOJG8WqaqGgE_mg-1; Thu, 30 Sep 2021 15:27:22 -0400 X-MC-Unique: qJF1zEXMOJG8WqaqGgE_mg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1B3EC8010ED; Thu, 30 Sep 2021 19:27:21 +0000 (UTC) Received: from blarsen.com (ovpn-116-79.gru2.redhat.com [10.97.116.79]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EF8691017CE7; Thu, 30 Sep 2021 19:27:12 +0000 (UTC) From: Bruno Larsen To: gdb-patches@sourceware.org Cc: simon.marchi@efficios.com, blarsen@redhat.com Subject: [PATCH v3 0/2] [gdb] untie and validate inheritance location Date: Thu, 30 Sep 2021 16:26:45 -0300 Message-Id: <20210930192647.31897-1-blarsen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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, 30 Sep 2021 19:27:25 -0000 This started with what was thought of as an incorrect inheritance location expression, but turned out to be a correct, but unusual expression, and uncovered an incorrect assumption when calculating offsets of baseclasses. This patchset is the new iteration of that solution, that changed gnuv3_baseclass_offset calculation to allow for non-virtual inheritance that has a non-trivial location expression and also moved the basic validation to this function. The check in value_contents_copy_raw was changed to an assert. Finally, the test was expanded to have one incorrect trivial location, and two non-trivial location expressions, one correct and one incorrect. Bruno Larsen (2): [gdb] Untied inheritance virtuality and loc kind [gdb] Add Simple offset validation when calculating baseclass_offset gdb/gnu-v3-abi.c | 23 +- .../gdb.dwarf2/dw2-inheritance-locexpr-1.exp | 233 +++++++++++++++++ .../gdb.dwarf2/dw2-inheritance-locexpr-2.exp | 235 ++++++++++++++++++ .../gdb.dwarf2/dw2-inheritance-locexpr.c | 69 +++++ gdb/value.c | 8 +- 5 files changed, 561 insertions(+), 7 deletions(-) create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-inheritance-locexpr-1.exp create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-inheritance-locexpr-2.exp create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-inheritance-locexpr.c -- 2.27.0