Typed event channels overview
- From: Martin Baulig <martin home-of-linux org>
- To: gnome-debugger-list gnome org
- Subject: Typed event channels overview
- Date: 02 Nov 1999 01:19:14 +0100
Hello,
I got some very first version of the typed events stuff working - and it's
already late at night, so just a few notes:
* you may need to start
[gnome-debug/sesion-manager] ./gdf-session-manager --activate-goad-server gnome_debugger_session_manager --disable-crash-dialog
by hand, for some reason it core dumps sometimes when started automatically
* after that, start
[ggdb/commander-factory] ./gdb-guile-program-factory --activate-goad-server gnome_debugger_program_gdb_guile_factory
in another xterm (to see the debugging messages).
* and finally, we use the gnome-debug/guile/test.scm to actually start
the commander and send the event:
[gnome-debug/guile] guile -l test.scm
=============================================================================
Basically, this `test.scm' does all the work for us:
----
(use-modules (gnome debugger))
(define manager (gnome-debugger-session-manager-init '()))
(define id (gnome-debugger-session-manager-create-session manager "gdb-guile" '("gdb-guile")))
(define program (gnome-debugger-session-manager-activate-session manager id))
(gnome-debugger-program-execute program '("foo" "bar"))
-----
It does the session manager stuff, gets a GNOME_Debugger_Program object
and then calls GNOME_Debugger_Program_execute ().
The actual typed event channel stuff is done in
impl_GNOME_Debugger_Program__create ():
----
newservant->typed_event_channel =
goad_server_activate_with_id (NULL,
"gnome_debugger_typed_event_channel",
0,
NULL);
fprintf (stderr, "Got typed event channel %p\n",
newservant->typed_event_channel);
newservant->typed_supplier_admin =
CosTypedEventChannelAdmin_TypedEventChannel_for_suppliers
(newservant->typed_event_channel, ev);
fprintf (stderr, "Got typed supplier admin %p\n",
newservant->typed_supplier_admin);
newservant->typed_consumer_admin =
CosTypedEventChannelAdmin_TypedEventChannel_for_consumers
(newservant->typed_event_channel, ev);
fprintf (stderr, "Got typed consumer admin %p\n",
newservant->typed_consumer_admin);
newservant->typed_proxy_push_consumer =
CosTypedEventChannelAdmin_TypedSupplierAdmin_obtain_typed_push_consumer
(newservant->typed_supplier_admin, "program-events", ev);
fprintf (stderr, "Got typed proxy push consumer %p\n",
newservant->typed_proxy_push_consumer);
typed_consumer =
CosTypedEventChannelAdmin_TypedProxyPushConsumer_get_typed_consumer
(newservant->typed_proxy_push_consumer, ev);
fprintf (stderr, "Got typed push consumer %p\n", typed_consumer);
repo_id = CORBA_TypeCode_id (&TC_GNOME_Debugger_ProgramEvents_struct, ev);
correct = CORBA_Object_is_a (typed_consumer, repo_id, ev);
fprintf (stderr, "CORBA_Object_is_a (%p,%s) = %d\n",
typed_consumer, repo_id, correct);
if (correct)
newservant->program_events_object =
(GNOME_Debugger_ProgramEvents) typed_consumer;
----
We'll end up having a GNOME_Debugger_ProgramEvents object which is defined
like this:
----
interface ProgramEvents {
void execute (in long serial, in arg_list args);
oneway void execute_response (in long serial, in Process process);
oneway void execute_error (in long serial, in string error_message);
oneway void execute_timeout (in long serial);
};
----
Now, impl_GNOME_Debugger_Program_execute () sends a typed event by
calling
----
GNOME_Debugger_ProgramEvents_execute (servant->program_events_object,
1, args, ev);
----
After that, it should wait for a `execute_response' or `execute_error'
event on the channel, but that's not yet written.
=============================================================================
Currently, GNOME_Debugger_ProgramEvents_execute () will end up in a function
like this:
----
static void
impl_GNOME_Debugger_ProgramEvents_execute (impl_POA_GNOME_Debugger_ProgramEvents * servant, CORBA_long serial, GNOME_Debugger_arg_list * args, CORBA_Environment * ev)
{
GNOME_Debugger_PrivateProgramEvents_execute buf;
CORBA_any any;
buf.serial = serial;
buf.args = *args; /* fixme: refcounting */
any._value = &buf;
any._type = (struct CORBA_TypeCode_struct *)
&TC_GNOME_Debugger_PrivateProgramEvents_execute_struct;
CORBA_any_set_release (&any, CORBA_FALSE);
fprintf (stderr, "impl_GNOME_Debugger_ProgramEvents_execute - %p - %ld - %p\n",
servant, serial, args);
CosEventComm_PushConsumer_push (servant->push_consumer, &any, ev);
}
----
But this is only a temporary solution until we have a better marhalling/
demarshalling concept which will create stubs like this automatically
(and we won't need the temporary GNOME_Debugger_PrivateProgramEvents_*
structures).
--
Martin Baulig - martin@home-of-linux.org - http://www.home-of-linux.org
[Date Prev][
Date Next] [Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]