This is the mail archive of the insight@sources.redhat.com mailing list for the Insight project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[PATCH] Migrate breakpoints to gdb events


Hello,

I am back to the event model stuff. This is my latest set of changes,
which happily coincide with my recent gdbtk-cmds.c diet...

The basics of this patch: move all the breakpoint/tracepoint "hooks" from
gdbtk-hooks.c into gdbtk-bp.c. While we're at it, we will also no longer
use the "hook", since it is not really a hook. It's an event. Gdb already
has some event infrastructure, and we're going to use it from here on
out.

Eventually we will want to convert all of our event "hooks" into real
events using this mechanism. For the uninitiated, IMO, a "hook" is code
which is run INSTEAD of other code (a la fputs_unfiltered_hook and
call_command__hook). An event is simply a notification.

Small aside:
One small snafu with gdb breakpoint events: the breakpoint stuff forces
UIs to keep their own database of breakpoints. I have implemented a simple
one. We should really fix gdb to behave more nicely. Note that we do not
have to do this with tracepoints. They were properly implemented. We use
gdb's database.

Maybe in the future, clear_command and friends can be fixed and this can
all go away. But for now, we're stuck with it.

If you encounter any problems, please let me know.
Keith

CVSROOT:	/cvs/src
Module name:	src
Changes by:	kseitz@sources.redhat.com	2001-05-10 15:34:54

Modified files:
	gdb/gdbtk      : ChangeLog
	gdb/gdbtk/generic: gdbtk-hooks.c gdbtk-bp.c

Log message:
	* generic/gdbtk-bp.c (breakpoint_list, breakpoint_list_size): New
	variables. Gdb is forcing us to maintain our own breakpoint
	database.
	(Gdbtk_Breakpoint_Init): Initialize our breakpoint database.
	(gdb_find_bp_at_addr): Use our breakpoint database.
	(gdb_find_bp_at_line): Ditto.
	(gdb_get_breakpoint_list): Ditto.
	(gdb_get_breakpoint_info): Remove deleted breakpoint hack.
	(gdbtk_create_breakpoint): Moved here from gdbtk-hooks.c.
	Add breakpoint to our breakpoint database.
	(gdbtk_modify_breakpoint): Ditto the move.
	(gdbtk_delete_breakpoint): Ditto the move.
	Remove breakpoint from our database.
	(gdb_get_tracepoint_info): Remove delete tracepoint hack.
	It's not needed for tracepoints: they were implemented properly.
	(gdbtk_create_tracepoint): Moved here from gdbtk-hooks.c.
	(gdbtk_modify_tracepoint): Ditto.
	(gdbtk_delete_tracepoint): Ditto.
	* generic/gdbtk-hooks.c: Include "gdb-events.h".
	(gdbtk_create_breakpoint): Moved to gdbtk-bp.c
	(gdbtk_modify_breakpoint): Ditto.
	(gdbtk_delete_breakpoint): Ditto.
	(breakpoint_notify): Ditto.
	(gdbtk_create_tracepoint): Ditto.
	(gdbtk_modify_tracepoint): Ditto.
	(gdbtk_delete_tracepoint): Ditto.
	(tracepoint_notify): Ditto.
	(report_error): No longer static.
	(gdbtk_add_hooks): Create our own event handler
	vector and register breakpoint_create, breakpoint_modify,
	and breakpoint_delete handlers in gdbtk-bp.c.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gdb/gdbtk/ChangeLog.diff?cvsroot=src&r1=1.74&r2=1.75
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gdb/gdbtk/generic/gdbtk-hooks.c.diff?cvsroot=src&r1=1.12&r2=1.13
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gdb/gdbtk/generic/gdbtk-bp.c.diff?cvsroot=src&r1=1.1&r2=1.2



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]