From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 7A9553857C53 for ; Sat, 17 Jul 2021 14:22:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7A9553857C53 Received: from fencepost.gnu.org ([2001:470:142:3::e]:45560) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m4lCj-0004zs-1V for gdb@sourceware.org; Sat, 17 Jul 2021 10:22:09 -0400 Received: from ip5f5a897f.dynamic.kabel-deutschland.de ([95.90.137.127]:49524 helo=[192.168.111.41]) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m4lCi-0000OG-Se for gdb@sourceware.org; Sat, 17 Jul 2021 10:22:09 -0400 Subject: Re: Is it possible to "inject" into the stack or show non-stack entries via frame decorator api? From: Simon Sobisch To: gdb@sourceware.org References: Message-ID: <646b1ce0-bf68-56cf-b70e-56040dee4cc4@gnu.org> Date: Sat, 17 Jul 2021 16:22:06 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, NICE_REPLY_A, SPF_HELO_PASS, SPF_PASS, 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@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jul 2021 14:22:10 -0000 Just a friendly ping - any insight highly appreciated. > Scenario: > > the current call-stack currently looks like > > #0 func3 > #1 func3_wrapper > #2 func2 > #3 func2_wrapper > #4 func1 > #5 func1_wrapper > #6 main > > > Using frame filters it is no problem to change that to either > > #0 func3 > #2 func2 > #4 func1 > > or > > #0 func3 >    #1 func3_wrapper > #2 func2 >    #3 func2_wrapper > #4 func1 >    #5 func1_wrapper > #6 main > > > Question: Is it possibly to also add a "virtual" stack entry (one could > select/up/down to), or at least show it in the backtrace? > > Something like the following: > > #0 func3 at ... >    #0.1  func3_part_a at ... >    #0.2  func3_part_c at ... >    #0.3  func3_part_b at ... >    #0.4  func3_part_a at ... >    #0.5  func3_start at ... > #2 func2 at ... > > > Background: > Each of those "func" entries in the stack have an internal frame > handling using a linked list that contains label address pointers. It > would be very cool to list those directly (currently only done with > additional commands local-backtrace and list-local-frame which I'd like > to drop). > > I _guess_ adding those to the shown stack may be possible, but likely > only with telling GDB about those (patching GDB), but maybe there's a > way to at least print those with their positions in "bt" using a frame > decorator? > > Thanks for answers, > Simon