public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: Philippe Waroquiers <philippe.waroquiers@skynet.be>,
	gdb-patches@sourceware.org
Cc: Pedro Alves <palves@redhat.com>
Subject: Re: [PUSHED 2/5] Add [-q] [-t TYPEREGEXP] [NAMEREGEXP] args to info [args|functions|locals|variables]
Date: Tue, 30 Oct 2018 14:59:00 -0000	[thread overview]
Message-ID: <d60706a4-5eef-1fe8-b4cf-45d9d339c2e5@suse.de> (raw)
In-Reply-To: <20181027124418.20394-3-philippe.waroquiers@skynet.be>

On 10/27/18 2:44 PM, Philippe Waroquiers wrote:
> @@ -4497,8 +4560,13 @@ search_symbols (const char *regexp, enum search_domain kind,
>  	    || MSYMBOL_TYPE (msymbol) == ourtype3
>  	    || MSYMBOL_TYPE (msymbol) == ourtype4)
>  	  {
> -	    if (!preg || preg->exec (MSYMBOL_NATURAL_NAME (msymbol), 0,
> -				     NULL, 0) == 0)
> +	    /* If the user wants to see var matching a type regexp,
> +	       then never give a minimal symbol.  */
> +	    if (kind != VARIABLES_DOMAIN
> +		&& !treg.has_value () /* minimal symbol has never a type ???? */
> +		&& (!preg.has_value ()
> +		    || preg->exec (MSYMBOL_NATURAL_NAME (msymbol), 0,
> +				   NULL, 0) == 0))
>  	      {
>  		/* For functions we can do a quick check of whether the
>  		   symbol might be found via find_pc_symtab.  */

Hi,

Consider this testcase with minimal symbols:
...
$ cat test.c
static int var;

int
main (void)
{
  return 0;
}
$ gcc test.c
$
...

After this commit, I don't see "var":
...
$ gdb -batch a.out -ex "info var"
All defined variables:

File init.c:
24:     const int _IO_stdin_used;
...

while before this commit, I do see "var":
...
$ gdb -batch a.out -ex "info variables"
All defined variables:

File init.c:
24:     const int _IO_stdin_used;

Non-debugging symbols:
0x0000000000400534  __GNU_EH_FRAME_HDR
0x0000000000400624  __FRAME_END__
0x0000000000600e40  __frame_dummy_init_array_entry
0x0000000000600e40  __init_array_start
0x0000000000600e48  __do_global_dtors_aux_fini_array_entry
0x0000000000600e48  __init_array_end
0x0000000000600e50  _DYNAMIC
0x0000000000601000  _GLOBAL_OFFSET_TABLE_
0x0000000000601018  __data_start
0x0000000000601018  data_start
0x0000000000601020  __dso_handle
0x0000000000601028  __TMC_END__
0x0000000000601028  __bss_start
0x0000000000601028  _edata
0x0000000000601028  completed
0x000000000060102c  var
0x0000000000601030  _end
...

I think this is a regression.

Thanks,
- Tom

  reply	other threads:[~2018-10-30 14:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-27 12:44 [PUSHED 0/5] info [args|functions|locals|variables] [-q] [-t TYPEREGEXP] [NAMEREGEXP] Philippe Waroquiers
2018-10-27 12:44 ` [PUSHED 4/5] Announce changes in NEWS to info [args|functions|locals|variables] Philippe Waroquiers
2018-10-27 12:44 ` [PUSHED 2/5] Add [-q] [-t TYPEREGEXP] [NAMEREGEXP] args " Philippe Waroquiers
2018-10-30 14:59   ` Tom de Vries [this message]
2018-10-30 21:27     ` Philippe Waroquiers
2018-10-27 12:44 ` [PUSHED 1/5] New cli-utils.h/.c function extract_info_print_args Philippe Waroquiers
2018-10-27 12:44 ` [PUSHED 3/5] Document changes to info [args|functions|locals|variables] Philippe Waroquiers
2018-10-27 12:44 ` [PUSHED 5/5] Add a test case for info args|functions|locals|variables [-q] [-t TYPEREGEXP] [NAMEREGEXP] Philippe Waroquiers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d60706a4-5eef-1fe8-b4cf-45d9d339c2e5@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    --cc=philippe.waroquiers@skynet.be \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).