Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Liu, Lei" <lei.liu2@windriver.com>
To: Tom Tromey <tromey@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] call cp_lookup_symbol_namespace recursively to search symbols in C++ base classes
Date: Wed, 03 Nov 2010 01:41:00 -0000	[thread overview]
Message-ID: <4CD0BDCB.1040405@windriver.com> (raw)
In-Reply-To: <m3vd4fh5gk.fsf@fleche.redhat.com>

On 2010年11月03日 03:48, Tom Tromey wrote:
>>>>>> ">" == Liu, Lei<lei.liu2@windriver.com>  writes:
>
>>> This patch is trying to fix a bug in gdb.  The problem is found in
>>> following C++ test case.
>
> Thanks.
>
> This looks pretty reasonable overall.  In order for it to go in, we
> would need a couple things:
>
> * Copyright assignment forms filed with the FSF.  If you don't have this
>    already, one of us can get you started.

I don't have this yet. We can get start to do it.

>
> * A test case -- the one you have is fine, it just needs to be in the
>    form used by our test suite.

Right. I'll reform it.

>
>>> 2010-11-02  Lei Liu<lei.liu2@windriver.com>
>
>>>      * cp-namespace.c (cp_lookup_symbol_namespace): Recursively call
>>>      itself to search C++ base classes.
>
> It isn't 100% clear to me that cp_lookup_symbol_namespace is the right
> function.  That file is kind of spaghetti-ish right now :(

It seems to me that all the C++ specific symbol looking up code are located
in this file. I don't know where else I can put my code in.

>
>>> +  scope_sym = lookup_symbol (scope, NULL, VAR_DOMAIN, NULL);
>>> +  if (scope_sym == NULL)
>>> +    return NULL;
>>> +
>>> +  scope_type = SYMBOL_TYPE(scope_sym);
>>> +  if (scope_type == NULL)
>>> +    return NULL;
>
> I think lookup_typename is better here.

Well, I tried that first, but we must have a GDBARCH passed to it. I'm not
sure where can I get this.

>
>>> +  if (TYPE_CODE (scope_type) == TYPE_CODE_STRUCT)
>
> I think you should call check_typedef on scope_type before this check.

OK. I missed that.

>
> thanks,
> Tom
>

Thanks.
Lei


  reply	other threads:[~2010-11-03  1:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-02  3:47 Liu, Lei
2010-11-02  8:06 ` Yao Qi
2010-11-03  1:34   ` Liu, Lei
2010-11-02 20:31 ` Tom Tromey
2010-11-03  1:41   ` Liu, Lei [this message]
2010-11-03  0:10 ` Pedro Alves
2010-11-03  2:55   ` Liu, Lei
2010-11-03 17:57     ` Pedro Alves
2010-11-04  8:51   ` Liu, Lei
2010-11-07 10:04     ` Yao Qi
2010-11-08  1:38       ` Liu, Lei

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=4CD0BDCB.1040405@windriver.com \
    --to=lei.liu2@windriver.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@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