From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qv1-xf32.google.com (mail-qv1-xf32.google.com [IPv6:2607:f8b0:4864:20::f32]) by sourceware.org (Postfix) with ESMTPS id CD7C73858D20 for ; Wed, 26 Jan 2022 23:55:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CD7C73858D20 Received: by mail-qv1-xf32.google.com with SMTP id g13so1360935qvw.4 for ; Wed, 26 Jan 2022 15:55:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:date:to:subject:message-id:mime-version :content-disposition; bh=qH8euBmjlK7rZ+0JFJ2JBQdEU/8Wrh9SQgPEuTlZ0XQ=; b=jqhXGZFaAN3WbM4YLX1e2Zf5kNFC3KyPCR4vl4VCxBlladE6mWVdfjIG28lpVZn2xx u7rO0xIJVInrI5PhPnOy6fIznalOjhaz/w/v3aKsTudornduCW15cUBBsefUtmxnYsPa OM08mLMjQOTxhwByOp4aF605MMFy3/f/KoGNcH9bJvtfUcUq7A8q4Dob6C/IJoqke5+T J5ZkQmfdyvqrECycRjCkiB/6MuLIdDH1segMKWJ7CYCTB4RpOCwuVUXxd3fTz34DWwVa tUw9Gvr9wRqZaHAVrM3vR/IWoUlOYL4Z9Xtrck/05SmVZvirt9iF+n33ke+BFUFKOne7 VMIQ== X-Gm-Message-State: AOAM530Djq8Mn2F5fBZPAMswnIVPrrsis2GLRt/qr3DC0wT7SCOcju0y 8uMJTSmOMlPPCspXHiUNF3fiM5cKeoErTpSq X-Google-Smtp-Source: ABdhPJwZuMThULb9LC8/uTxcUa5b+A09aIV8K8wng8iZvsmp0yvV77ctDeeOiMMnq0YtNNTLQ9C0ZA== X-Received: by 2002:a05:6214:401e:: with SMTP id kd30mr942481qvb.90.1643241329259; Wed, 26 Jan 2022 15:55:29 -0800 (PST) Received: from ephemeral (129.236.21.198.tigernet.wifi.dyn.clemson.edu. [198.21.236.129]) by smtp.gmail.com with ESMTPSA id w3sm81883qta.13.2022.01.26.15.55.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jan 2022 15:55:28 -0800 (PST) From: Matthew Rinaldi X-Google-Original-From: Matthew Rinaldi Date: Wed, 26 Jan 2022 18:55:27 -0500 To: gdb@sourceware.org Subject: Adding user-defined symbols to GDB Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS 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: Wed, 26 Jan 2022 23:55:31 -0000 Hello, I have a list of symbols that I have parsed out from a section within the binary. The data is not in any standard symbol table format. I have extracted the symbol's name and address. I want to add these symbols to GDB, but it is non-trivial. The solutions that I have seen for adding new user-defined symbols do not look ideal for a seemingly simple task. Example: https://github.com/mahaloz/decomp2gef/blob/main/decomp2gef.py#L247 Is it possible to have a feature/command where the user could add symbols directly to GDB without the use of an objfile? I brought it up with Simon Marchi, and he said the following: > But off-hand, I don't see why this wouldn't be possible. Each objfile > could have a list of user-defined symbols, that lookup_symbol_in_objfile > would search in addition to the other regular methods. Thank you, Matthew Rinaldi