From: David Carlton <carlton@math.stanford.edu>
To: Elena Zannoni <ezannoni@redhat.com>
Cc: gdb-patches@sources.redhat.com, Jim Blandy <jimb@redhat.com>
Subject: Re: [rfa] struct dictionary
Date: Tue, 10 Jun 2003 16:43:00 -0000 [thread overview]
Message-ID: <ro1n0gp6fyf.fsf@jackfruit.Stanford.EDU> (raw)
In-Reply-To: <16101.3585.739945.993550@localhost.redhat.com>
On Mon, 9 Jun 2003 18:45:21 -0400, Elena Zannoni <ezannoni@redhat.com> said:
> David Carlton writes:
> As usual, some comments. Could you check in the removal of the
> sorting as one patch, and the dictionary as another?
Will do.
> See below for some things, but in general it's ok.
Great!
> I don't feel too comfortable with the Java stuff, are there any
> tests that use that particular code? It sure looks safe to me
> though.
The Java testsuite might exercise it a little bit, but it might not.
Once this goes in, I'll e-mail Tom Tromey to ask him to pound on it a
bit.
>> +/* Various vtbls that we'll actually use. */
>> +
>> +static const struct dict_vtbl dict_hashed_vtbl =
>> + {
>> + DICT_HASHED, free_obstack, add_symbol_nonexpandable,
>> + iterator_first_hashed, iterator_next_hashed,
>> + iter_name_first_hashed, iter_name_next_hashed,
>> + };
>> +
> Could you do these one per line and put a comment with the field
> name next to it (for easy grepping)? I am not too fond of the use
> of vtable terminology, could you use 'vector' or something else?
Sure.
>> + $(infcall_h) $(dictionary.h)
> dictionary_h
Whoops, good eye!
>> @@ -348,9 +309,11 @@ finish_block (struct symbol *symbol, str
>> TYPE_FIELDS (ftype) = (struct field *)
>> TYPE_ALLOC (ftype, nparams * sizeof (struct field));
>>
>> - for (i = iparams = 0; iparams < nparams; i++)
>> + for (sym = dict_iterator_first (BLOCK_DICT (block), &iter),
>> + iparams = 0;
>> + iparams < nparams;
>> + sym = dict_iterator_next (&iter))
> could you use the macro ALL_BLOCK_SYMBOLS here? and move the check for
> iparams inside the loop body?
Sure, that makes sense. I was just going with the way it had been
written before, but now that I look at it, it was only written that
way for reasons that are no longer relevant: you want me to do
ALL_BLOCK_SYMBOLS (block, iter, sym)
{
if (iparams == nparams)
break;
....
}
And before this change, that wouldn't have worked, because
ALL_BLOCK_SYMBOLS was secretly two nested loops, so you can't break
out of them, but after my change it's just a single loop, so the break
works just fine. Excellent.
>> -static struct block *new_block (int);
>> +static struct block *new_block (int function);
> can this take an enum parameter with some meaningful names?
Well, I'm just using it as a boolean, so it seems to me that doing an
enum would be a little funny. How about I rename the argument to
function_p, or is_function, or something like that? But if you'd
prefer an enum, I could do something like
enum block_type { FUNCTION, NON_FUNCTION };
instead.
>> @@ -1236,13 +1231,16 @@ parse_symbol (SYMR *sh, union aux_ext *a
>>
>> if (nparams > 0)
>> {
>> + struct dict_iterator iter;
>> TYPE_NFIELDS (ftype) = nparams;
>> TYPE_FIELDS (ftype) = (struct field *)
>> TYPE_ALLOC (ftype, nparams * sizeof (struct field));
>>
>> - for (i = iparams = 0; iparams < nparams; i++)
>> + for (sym = dict_iterator_first (BLOCK_DICT (b), &iter),
>> + iparams = 0;
>> + iparams < nparams;
>> + sym = dict_iterator_next (&iter))
> could you still use the macro here ALL_BLOCK_SYMBOLS and add an if
> (iparams == nparams) break; inside the loop?
Yes, presumably I can handle this like the buildsym case above.
>> - register int i, j;
>> + struct dict_iterator iter;
>> + register int j;
> no need for register.
Right, sorry.
>> @@ -493,6 +495,11 @@ dump_symtab (struct objfile *objfile, st
>> fprintf_filtered (outfile, " under ");
>> gdb_print_host_address (BLOCK_SUPERBLOCK (b), outfile);
>> }
>> +#if 0
>> + /* NOTE: carlton/2003-04-28: If we really want to be able to
>> + print out something here, we'll need to add an extra
>> + dictionary method just for that purpose. */
>> +
> Hmmm, I think we should. We don't want to change gdb's behavior.
Well, it's for a maint command, so we can really do whatever we want
here. But if you think that's an important part of the info, I'll add
the extra method.
I'll make those changes and commit it tomorrow afternoon (unless
exam grading takes longer than I expect), if nobody complains; and
I'll be spending all day Thursday doing GDB stuff as well, so I'll be
available if I accidentally break anything...
David Carlton
carlton@math.stanford.edu
next prev parent reply other threads:[~2003-06-10 16:43 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <ro1k7dbwprh.fsf@jackfruit.Stanford.EDU>
2003-05-01 3:37 ` Eli Zaretskii
2003-05-01 21:15 ` David Carlton
2003-05-20 3:58 ` David Carlton
2003-06-09 22:39 ` Elena Zannoni
2003-06-09 22:55 ` Daniel Jacobowitz
2003-06-10 0:05 ` Joel Brobecker
2003-06-10 0:24 ` Elena Zannoni
2003-06-10 15:58 ` David Carlton
2003-06-10 16:43 ` David Carlton [this message]
2003-06-10 18:37 ` Elena Zannoni
2003-06-10 18:47 ` David Carlton
2003-06-11 1:20 ` Richard Henderson
2003-06-11 23:33 ` David Carlton
2003-06-13 0:15 ` Joel Brobecker
2003-06-13 0:52 ` 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=ro1n0gp6fyf.fsf@jackfruit.Stanford.EDU \
--to=carlton@math.stanford.edu \
--cc=ezannoni@redhat.com \
--cc=gdb-patches@sources.redhat.com \
--cc=jimb@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