public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Pedro Alves <palves@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: Fix gdb.ada/bp_c_mixed_case.exp (PR gdb/22670) (Re: [PATCH 3/3] Add new gdb.ada/bp_c_mixed_case testcase for PR gdb/22670)
Date: Wed, 10 Jan 2018 03:36:00 -0000	[thread overview]
Message-ID: <20180110033608.adf7hvlaf5g6y6qm@adacore.com> (raw)
In-Reply-To: <619dda09-5c48-447e-ead9-c9d6a5ac9743@redhat.com>

Hi Pedro,

> The main idea behind making the name matcher be determined by
> the symbol's language is so that C++ (etc.) wildmatching in
> linespecs works even if the current language is not C++, as e.g.,
> when you step through C or assembly code.
> 
> Ada's verbatim matching syntax however ("<...>") isn't quite
> the same.  It is more a property of the current language than
> of a particular symbol's language.  We want to support
> this syntax when debugging an Ada program, but it's reason of
> existence is to find non-Ada symbols.  This suggests going back
> to enabling it depending on current language instead of language
> of the symbol being matched.

That's a good way of describing the situation.

> I'm not entirely happy with the "current_language" reference
> (though I think that it's harmless).  I think we could try storing the
> current language in the lookup_name_info object, and then convert
> a bunch of functions more to pass around lookup_name_info objects
> instead of "const char *" names.  I.e., build the lookup_name_info
> higher up.  I'm not sure about that, I'll have to think more
> about it.  Maybe something different will be better.

I understand. I have the same feeling in general.

> It doesn't help that I'm not used to debugging Ada code, but the
> recent testcase additions surely have helped understand better the
> intended use cases.  Thanks much for those.

My pleasure. I also have the same feeling, but with debugging
C++ right now, so I can certainly relate!

> Meanwhile, this looks small- and safe-enough for 8.1, to me.
> WDYT?
> 
> I'd extended the testcase to also exercise a no-debug-info
> function, for extra coverage of the minsyms-only paths.

Thanks! The patch looks good to me. A few minor typos below...

> >From d1f377264f278d2839c3cf331e931c7382114e11 Mon Sep 17 00:00:00 2001
> From: Pedro Alves <palves@redhat.com>
> Date: Tue, 9 Jan 2018 14:48:55 +0000
> Subject: [PATCH] Ada: make verbatim matcher override other language matchers
>  (PR gdb/22670)
> 
> gdb/ChangeLog:
> yyyy-mm-dd  Pedro Alves  <palves@redhat.com>
> 
> 	PR gdb/22670
> 	* dwarf2read.c
> 	(gdb_index_symbol_name_matcher::gdb_index_symbol_name_matcher):
> 	Adjust to use language_get_symbol_name_matcher instead of
> 	language_defn::la_get_symbol_name_matcher.
> 	* language.c (language_get_symbol_name_matcher): In in Ada mode
                                                         ^^^^^
                                                         |||||


> 	and the lookup name is a verbatim match, return Ada's matcher.
> 	* language.h (language_get_symbol_name_matcher): Adjust comment.
> 	(ada_lookup_name_info::verbatim_p):: New method.
> 
> gdb/testsuite/ChangeLog:
> yyyy-mm-dd  Pedro Alves  <palves@redhat.com>
> 
> 	PR gdb/22670
> 	* gdb.ada/bp_c_mixed_case.exp: Add intro comment.  Test printing C
> 	functions too.  Test setting breakpoints and printing C functions
> 	with no debug info too.
> 	* gdb.ada/bp_c_mixed_case/qux.c: New file.
> +# Try printing again using the "<...>" notation.  This shouldn work
                                                          ^^^^^^^
                                                          |||||||

I tested this patch on x86_64-linux, using both the official testsuite
as well as AdaCore's testsuite. No regression :).

Thanks, Pedro!
-- 
Joel

  parent reply	other threads:[~2018-01-10  3:36 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-04  8:36 FYI/pushed: Additional tests showing regression post C++ wild matching Joel Brobecker
2018-01-04  8:36 ` [PATCH 1/3] Add gdb.ada/info_addr_mixed_case new testcase Joel Brobecker
2018-01-04 13:25   ` Pedro Alves
2018-01-04 18:33     ` Pedro Alves
2018-01-05  3:22       ` Joel Brobecker
2018-01-05 16:06         ` Pedro Alves
2018-01-04  8:36 ` [PATCH 2/3] Add "complete break ada" test to gdb.ada/complete.exp Joel Brobecker
2018-01-05 16:37   ` [PATCH] Fix gdb.ada/complete.exp's "complete break ada" test (PR, gdb/22670) (Re: [PATCH 2/3] Add "complete break ada" test to gdb.ada/complete.exp) Pedro Alves
2018-01-08  4:05     ` Joel Brobecker
2018-01-04  8:36 ` [PATCH 3/3] Add new gdb.ada/bp_c_mixed_case testcase for PR gdb/22670 Joel Brobecker
2018-01-05 16:34   ` Fix gdb.ada/bp_c_mixed_case.exp (PR gdb/22670) (Re: [PATCH 3/3] Add new gdb.ada/bp_c_mixed_case testcase for PR gdb/22670) Pedro Alves
2018-01-08  3:57     ` Joel Brobecker
2018-01-08 15:00       ` Pedro Alves
2018-01-09  9:46         ` Joel Brobecker
2018-01-09 14:59           ` Pedro Alves
2018-01-09 16:45             ` Pedro Alves
2018-01-09 17:22               ` Pedro Alves
2018-01-10  3:36               ` Joel Brobecker [this message]
2018-01-10 23:41                 ` Pedro Alves
2018-01-11  4:00                   ` Joel Brobecker

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=20180110033608.adf7hvlaf5g6y6qm@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    /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).