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 0B6653858289 for ; Tue, 20 Dec 2022 16:57:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0B6653858289 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671555467; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=x1potZfAlkIpqoeHrkKWhVvJUmKz9VBB+hpJ+LtmfIo=; b=UM8/z6Ud4k9fNY/sLRYSu1BnqnzMx/MCuKmO8BbSTwuLtkoSqJPLLLMBFFzciFAtk/3qag 0etEMe6aIT56MgmpMEGbgrOX6zWww9drvv9qLu40KU3HWdjOzAqCPjWEPrttnCxEgf04dp rcVyqUBhFllkGslLZVrLPh1/FHXx0fg= Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-608-d0axsreiPciPaw1muORSTw-1; Tue, 20 Dec 2022 11:57:46 -0500 X-MC-Unique: d0axsreiPciPaw1muORSTw-1 Received: by mail-ed1-f69.google.com with SMTP id z3-20020a056402274300b0046b14f99390so9293258edd.9 for ; Tue, 20 Dec 2022 08:57:46 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=x1potZfAlkIpqoeHrkKWhVvJUmKz9VBB+hpJ+LtmfIo=; b=0eOE1oaOjEOz2egBo976oQE9f71gTVv1if8QDPuV/DGMt1KdCtyCu6cvB7MCgB0bxR PUQz2a9eSUU7XoiaHy60cK6qHFts6IatfVerpugj47qDwmwI/bFrEWPVcDxw/UfLsihm FqMjh1n+MQmD+s2SRKMS0CseuRsFJgLCCDV+E50cBSaFWIkMNgsbIt/C1iY8ZcxCFga3 UG+acY9qzEKUruGNz9frqA9+vm9wjhSMF56mi/uWIWCDGm+LvDJn/f6tjTIqm+cYgtOY t5cXBlooj9RBH7HYpacBl4Oq1xKKd0MWyWhN0/7669ESPR8VjUd2kUUZT5LpXuoGbi87 9n0g== X-Gm-Message-State: ANoB5plBanA6iypXegbfiscpmyfenX+3Hms+FCrexV+TR/YuMp3S1NKo NL7DFrT7OavMtn0G4ofAucEGKH71BSChbOOzzKdF0AVKuYdhWYpSlXhMgE8djYRb/Mwcn1CDf2w 10SQZW3bIf7CHa74dyIhNEw== X-Received: by 2002:a17:907:c71b:b0:7c1:99a7:e10b with SMTP id ty27-20020a170907c71b00b007c199a7e10bmr27725776ejc.49.1671555465131; Tue, 20 Dec 2022 08:57:45 -0800 (PST) X-Google-Smtp-Source: AA0mqf7IdKbp4dvoAIM8pydnwRcP5Xw/+7PZIyM0a4BehbCsAg/11hJ4tiPrQy1EB+gqWeDpk40GCw== X-Received: by 2002:a17:907:c71b:b0:7c1:99a7:e10b with SMTP id ty27-20020a170907c71b00b007c199a7e10bmr27725763ejc.49.1671555464906; Tue, 20 Dec 2022 08:57:44 -0800 (PST) Received: from [192.168.0.45] (ip-62-245-66-121.bb.vodafone.cz. [62.245.66.121]) by smtp.gmail.com with ESMTPSA id ss1-20020a170907c00100b007c0d41736c0sm5910692ejc.39.2022.12.20.08.57.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 20 Dec 2022 08:57:44 -0800 (PST) Message-ID: Date: Tue, 20 Dec 2022 17:57:43 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: Re: [PATCH v2 00/13] Make frame_info_ptr automatic To: Simon Marchi , gdb-patches@sourceware.org References: <20221214033441.499512-1-simon.marchi@polymtl.ca> From: Bruno Larsen In-Reply-To: <20221214033441.499512-1-simon.marchi@polymtl.ca> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_BARRACUDACENTRAL,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 14/12/2022 04:34, Simon Marchi via Gdb-patches wrote: > This is v2 of: > > https://inbox.sourceware.org/gdb-patches/20221202180052.212745-1-simon.marchi@polymtl.ca/ > > The first main change is that I dropped the patch removing the user of > frame_info_ptr at many places, following Tom's comment. If we end up > trying to reinflate a frame at a moment where it's not possible (because > the frame's id is being computed), we'll hit an assert in > frame_info_ptr. This is fine, because it indicates some logic problem > in GDB. > > The second main change, found after doing the first one, is to fix a bug > with the user-created frame reinflation. In v1, if we had two > frame_info_ptr wrapping the same user-created frame_info object, they > would each create their own frame_info instance on reinflation. And > that confused GDB down the line. There are a few new patches to deal > with that, by adding user-created frames to the frame stash, so they can > be found by frame_info_ptr when reinflating. > > At the end of the series, frame_info_ptr::frame_info_ptr (at the end of > the series) accesses some frame_info internals (the frame's id, without > calling get_frame_id), so I decided to move frame_info_ptr to > frame.{c,h} (patch 6). I think that makes sense anyway, as the logic in > the implementation of frame_info_ptr is tightly coupled to the rest of > the frame stuff. However, to do so, we need to break some inclusion > cycles. This is done in the few patches before. Patches 1 and 2 are > not strictly necessary, but fix oddities I found along the way. > > Regression-tested on Ubuntu 22.04 x86-64. This series doesn't add any regressions and is where I wanted to take frame_info_ptr all along. I have only one nit with patch 6 (sent as a direct reply), but other than that: Reviewed-By: Bruno Larsen -- Cheers, Bruno > > Simon Marchi (13): > gdb: move type_map_instance to compile/compile.c > gdb: move compile_instance to compile/compile.h > gdb: remove language.h include from frame.h > gdb: move sect_offset and cu_offset to dwarf2/types.h > gdb: move call site types to call-site.h > gdb: move frame_info_ptr to frame.{c,h} > gdb: add frame_id::user_created_p > gdb: add user-created frames to stash > gdb: add create_new_frame(frame_id) overload > gdb: make it possible to restore selected user-created frames > gdb: make user-created frames reinflatable > gdb: make frame_info_ptr grab frame level and id on construction > gdb: make frame_info_ptr auto-reinflatable > > gdb/Makefile.in | 2 +- > gdb/aarch64-tdep.c | 1 + > gdb/amd64-tdep.c | 1 + > gdb/arm-tdep.c | 1 + > gdb/c-lang.c | 1 - > gdb/c-lang.h | 2 + > gdb/compile/compile-c.h | 1 + > gdb/compile/compile-cplus.h | 1 + > gdb/compile/compile-internal.h | 129 ------------ > gdb/compile/compile.c | 13 ++ > gdb/compile/compile.h | 116 +++++++++++ > gdb/cp-abi.c | 1 + > gdb/cp-support.c | 1 + > gdb/dwarf2/abbrev-cache.h | 1 - > gdb/dwarf2/attribute.h | 2 +- > gdb/dwarf2/call-site.h | 244 +++++++++++++++++++++++ > gdb/dwarf2/comp-unit-head.h | 5 +- > gdb/dwarf2/cooked-index.h | 2 +- > gdb/dwarf2/expr.h | 2 +- > gdb/dwarf2/line-header.h | 2 - > gdb/dwarf2/types.h | 40 ++++ > gdb/expop.h | 1 + > gdb/f-lang.h | 1 + > gdb/frame-id.h | 4 + > gdb/frame-info.c | 65 ------ > gdb/frame-info.h | 211 -------------------- > gdb/frame.c | 127 ++++++++++-- > gdb/frame.h | 206 ++++++++++++++++++- > gdb/gdbtypes.h | 229 --------------------- > gdb/gnu-v3-abi.c | 1 + > gdb/go-lang.h | 1 + > gdb/infcmd.c | 2 - > gdb/language.c | 1 - > gdb/m2-typeprint.c | 1 + > gdb/mi/mi-cmd-stack.c | 2 - > gdb/ppc-sysv-tdep.c | 1 + > gdb/python/py-disasm.c | 1 + > gdb/python/py-frame.c | 1 + > gdb/stack.c | 16 -- > gdb/symtab.c | 1 + > gdb/symtab.h | 1 + > gdb/testsuite/gdb.base/frame-view.c | 80 ++++++++ > gdb/testsuite/gdb.base/frame-view.exp | 109 ++++++++++ > gdb/testsuite/gdb.base/frame-view.py | 41 ++++ > gdb/thread.c | 1 + > gdb/unittests/frame_info_ptr-selftests.c | 76 +++++++ > 46 files changed, 1065 insertions(+), 683 deletions(-) > create mode 100644 gdb/dwarf2/call-site.h > create mode 100644 gdb/dwarf2/types.h > delete mode 100644 gdb/frame-info.c > delete mode 100644 gdb/frame-info.h > create mode 100644 gdb/testsuite/gdb.base/frame-view.c > create mode 100644 gdb/testsuite/gdb.base/frame-view.exp > create mode 100644 gdb/testsuite/gdb.base/frame-view.py > create mode 100644 gdb/unittests/frame_info_ptr-selftests.c > > > base-commit: a4b83845ded201e7d46220213d3e38950c30dbb5