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 4C07F385EC56 for ; Thu, 24 Jun 2021 22:24:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4C07F385EC56 Received: from fencepost.gnu.org ([2001:470:142:3::e]:59114) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lwXm6-0007Ty-OI for gdb@sourceware.org; Thu, 24 Jun 2021 18:24:42 -0400 Received: from ip5f5a8a3c.dynamic.kabel-deutschland.de ([95.90.138.60]:61170 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 1lwXm6-0002HR-Io for gdb@sourceware.org; Thu, 24 Jun 2021 18:24:42 -0400 To: gdb@sourceware.org From: Simon Sobisch Subject: Is it possible to "inject" into the stack or show non-stack entries via frame decorator api? Message-ID: Date: Fri, 25 Jun 2021 00:24:39 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 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, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Thu, 24 Jun 2021 22:24:44 -0000 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