Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Keith Seitz <keiths@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA] c++/11734 revisited
Date: Thu, 09 Dec 2010 21:45:00 -0000	[thread overview]
Message-ID: <m3oc8u1uzs.fsf@fleche.redhat.com> (raw)
In-Reply-To: <4D002672.5090504@redhat.com> (Keith Seitz's message of "Wed, 08	Dec 2010 16:44:34 -0800")

>>>>> "Keith" == Keith Seitz <keiths@redhat.com> writes:

Keith> I originally proposed fixing this by switching to pre-expansion. Tom
Keith> reports that this really mucks up indexing. As a result, I have
Keith> rewritten this patch.

I think I must have been unclear.

The problem with using pre-expansion in the index code was that the
index didn't include all the same info as the psymtabs, so there was no
good way to avoid expanding too many CUs when asked to look up a common
type like "int".

I don't think this problem would affect psymtab.c.  So, you could
probably still use pre-expansion if you think that is better.

And, true to form, I misremembered the many different attempts at fixing
this that I went through -- apparently in the tree we currently do use
pre-expansion for the index.

Sorry about all that.

Keith> It's such a nightmare, it would actually a primary reason to
Keith> rewrite linespec.c entirely. One of these days, I'll find the
Keith> time to do it.

That will be a happy day.  For us anyway ;-)

Keith> 2010-12-08  Keith Seitz  <keiths@redhat.com>
Keith>	* linespec.c (decode_compound): Rename SAVED_ARG to
Keith>	THE_REAL_SAVED_ARG.

The ChangeLog entry should mention the PR, so the commit will end up in
bugzilla.

Keith> +  if (*saved_arg == '\'')
Keith> +    {
Keith> +      char *end = skip_quoted (saved_arg);
Keith> +      memcpy (saved_arg, saved_arg + 1, end - saved_arg);
Keith> +      memcpy (end - 2, end, strlen (saved_arg) + 1);

For overlapping copies you must use memmove.

Keith> +static const char *
Keith> +psymtab_search_name (const char *name)
Keith> +{
Keith> +  switch (current_language->la_language)

I don't think psymtab.c should refer to current_language.

I guess the search language could be a parameter.  I realize that at
some point we'll need to use current_language, and that symtab.c isn't
exactly clean in this regard.  It doesn't seem too hard to avoid letting
the rot creep into this code, though.

I suspect this same bug is going to bite the index code, too, and we'll
have to export this function for use there too.  I'll check that out
after your patch goes in.

Keith> +  return xstrdup (name);

The return type of this function should be just "char *".
Otherwise you will need casts when freeing.

Keith> +  cleanup = make_cleanup (xfree, (void *) search_name);

... like this one.

Keith> +if  {[gdb_compile $srcfiles $binfile executable {debug c++}] != "" } {
Keith> +     untested pr11734.exp
Keith> +     return -1
Keith> +}

Keith> +if {[get_compiler_info $binfile "c++"]} {
Keith> +    return -1
Keith> +}
Keith> +
Keith> +gdb_exit
Keith> +gdb_start
Keith> +gdb_reinitialize_dir $srcdir/$subdir
Keith> +gdb_load $binfile

I don't know if you can use prepare_for_testing here, but
if not you can at least use clean_restart.

Tom


  parent reply	other threads:[~2010-12-09 21:45 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-09  0:50 Keith Seitz
2010-12-09  4:02 ` Eli Zaretskii
2010-12-09 21:45 ` Tom Tromey [this message]
2010-12-09 21:52   ` Jan Kratochvil
2010-12-10 15:21     ` Keith Seitz
2010-12-14 20:03   ` Keith Seitz
2011-01-24 18:15     ` Jan Kratochvil
2011-01-26 23:14       ` Jan Kratochvil
2011-02-06 22:04     ` Jan Kratochvil
2011-02-06 22:45     ` [patch 0/3] Re: [RFA] c++/11734 revisited (and c++/12273) Jan Kratochvil
2011-02-08 21:42       ` Tom Tromey
2011-02-10 21:45       ` Keith Seitz
2011-02-17 18:37         ` Keith Seitz
2011-02-18  3:24           ` Keith Seitz
2011-02-21 11:41           ` Jan Kratochvil
2011-02-24 20:41             ` Keith Seitz
2011-02-27 21:18             ` Jan Kratochvil
2011-03-01 22:00               ` Keith Seitz
2011-03-14  7:52                 ` Jan Kratochvil
2011-03-15 19:03                   ` Keith Seitz
2011-03-16  8:28                     ` Jan Kratochvil
2011-03-16 13:58                       ` Tom Tromey
2011-03-16 23:20                       ` Keith Seitz
2011-03-17  3:19                         ` Joel Brobecker
2011-03-17  9:11                           ` Jan Kratochvil
2011-03-17 13:21                             ` Joel Brobecker
2011-02-06 22:46     ` [patch 1/3] revert physname part (b) [Re: [RFA] c++/11734 revisited] Jan Kratochvil
2011-02-06 22:46     ` [patch 2/3] Keith's psymtabs fix " Jan Kratochvil
2011-02-06 22:46     ` [patch 3/3] Various linespec fixups " Jan Kratochvil

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=m3oc8u1uzs.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=keiths@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