From: Tom Tromey <tromey@redhat.com>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: RFA: Patch: implement missing macro functions
Date: Sat, 24 May 2008 16:34:00 -0000 [thread overview]
Message-ID: <m31w3sls31.fsf@fleche.redhat.com> (raw)
In-Reply-To: <200805232030.20677.pedro@codesourcery.com> (Pedro Alves's message of "Fri\, 23 May 2008 20\:30\:20 +0100")
>>>>> "Pedro" == Pedro Alves <pedro@codesourcery.com> writes:
Pedro> You'll need someone else to comment on the big picture -- I'll
Pedro> comment on a few strokes, below,
Thanks for taking the time to do this.
>> + cleanup_chain = make_my_cleanup (&cleanup_chain, free_current_contents,
>> + &name);
Pedro> That is a big nop to write + with 2 leaks attached. The new cleanup is
Pedro> being discarded and leaked, so NAME isn't being free'd at all.
Pedro> Don't call make_my_cleanup directly. Instead, call
Pedro> make_cleanup and discard its result:
Ok, thanks. I forgot to mention in my note that I wanted someone to
look at this. I don't actually understand the cleanup mechanism... I
looked a bit but didn't see any documentation on how to use it.
>> + gdb_flush (gdb_stdout);
Pedro> Did you really need a gdb_flush here?
Probably not. I'll remove it and see.
>>
>> +/* Helper function for macro_for_each. */
>> +static int
>> +foreach_macro (splay_tree_node node, void *fnp)
>> +{
>> + macro_callback_fn fn = (macro_callback_fn) fnp;
Pedro> (Hmmm, can we assume casting void* <-> func pointers is safe on all
Pedro> supported hosts/compilers? Posix and Windows do require it to
Pedro> be safe. I actually have no idea how much GDB common code relies
Pedro> on it today.)
I'll just fix it.
Pedro> Would it make sense to have a test with macro arguments, and
Pedro> a test where a user macro overrides a source macro?
Yeah. Lazy me! I will add those.
Tom
next prev parent reply other threads:[~2008-05-23 19:53 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-21 4:50 Tom Tromey
2008-05-24 15:42 ` Pedro Alves
2008-05-24 16:34 ` Tom Tromey [this message]
2008-05-25 12:37 ` Tom Tromey
2008-05-25 18:03 ` Eli Zaretskii
2008-05-25 21:51 ` Tom Tromey
2008-05-26 16:18 ` Eli Zaretskii
2008-05-26 16:25 ` Tom Tromey
2008-05-25 20:39 ` Pedro Alves
[not found] ` <8f2776cb0805301626v4ff4d933ua6b833aaa7056aaa@mail.gmail.com>
2008-06-06 0:22 ` Tom Tromey
2008-07-18 20:01 ` Daniel Jacobowitz
2008-07-18 20:56 ` Tom Tromey
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=m31w3sls31.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=pedro@codesourcery.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