Message ID | 20231105-split-objfile-2023-bound-sym-october-v2-0-dbd2d158bbc3@tromey.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 3A29D3856DF8 for <patchwork@sourceware.org>; Sun, 5 Nov 2023 18:11:46 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from omta040.useast.a.cloudfilter.net (omta040.useast.a.cloudfilter.net [44.202.169.39]) by sourceware.org (Postfix) with ESMTPS id 2D7283858CDB for <gdb-patches@sourceware.org>; Sun, 5 Nov 2023 18:11:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2D7283858CDB Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2D7283858CDB Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=44.202.169.39 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699207892; cv=none; b=gAgmQK1Vx2VHW3N/1CRSGsyrqnXe/bR9+gFbINRpeeDeo3kiTYlTHE5dw1qNwE7KgUqvx7LNMND652vvLdcTys+Q0tR6FPyUCSW7ZEivw92vXkTZGFnzmK+WDCnDkevMXiCEmxr1lFdLOdSNUGh+H8yTLRAh4d0mOVc/ZrxMYUk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699207892; c=relaxed/simple; bh=bsfKoTIBm6RSZdx0saNf2hs28Uf5jTPcsgU5ib06qsU=; h=DKIM-Signature:From:Subject:Date:Message-Id:MIME-Version:To; b=vG9N9eBEm62JA7b/geHE4606VzBI+obw+3ctQaLW1LTCEprPv1yU3QecY1Expu7rbIbHT82a5CLqbxO4sfCG71/rf9TL8HeRs6bmwl6/90xCq3fL97NVAbLXYTQBpW7xIKkWRPJsQC/3vfK1IBqeRVnimiJZv0SmA44Dk4TuZ44= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-6004a.ext.cloudfilter.net ([10.0.30.197]) by cmsmtp with ESMTPS id zQYeqcERp6nOZzharqqvt4; Sun, 05 Nov 2023 18:11:29 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id zhaqqEMCawasUzharqUAG1; Sun, 05 Nov 2023 18:11:29 +0000 X-Authority-Analysis: v=2.4 cv=ZpP+lv3G c=1 sm=1 tr=0 ts=6547dad1 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=OWjo9vPv0XrRhIrVQ50Ab3nP57M=:19 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=IkcTkHD0fZMA:10 a=BNY50KLci1gA:10 a=Qbun_eYptAEA:10 a=CCpqsmhAAAAA:8 a=zstS-IiYAAAA:8 a=ikT9nzSHaGRutke8eLYA:9 a=QEXdDO2ut3YA:10 a=ul9cdbp4aOFLsgKbc677:22 a=4G6NA9xxw8l3yy4pmD5M:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=To:Content-Transfer-Encoding:Content-Type:MIME-Version: Message-Id:Date:Subject:From:Sender:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=CpJRbZnzfHfPe+yFy5UO/1tG58CdHggJDt2n0rwOtNw=; b=eu6cL544raTWlGWW2GMMPz9xIm j45000IahqKpFgepd5rNvK8llFlvBGpLW9f2EAZjyBzrQDKxhw8qc/kpYPMezW8nVsTgaQ/zZETvO cHvGTYhydSMO0ruKJO6I5uWHS; Received: from 97-122-77-73.hlrn.qwest.net ([97.122.77.73]:51014 helo=[192.168.0.21]) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from <tom@tromey.com>) id 1qzhaq-003Y66-1y for gdb-patches@sourceware.org; Sun, 05 Nov 2023 11:11:28 -0700 From: Tom Tromey <tom@tromey.com> Subject: [PATCH v2 00/31] Baby step for objfile splitting Date: Sun, 05 Nov 2023 11:11:38 -0700 Message-Id: <20231105-split-objfile-2023-bound-sym-october-v2-0-dbd2d158bbc3@tromey.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIANvaR2UC/5WOTQ7CIBSEr9Kw9hmg2qor72G64OdhMQINYGPT9 O5Cb+Dym0y+mZUkjBYTuTUriTjbZIMvwA8NUaPwTwSrCxNOecsov0Ka3jZDkC9j3wg1Bhk+XkN aHASVg8QIFy16YxjtmFKkqKaIxn73mcdQWIqEIKPwaqxyJ1LGWIujTTnEZb8zs1r/c3lmQKFj/ NwybXjfnu45BofLUQVHhm3bflJKf+PyAAAA To: gdb-patches@sourceware.org X-Mailer: b4 0.12.4 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.122.77.73 X-Source-L: No X-Exim-ID: 1qzhaq-003Y66-1y X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-77-73.hlrn.qwest.net ([192.168.0.21]) [97.122.77.73]:51014 X-Source-Auth: tom+tromey.com X-Email-Count: 1 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfKsFvINGFPt4x3Jx/6h53scQ8LEnjSpAb7OnI45R5Xi0bT+BzLdLJn09r/sBwRZtJqbtcl5Nop9wH+2CuNOthMd1YD/PuIDC6x4Ntrz2XBsgfBUREq9W CrddEuRVxvURRzyF+S6XdknRLy01Db9DC4hk5auIKXtGMI3HEDpQlJd56yiU6tOwte+k/9agj2H2MOO8VvDsJplv73UCuV8w1pI= X-Spam-Status: No, score=-3018.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, JMQ_SPF_NEUTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, 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.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 |
Baby step for objfile splitting
|
|
Message
Tom Tromey
Nov. 5, 2023, 6:11 p.m. UTC
Every year or so, I take a stab at the objfile splitting work. This always fails and I end up not sending anything. This year, I decided to take a baby step instead, thinking maybe it would be possible to slowly grind away at the problem. This series is the first such step. It spreads the use of block_symbol through a bunch of code, trying to eliminate calls to symbol::value_address. The longer term idea here is to then add an objfile member to block_symbol. After this, it would be relatively simple to change symbols to be relocated at point of use. (This would be a significant step toward objfile splitting, but there's even more to do after that...) Regression tested on x86-64 Fedora 38. --- Changes in v2: - Updated per review - Added bound_symbol patch, converted some patches to use it - More comprehensive change in ada-lang.c - Link to v1: https://inbox.sourceware.org/gdb-patches/20231029-split-objfile-2023-bound-sym-october-v1-0-612531df2734@tromey.com --- Tom Tromey (31): Introduce block-symbol.h Add block_symbol::address Add bound_symbol Easy conversions to use block_symbol::address Use block_symbol::address in ada-tasks.c Use block_symbol::address in printcmd.c Use bound_symbol::address in tracepoint.c Use block_symbol::address in tracepoint.c Use block_symbol::address in ax-gdb.c Use block_symbol::address in linespec.c Use block_symbol::address in ada-lang.c Use bound_symbol::address in symmisc.c Introduce read_var_value overload Use read_var_value in gdb/compile Return a block_symbol from find_pc_sect_function Use read_var_value overload in finish_command_fsm Use block_symbol in overload-handling code Change evaluate_var_value to accept a block_symbol Change value_of_variable to take a block_symbol Return a block_symbol from get_frame_function Use read_var_value overload in return_command Use read_var_value overload in py-finishbreakpoint.c Use read_var_value overload in py-framefilter.c Use read_var_value overload in Guile Use read_var_value in read_frame_arg and read_frame_local Change print_variable_and_value to take a block_symbol Change find_frame_funname to return a block_symbol Change btrace_function::sym to a block_symbol Use read_var_value overload in Python Remove the old read_var_value Change language_defn::read_var_value to accept block_symbol gdb/ada-lang.c | 116 +++++++++++++---------------- gdb/ada-tasks.c | 19 ++--- gdb/ax-gdb.c | 28 +++---- gdb/ax-gdb.h | 2 +- gdb/block-symbol.h | 42 +++++++++++ gdb/blockframe.c | 18 ++--- gdb/breakpoint.c | 4 +- gdb/btrace.c | 38 +++++----- gdb/btrace.h | 5 +- gdb/cli/cli-cmds.c | 4 +- gdb/compile/compile-c-symbols.c | 18 +++-- gdb/compile/compile-cplus-symbols.c | 6 +- gdb/compile/compile-cplus-types.c | 2 +- gdb/compile/compile-loc2c.c | 14 ++-- gdb/compile/compile.h | 6 +- gdb/cp-support.c | 46 +++++++----- gdb/cp-support.h | 6 +- gdb/dwarf2/ada-imported.c | 2 +- gdb/dwarf2/loc.c | 16 ++-- gdb/dwarf2/loc.h | 3 +- gdb/eval.c | 62 +++++++--------- gdb/expop.h | 5 ++ gdb/f-valprint.c | 4 +- gdb/findvar.c | 24 +++--- gdb/frame.c | 2 +- gdb/frame.h | 9 ++- gdb/guile/guile-internal.h | 2 +- gdb/guile/scm-block.c | 6 +- gdb/guile/scm-frame.c | 7 +- gdb/guile/scm-symbol.c | 78 ++++++++++---------- gdb/infcall.c | 4 +- gdb/infcmd.c | 29 ++++---- gdb/infrun.c | 10 +-- gdb/inline-frame.c | 2 +- gdb/language.h | 14 +--- gdb/linespec.c | 15 ++-- gdb/mi/mi-cmd-stack.c | 20 ++--- gdb/printcmd.c | 22 +++--- gdb/python/py-block.c | 6 +- gdb/python/py-finishbreakpoint.c | 11 +-- gdb/python/py-frame.c | 15 ++-- gdb/python/py-framefilter.c | 64 +++++++--------- gdb/python/py-objfile.c | 16 ++-- gdb/python/py-record-btrace.c | 2 +- gdb/python/py-symbol.c | 143 ++++++++++++++++++------------------ gdb/python/py-type.c | 2 +- gdb/python/py-unwind.c | 4 +- gdb/python/python-internal.h | 4 +- gdb/record-btrace.c | 8 +- gdb/rust-lang.c | 2 +- gdb/skip.c | 2 +- gdb/solib-frv.c | 2 +- gdb/sparc-tdep.c | 4 +- gdb/stack.c | 59 ++++++++------- gdb/stack.h | 2 +- gdb/symmisc.c | 15 ++-- gdb/symtab.c | 4 +- gdb/symtab.h | 38 +++++++--- gdb/tracepoint.c | 26 ++++--- gdb/tracepoint.h | 2 +- gdb/valarith.c | 9 +-- gdb/valops.c | 75 ++++++++++--------- gdb/value.c | 2 +- gdb/value.h | 18 ++--- 64 files changed, 647 insertions(+), 598 deletions(-) --- base-commit: 0a845aef62b8813275616bd399e8fca679161cfc change-id: 20231029-split-objfile-2023-bound-sym-october-8da7ff1061cc Best regards,
Comments
Tom Tromey <tom@tromey.com> writes: > Every year or so, I take a stab at the objfile splitting work. This > always fails and I end up not sending anything. For those of us who aren't familiar with the background here. Do you have a link to a previous description of, or could you give a description of, what the "objfile splitting work" is about. What's the longer term goal, of which this series is a step towards. Thanks, Andrew > > This year, I decided to take a baby step instead, thinking maybe it > would be possible to slowly grind away at the problem. > > This series is the first such step. It spreads the use of > block_symbol through a bunch of code, trying to eliminate calls to > symbol::value_address. > > The longer term idea here is to then add an objfile member to > block_symbol. After this, it would be relatively simple to change > symbols to be relocated at point of use. (This would be a significant > step toward objfile splitting, but there's even more to do after > that...) > > Regression tested on x86-64 Fedora 38. > > --- > Changes in v2: > - Updated per review > - Added bound_symbol patch, converted some patches to use it > - More comprehensive change in ada-lang.c > - Link to v1: https://inbox.sourceware.org/gdb-patches/20231029-split-objfile-2023-bound-sym-october-v1-0-612531df2734@tromey.com > > --- > Tom Tromey (31): > Introduce block-symbol.h > Add block_symbol::address > Add bound_symbol > Easy conversions to use block_symbol::address > Use block_symbol::address in ada-tasks.c > Use block_symbol::address in printcmd.c > Use bound_symbol::address in tracepoint.c > Use block_symbol::address in tracepoint.c > Use block_symbol::address in ax-gdb.c > Use block_symbol::address in linespec.c > Use block_symbol::address in ada-lang.c > Use bound_symbol::address in symmisc.c > Introduce read_var_value overload > Use read_var_value in gdb/compile > Return a block_symbol from find_pc_sect_function > Use read_var_value overload in finish_command_fsm > Use block_symbol in overload-handling code > Change evaluate_var_value to accept a block_symbol > Change value_of_variable to take a block_symbol > Return a block_symbol from get_frame_function > Use read_var_value overload in return_command > Use read_var_value overload in py-finishbreakpoint.c > Use read_var_value overload in py-framefilter.c > Use read_var_value overload in Guile > Use read_var_value in read_frame_arg and read_frame_local > Change print_variable_and_value to take a block_symbol > Change find_frame_funname to return a block_symbol > Change btrace_function::sym to a block_symbol > Use read_var_value overload in Python > Remove the old read_var_value > Change language_defn::read_var_value to accept block_symbol > > gdb/ada-lang.c | 116 +++++++++++++---------------- > gdb/ada-tasks.c | 19 ++--- > gdb/ax-gdb.c | 28 +++---- > gdb/ax-gdb.h | 2 +- > gdb/block-symbol.h | 42 +++++++++++ > gdb/blockframe.c | 18 ++--- > gdb/breakpoint.c | 4 +- > gdb/btrace.c | 38 +++++----- > gdb/btrace.h | 5 +- > gdb/cli/cli-cmds.c | 4 +- > gdb/compile/compile-c-symbols.c | 18 +++-- > gdb/compile/compile-cplus-symbols.c | 6 +- > gdb/compile/compile-cplus-types.c | 2 +- > gdb/compile/compile-loc2c.c | 14 ++-- > gdb/compile/compile.h | 6 +- > gdb/cp-support.c | 46 +++++++----- > gdb/cp-support.h | 6 +- > gdb/dwarf2/ada-imported.c | 2 +- > gdb/dwarf2/loc.c | 16 ++-- > gdb/dwarf2/loc.h | 3 +- > gdb/eval.c | 62 +++++++--------- > gdb/expop.h | 5 ++ > gdb/f-valprint.c | 4 +- > gdb/findvar.c | 24 +++--- > gdb/frame.c | 2 +- > gdb/frame.h | 9 ++- > gdb/guile/guile-internal.h | 2 +- > gdb/guile/scm-block.c | 6 +- > gdb/guile/scm-frame.c | 7 +- > gdb/guile/scm-symbol.c | 78 ++++++++++---------- > gdb/infcall.c | 4 +- > gdb/infcmd.c | 29 ++++---- > gdb/infrun.c | 10 +-- > gdb/inline-frame.c | 2 +- > gdb/language.h | 14 +--- > gdb/linespec.c | 15 ++-- > gdb/mi/mi-cmd-stack.c | 20 ++--- > gdb/printcmd.c | 22 +++--- > gdb/python/py-block.c | 6 +- > gdb/python/py-finishbreakpoint.c | 11 +-- > gdb/python/py-frame.c | 15 ++-- > gdb/python/py-framefilter.c | 64 +++++++--------- > gdb/python/py-objfile.c | 16 ++-- > gdb/python/py-record-btrace.c | 2 +- > gdb/python/py-symbol.c | 143 ++++++++++++++++++------------------ > gdb/python/py-type.c | 2 +- > gdb/python/py-unwind.c | 4 +- > gdb/python/python-internal.h | 4 +- > gdb/record-btrace.c | 8 +- > gdb/rust-lang.c | 2 +- > gdb/skip.c | 2 +- > gdb/solib-frv.c | 2 +- > gdb/sparc-tdep.c | 4 +- > gdb/stack.c | 59 ++++++++------- > gdb/stack.h | 2 +- > gdb/symmisc.c | 15 ++-- > gdb/symtab.c | 4 +- > gdb/symtab.h | 38 +++++++--- > gdb/tracepoint.c | 26 ++++--- > gdb/tracepoint.h | 2 +- > gdb/valarith.c | 9 +-- > gdb/valops.c | 75 ++++++++++--------- > gdb/value.c | 2 +- > gdb/value.h | 18 ++--- > 64 files changed, 647 insertions(+), 598 deletions(-) > --- > base-commit: 0a845aef62b8813275616bd399e8fca679161cfc > change-id: 20231029-split-objfile-2023-bound-sym-october-8da7ff1061cc > > Best regards, > -- > Tom Tromey <tom@tromey.com>
>>>>> "Andrew" == Andrew Burgess <aburgess@redhat.com> writes: Andrew> Tom Tromey <tom@tromey.com> writes: >> Every year or so, I take a stab at the objfile splitting work. This >> always fails and I end up not sending anything. Andrew> For those of us who aren't familiar with the background here. Do you Andrew> have a link to a previous description of, or could you give a Andrew> description of, what the "objfile splitting work" is about. What's the Andrew> longer term goal, of which this series is a step towards. The basic idea is that debug info should be independent of the program space. That way, symbol tables can be shared across inferiors. The project is somewhat documented here: https://sourceware.org/gdb/wiki/ObjfileSplitting It's been vaguely ongoing for a very long time. I managed to implement it for minsyms, psyms, and line tables; but symbols and blocks have proven to be more difficult, with a trail of failed branches behind them. Tom
Tom Tromey <tom@tromey.com> writes: >>>>>> "Andrew" == Andrew Burgess <aburgess@redhat.com> writes: > > Andrew> Tom Tromey <tom@tromey.com> writes: >>> Every year or so, I take a stab at the objfile splitting work. This >>> always fails and I end up not sending anything. > > Andrew> For those of us who aren't familiar with the background here. Do you > Andrew> have a link to a previous description of, or could you give a > Andrew> description of, what the "objfile splitting work" is about. What's the > Andrew> longer term goal, of which this series is a step towards. > > The basic idea is that debug info should be independent of the program > space. That way, symbol tables can be shared across inferiors. > > The project is somewhat documented here: > > https://sourceware.org/gdb/wiki/ObjfileSplitting > > It's been vaguely ongoing for a very long time. I managed to implement > it for minsyms, psyms, and line tables; but symbols and blocks have > proven to be more difficult, with a trail of failed branches behind > them. Thanks. I have heard this discussed before, I'd just not associated with that name. Thanks, Andrew