From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ciao.gmane.io (ciao.gmane.io [116.202.254.214]) by sourceware.org (Postfix) with ESMTPS id A13D83858C55 for ; Sat, 20 Aug 2022 01:44:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A13D83858C55 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1oPDWx-0007TH-IR for binutils@sourceware.org; Sat, 20 Aug 2022 03:44:07 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: binutils@sourceware.org From: Tavis Ormandy Subject: Re: making stabs visible to gdb Date: Sat, 20 Aug 2022 01:44:00 -0000 (UTC) Message-ID: References: <52303818-50b6-8525-d0c3-7399e2a1ddba@redhat.com> <87bksyg2x5.fsf@tromey.com> User-Agent: slrn/pre1.0.4-5 (Linux) X-Spam-Status: No, score=-0.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, FORGED_GMAIL_RCVD, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, NML_ADSP_CUSTOM_MED, 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: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Aug 2022 01:44:18 -0000 On 2022-08-05, Tom Tromey wrote: >>> Also, is there a better way to accomplish what I'm trying to do? > > In the gdb test suite, we have some Tcl code that makes it relatively > simple to create synthetic DWARF. So, I'd consider extracting that and > using it to describe your program. > Hmm thanks, it kinda works - but it generates tons of warnings like this: warning: (Internal error: pc 0x8129250 in read in psymtab, but not in symtab.) warning: (Internal error: pc 0x8129250 in read in psymtab, but not in symtab.) warning: (Internal error: pc 0x8129250 in read in psymtab, but not in symtab.) It's so close to working nicely, but I think these warnings can't be hidden. What do you think about removing that warning? > Nick> There may be a gdb command that associates an address > Nick> with a symbol name, but I do not know what it is. Sorry. > > There isn't one that does exactly this, but you can probably use the > 'compile' command to achieve it. > Do you have an example of what you had in mind? I thought you might mean something like this, but I couldn't figure out the details: compile code -raw void (*example)(unsigned *foo, int bar) = (void*)(0x8005bba); void _gdb_expr(){}; Tavis. -- _o) $ lynx lock.cmpxchg8b.com /\\ _o) _o) $ finger taviso@sdf.org _\_V _( ) _( ) @taviso