From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 84254 invoked by alias); 18 Jul 2019 20:07:15 -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 84245 invoked by uid 89); 18 Jul 2019 20:07:15 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy= X-HELO: mail-wm1-f67.google.com Received: from mail-wm1-f67.google.com (HELO mail-wm1-f67.google.com) (209.85.128.67) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 18 Jul 2019 20:07:14 +0000 Received: by mail-wm1-f67.google.com with SMTP id p74so26719475wme.4 for ; Thu, 18 Jul 2019 13:07:13 -0700 (PDT) Return-Path: Received: from ?IPv6:2001:8a0:f913:f700:56ee:75ff:fe8d:232b? ([2001:8a0:f913:f700:56ee:75ff:fe8d:232b]) by smtp.gmail.com with ESMTPSA id g12sm36332061wrv.9.2019.07.18.13.07.11 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jul 2019 13:07:11 -0700 (PDT) Subject: Re: [PATCH 2/3] gdb: Improve output from "info types" commad To: Andrew Burgess , gdb-patches@sourceware.org References: From: Pedro Alves Message-ID: <51913d3e-79a3-83a2-9e66-c4f62dd9feab@redhat.com> Date: Thu, 18 Jul 2019 20:07:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2019-07/txt/msg00440.txt.bz2 On 7/12/19 12:37 PM, Andrew Burgess wrote: > This commit makes two changes to the "info types" command: > > First, only use typedef_print for printing typedefs, and use > type_print for printing non-typedef scalar (non-struct) types. The > result of this is the output for builtin types goes from this: > > typedef double; > typedef float; > typedef int; > > to this: > > double; > float; > int; > > which seems to make more sense. > > Next GDB no longer matches msymbols as possible type names. When > looking for function symbols it makes sense to report matching > msymbols from the text sections, and for variables msymbols from the > data/bss sections, but when reporting types GDB would match msymbols > of type absolute. But I don't see why these are likely to indicate > type names. As such I've updated the msymbol matching lists in > symtab.c:search_symbols so that when searching in the TYPES_DOMAIN, we > never match any msymbols. > That sounds fine to me. > * symtab.c (search_symbols): Adjust msymbol matching type arrays > so that GDB doesn't match any msymbols when searching in the > TYPES_DOMAIN. > (print_symbol_info): Print using typedef_print or type_print based > on the type of the symbol. Add updated FIXME comment mobed from... > (_initialize_symtab): ... move and update FIXME comment to above. > Typo: "mobed". > gdb/testsuite/ChangeLog: > > * gdb.base/info-types.c: New file. > * gdb.base/info-types.exp: New file. > * gdb.cp/info-types.cc: New file. > * gdb.cp/info-types.exp: New file. I'm not immediately seeing what the C++ testcase is trying to test. If you replace "class" with struct, and use "typedef struct AA" instead of "typedef AA", isn't that code basically C code as well? Also, might it be a good idea to check the info-types.c stuff in C++ mode as well, to make sure we normalize C and C++ modes? I.e., make gdb.base/info-types.exp compile once as a C program, and once as a C++ program? Thanks, Pedro Alves