From: Daniel Jacobowitz <drow@false.org>
To: Nick Roberts <nickrob@snap.net.nz>
Cc: Bob Rossi <bob@brasko.net>, gdb-patches@sources.redhat.com
Subject: Re: [PATCH] Hooks still needed for annotations
Date: Sun, 03 Jul 2005 17:03:00 -0000 [thread overview]
Message-ID: <20050703170255.GD13811@nevyn.them.org> (raw)
In-Reply-To: <17057.7583.990091.951816@farnswood.snap.net.nz>
On Sat, Jun 04, 2005 at 03:18:55PM +1200, Nick Roberts wrote:
> > The way to prevent them from being removed again is to add test cases.
>
> OK, I've done this. Running the tests revealed a small bug with
> "set annotate" -- it didn't call _initialize_annotate to set the hooks.
> This must be why the tests didn't fail when the hooks were removed in the
> first place.
>
> I've only tested for breakpoints-invalid annotations when breakpoints
> have been deleted as I could simply adapt existing tests. They should
> also be present when breakpoints are enabled/disabled. However, this test
> should be sufficient to prevent the inadvertant removal of the hooks.
OK, having answered the rest of the side topics in this discussion I
now come to the actual patch...
Having reread the discussion I would like to ask you what your goal is
with this patch. You don't use this annotation, and you've said that
it is very awkward to use because of the amount of output it produces.
Why should we fix it (as opposed to garbage collecting it) if no one
has missed it?
About the patch:
> *** /home/nick/src/gdb/event-top.c.~1.40.~ 2005-03-17 12:23:51.000000000 +1300
> --- /home/nick/src/gdb/event-top.c 2005-06-04 14:36:37.000000000 +1200
> ***************
> *** 43,48 ****
> --- 43,50 ----
> /* readline defines this. */
> #undef savestring
>
> + extern void _initialize_annotate (void);
> +
> static void rl_callback_read_char_wrapper (gdb_client_data client_data);
> static void command_line_handler (char *rl);
> static void command_line_handler_continuation (struct continuation_arg *arg);
No extern prototypes. If you need to call a function from another
file, it should be defined in a header, and the header should be
included in both the defining and using files. That's the only way in
C we can make sure that argument mismatch does not creep in. Also,
please move this into a new function if you want it to be called other
than from init.c; the _initialize_* functions are magic.
> *** /home/nick/src/gdb/interps.c.~1.15.~ 2005-04-26 21:44:15.000000000 +1200
> --- /home/nick/src/gdb/interps.c 2005-06-04 15:12:16.000000000 +1200
> ***************
> *** 326,333 ****
> deprecated_query_hook = 0;
> deprecated_warning_hook = 0;
> deprecated_create_breakpoint_hook = 0;
> - deprecated_delete_breakpoint_hook = 0;
> - deprecated_modify_breakpoint_hook = 0;
> deprecated_interactive_hook = 0;
> deprecated_registers_changed_hook = 0;
> deprecated_readline_begin_hook = 0;
> --- 326,331 ----
deprecated_create_breakpoint_hook is now set nowhere.
deprecated_delete_breakpoint_hook and deprecated_modify_breakpoint_hook
are set only by annotations. There's a total of three call sites
between the two hooks. And each of those takes up more screen real
estate than a call to breakpoints_changed, which is what they
eventually become.
The comments in mention() suggest that at one time, GDB was trying to
move away from breakpoints_changed to a more specific set of hooks.
But now the hooks are more or less dead, and to get full mileage out of
them they're going to need a redesign. So maybe we should just delete
all three hooks, and replace the two that annotations use with
calls to breakpoints_changed.
--
Daniel Jacobowitz
CodeSourcery, LLC
next prev parent reply other threads:[~2005-07-03 17:03 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-01 7:15 Nick Roberts
2005-06-01 11:30 ` Bob Rossi
2005-06-01 21:31 ` Nick Roberts
2005-06-03 19:09 ` Daniel Jacobowitz
2005-06-03 22:35 ` Nick Roberts
2005-06-03 23:59 ` Daniel Jacobowitz
2005-06-04 3:19 ` Nick Roberts
2005-07-03 17:03 ` Daniel Jacobowitz [this message]
2005-07-03 22:13 ` Nick Roberts
2005-07-03 22:44 ` Daniel Jacobowitz
2005-06-04 13:02 ` Bob Rossi
2005-06-13 3:14 ` Daniel Jacobowitz
2005-06-15 15:52 ` Bob Rossi
2005-06-15 16:07 ` Daniel Jacobowitz
2005-06-15 16:31 ` Bob Rossi
2005-07-03 16:45 ` Daniel Jacobowitz
2005-06-15 23:07 ` Nick Roberts
2005-06-15 23:29 ` Bob Rossi
2005-07-01 0:21 ` Bob Rossi
2005-07-01 1:18 ` Nick Roberts
2005-06-06 21:57 ` Nick Roberts
2005-06-10 2:26 ` Bob Rossi
2005-06-10 3:25 ` Nick Roberts
2005-06-15 15:24 ` Bob Rossi
2005-06-15 21:38 ` Nick Roberts
2005-06-15 22:58 ` Bob Rossi
2005-07-03 16:39 ` Daniel Jacobowitz
2005-07-06 15:03 ` Bob Rossi
2005-07-15 0:03 ` Daniel Jacobowitz
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=20050703170255.GD13811@nevyn.them.org \
--to=drow@false.org \
--cc=bob@brasko.net \
--cc=gdb-patches@sources.redhat.com \
--cc=nickrob@snap.net.nz \
/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