From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gateway30.websitewelcome.com (gateway30.websitewelcome.com [50.116.126.1]) by sourceware.org (Postfix) with ESMTPS id EDE713857C41 for ; Thu, 1 Oct 2020 17:20:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org EDE713857C41 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=tom@tromey.com Received: from cm14.websitewelcome.com (cm14.websitewelcome.com [100.42.49.7]) by gateway30.websitewelcome.com (Postfix) with ESMTP id 9D3AB6DEF for ; Thu, 1 Oct 2020 12:20:23 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id O2Fjk7i6MBD8bO2FjkDPkU; Thu, 01 Oct 2020 12:20:23 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID: In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=3XGBhtKNx5pJ2bj7h5HOIOf5tgv0JRki+vc0ZB621CU=; b=ZyU1jzQYXy+YuQS9r37r3JRyDx Nj4BXHLJfJmiC4HV5Y8Zzx25IOuAtcAk7nRDtjxNjaPYNgoRKFaOnUMfTAH5bBEOPP159St/EdFTl vC17eDRIfvTfKftlWzlpMnyN3; Received: from 174-16-122-38.hlrn.qwest.net ([174.16.122.38]:46238 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1kO2Fj-0010AP-4F; Thu, 01 Oct 2020 11:20:23 -0600 From: Tom Tromey To: AT&T Cc: gdb@sourceware.org Subject: Re: Symbol Tables for new ISA References: <226431FA-99E3-4A6E-AEB4-9B121EF02E94.ref@att.net> <226431FA-99E3-4A6E-AEB4-9B121EF02E94@att.net> X-Attribution: Tom Date: Thu, 01 Oct 2020 11:20:19 -0600 In-Reply-To: <226431FA-99E3-4A6E-AEB4-9B121EF02E94@att.net> (AT&T.'s message of "Tue, 29 Sep 2020 10:36:25 -0600") Message-ID: <87wo09eucs.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: 174.16.122.38 X-Source-L: No X-Exim-ID: 1kO2Fj-0010AP-4F X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 174-16-122-38.hlrn.qwest.net (murgatroyd) [174.16.122.38]:46238 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-Spam-Status: No, score=-3028.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, JMQ_SPF_NEUTRAL, RCVD_IN_ABUSEAT, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_NEUTRAL, TXREP autolearn=no 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, 01 Oct 2020 17:20:28 -0000 >>>>> "Ian" =3D=3D AT&T writes: Ian> I recently ported gdb for an obscure ISA on the target-side, and I am Ian> now looking to implement full symbol table support. The ISA uses the Ian> Tektronix tekhex BFD, and I have a .hex reference_binary that I=E2=80= =99m Ian> emulating in QEMU. I can=E2=80=99t seem to find much literature on th= e topic, Ian> so I was wondering if anyone on the forums would have an idea as to Ian> how one can =E2=80=9Cscrape=E2=80=9D or generate full symbol tables fo= r a newly ported Ian> ISA. Disclaimer: I don't know anything about this format. I think first make, it work in BFD. You can test that it works by using objdump on the file. If objdump can satisfactorily print symbols, then gdb needs to understand the file format as well. Mostly this is done via BFD APIs, but there are sometimes some format-specific tweaks that are needed. Here you can use examples like machoread.c and elfread.c. You make a new "struct sym_fns" instance and fill it in with pointers to your new functions. Assuming this format has just "linker" symbols and not debuginfo (like DWARF or stabs), you want to focus on creating "minimal symbols". You can skip all the partial/full symbol business, those are only for full debug symbols. Tom