From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 81936 invoked by alias); 25 Jul 2019 12:43:04 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 81925 invoked by uid 89); 25 Jul 2019 12:43:03 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-6.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.1 spammy= X-HELO: gateway21.websitewelcome.com Received: from gateway21.websitewelcome.com (HELO gateway21.websitewelcome.com) (192.185.45.91) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 25 Jul 2019 12:43:01 +0000 Received: from cm14.websitewelcome.com (cm14.websitewelcome.com [100.42.49.7]) by gateway21.websitewelcome.com (Postfix) with ESMTP id D67A1400C55BD for ; Thu, 25 Jul 2019 07:42:59 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id qd5HhzQGQ2qH7qd5Hh2aLj; Thu, 25 Jul 2019 07:42:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: 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=rtN34XkerOF2BObk1qYWBMrECP8Hk9QaGlHfl3Tck0g=; b=NSJgTrNMbZITcki5SqDQxCGp5+ MnPUoMy09XKTt3v3JKyIlRSVWdOrjXdw7/Ci5Li8CSB4h0k4BnAFZSv1nI647fRvVyTNxNgFHihb3 1GQ5aoDgVqZmqljrdEH+Nbvvm; Received: from 97-122-178-82.hlrn.qwest.net ([97.122.178.82]:39100 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1hqd5H-002k0C-Io; Thu, 25 Jul 2019 07:42:59 -0500 From: Tom Tromey To: Wei-min Pan Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [PATCH] gdb: CTF support References: <1563926228-31569-1-git-send-email-weimin.pan@oracle.com> <87v9vrtde8.fsf@tromey.com> Date: Thu, 25 Jul 2019 12:43:00 -0000 In-Reply-To: (Wei-min Pan's message of "Wed, 24 Jul 2019 16:50:47 -0700") Message-ID: <87o91ithd9.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2019-07/txt/msg00558.txt.bz2 >>>>> ">" == Wei-min Pan writes: Tom> dependencies = { module=all-binutils; on=all-libctf; }; >> There are more libctf changes in both Makefile.def and Makefile.in. >> Please see commit 0e65dfbaf3a0299e4837216a103c28625d4b4f1d which >> should address your concern? That commit adds the dependency of binutils on libctf. But, if gdb is going to use libctf, then another one is needed for gdb. Otherwise, I think nothing ensures that libctf will be built before gdb. >> >> +#include Tom> Probably just "ctf.h" here? The top-level include directory is already Tom> on the include path. >> There is already a gdb/ctf.h for tracing? Aha, thanks for pointing that out. In this case I think it would be better to rename gdb/ctf.h to something else. Tom> There's a type-safe registry API now. I would prefer that for new Tom> code. >> Where can I get more info on this API? I thought I'd written a comment in registry.h, but I see I did not. The registry generates a template class named "TAG_key"; e.g. for the objfile registry it is called objfile_key. You create your registry key using they type you plan to store. So, from arm-tdep.c: static objfile_key arm_objfile_data_key; If you use new/delete to manage the object that you store, then the above is enough. For the htab case, see elfread.c: static const struct objfile_key elf_objfile_gnu_ifunc_cache_data; The key has several methods, like "get" (to get the object), and "set" (to set the object). If you're using plain new/delete, it will have an "emplace" method that you can use to create a new object. >> It's needed only when creating psymtabs and expanding symbols. BTW I >> borrowed this idea from dwarf2read.c. So you recommend that I use >> xcalloc/xfree instead? Yes. Tom