Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: David Carlton <carlton@kealia.com>
To: Elena Zannoni <ezannoni@redhat.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [rfa] generate symbols associated to namespaces
Date: Tue, 09 Sep 2003 20:28:00 -0000	[thread overview]
Message-ID: <yf2he3lu2os.fsf@hawaii.kealia.com> (raw)
In-Reply-To: <16222.12105.616302.481564@localhost.redhat.com> (Elena Zannoni's message of "Tue, 9 Sep 2003 15:51:37 -0400")

On Tue, 9 Sep 2003 15:51:37 -0400, Elena Zannoni <ezannoni@redhat.com> said:
> David Carlton writes:

> Ok, but, could you check in the algorithm change (the nested_level
> stuff) for scan_partial_symbols w/o any namespace changes? So that
> we can do a cvs -D if something goes wrong? I have decided that it
> is best to have a change per 24hours period to a file, after
> spending a couple of days tracking down some other breakage in
> symfiles, a few weeks back.  Then the rest of the changes.

That should be fine.

>> +	  psym = add_psymbol_to_list (pdi->name, strlen (pdi->name),
>> +				      VAR_DOMAIN, LOC_STATIC,
>> +				      &objfile->static_psymbols,
>> +				      0, addr + baseaddr,
>> +				      cu_language, objfile);

> I don't like this too much. I.e. changing add_psymbol_to_list to
> return a value so you can get a hold of the psym. After all,
> add_psymbol_to_list doesn't change any of the fields of the psymbol,
> and cp_check_possible_namespace_symbols uses 2 fields that you
> already have around.

No, add_psymbol_to_list does change the fields: it calls
SYMBOL_SET_NAMES to set the demangled name, which I need in
cp_check_possible_namespace_symbols.  So having add_psymbol_to_list
return the psymbol seems the best solution; I suppose I could break
out the demangled-name-caching code that SYMBOL_SET_NAMES uses into a
separate function, but it doesn't seem worth it here.

>> +static char *
>> +add_partial_enumeration (struct partial_die_info *enum_pdi, char *info_ptr,
>> +			 struct objfile *objfile,
>> +			 const struct comp_unit_head *cu_header,
>> +			 const char *namespace)
>> +{
>> +  bfd *abfd = objfile->obfd;
>> +  struct partial_die_info pdi;
>> +
>> +  if (enum_pdi->name != NULL)
>> +    add_partial_symbol (enum_pdi, objfile, cu_header, namespace);
>> +  
>> +  while (1)
>> +    {
>> +      info_ptr = read_partial_die (&pdi, abfd, info_ptr, cu_header);
>> +      if (pdi.tag == 0)
>> +	break;
>> +      if (pdi.tag != DW_TAG_enumerator || pdi.name == NULL)
>> +	complaint (&symfile_complaints, "malformed enumerator DIE ignored");
>> +      else
>> +	add_partial_symbol (&pdi, objfile, cu_header, namespace);
>> +    }
>> +
>> +  return info_ptr;
>> +}
>> +

> Any enumeration related tests that fail before and pass after this
> change?

Nope.  I don't think it should change GDB's behavior on well-formed
debug info.

>> +  /* Add a symbol associated to this if we haven't seen the namespace
>> +     before.  */
>> +
>> +  if (dwarf2_extension (die) == NULL)

> Could you use this function in the check before this, in
> read_namespace (not in this patch, but already in the file)?

I think so; I don't see why the using directive bit couldn't be moved
into this block.

> I think it would make sense, in a next pass, to have all the creation
> of blocks go through the new function.

That would be my instinct as well.  I can't remember why I didn't do
that in this patch, but I don't think I had a good reason for why it
wouldn't work.

David Carlton
carlton@kealia.com


  reply	other threads:[~2003-09-09 20:28 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-16 20:22 David Carlton
2003-06-22 17:42 ` Daniel Jacobowitz
2003-06-24 19:00   ` David Carlton
2003-06-24 19:02     ` Daniel Jacobowitz
2003-06-27 16:04       ` David Carlton
2003-06-27 21:58         ` David Carlton
2003-06-27 22:32           ` David Carlton
2003-08-05 16:30           ` David Carlton
2003-08-05 17:54           ` Daniel Jacobowitz
2003-08-05 18:06             ` David Carlton
2003-08-05 18:08               ` Daniel Jacobowitz
2003-08-05 18:18                 ` David Carlton
2003-08-31 19:29             ` Daniel Jacobowitz
2003-09-02 16:38               ` David Carlton
2003-09-09 19:42           ` Elena Zannoni
2003-09-09 20:28             ` David Carlton [this message]
2003-09-09 22:17               ` Elena Zannoni
2003-09-09 23:25                 ` David Carlton
2003-09-11 19:52                   ` David Carlton
2003-09-17 20:41                     ` David Carlton
2003-09-11 23:28             ` [rfa] use allocate_block more David Carlton
2003-09-11 23:33               ` Elena Zannoni
2003-09-11 23:44                 ` David Carlton

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=yf2he3lu2os.fsf@hawaii.kealia.com \
    --to=carlton@kealia.com \
    --cc=ezannoni@redhat.com \
    --cc=gdb-patches@sources.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