Re: [Dpcl-develop] bcreate - stdout and stdin callbacks
Brought to you by:
dpcl-admin,
dwootton
|
From: Dave W. <dwo...@us...> - 2005-02-28 14:19:21
|
Steve
I wrote a simple DPCL client that creates an instance of the 'hello'
sample. The hello sample just prints '.' to stdout forever. When the
client is run, the stdout output is sent to the stdout callback I
established and not to any file. This works with the Linux BPatch
implementation. Can you try this with the dyninst implementation to see if
it works? if not, it seems something is going on within dyninst to affect
this.
Dave
#include <dpcl.h>
#include <stdio.h>
void stdout_cb(GCBSysType sys, GCBTagType tag, GCBObjType obj, GCBMsgType
msg)
{
printf("stdout received %s\n", msg);
}
void stderr_cb(GCBSysType sys, GCBTagType tag, GCBObjType obj, GCBMsgType
msg)
{
printf("stderr received %s\n", msg);
}
int main(int argc, char *argv[])
{
AisStatus sts;
Process *p;
Ais_initialize();
p = new Process();
sts = p->bcreate("netfin06", "/home/wootton/test/samples/hello/hello",
// <-- Change these to match your system and target path
NULL, NULL, stdout_cb, (void *) 1, stderr_cb, (void *)
2);
if (sts.status() == ASC_success) {
p->bstart();
}
else {
printf("Create failed: %s\n", sts.status_name());
}
Ais_main_loop();
}
Steve Collins <sl...@sg...>
Sent by: dpc...@li...
02/25/2005 02:20 PM
To
dpc...@li...
cc
sl...@sg...
Subject
[Dpcl-develop] bcreate - stdout and stdin callbacks
Greetings, everyone. The Open/SpeedShop project at SGI has come
across a <perceived> problem with the ability to specify callbacks
for 'stdout' and 'stderr' at the time of 'bcreating' a new mutatee.
Despite our best efforts, it appears that both stdout and stderr
are redirected to 'dpcl.nnn.stdout' and 'dpcl.nnn.stderr' files. What
we <think> we would like to see if we specify ONLY callback functions
in the mutator for both stderr and stdout, and we do NOT specify any
remote filenames, is that the mutator will be fed stdout I/O from
the mutatee into its specified function entry point (e.g. stdout_cb)
and stderr I/O from the mutatee into its specified callback function
in the mutator (e.g. stderr_cb). The code in ProcessD::create, however,
only seems to 'pipe' things into existing <dpcld> fd's for stdout
and stderr (i.e. the dpcl.nnn.stdout/stderr files). AFAICT there is
not attempt to build messages to the mutator(client) consisting of
the mutatee's stdout or stderr output, whichever is in play.
Are we (SGI) misreading the capabilities of this 'bcreate'
feature? It might very well be the case that the Hybrid changes
foul things up because we have already seen one instance of that
occurring with <dpcld> termination messages.
Clues welcome. My clueless DPCL state continues......
SteveC - SGI Compilers/Tools
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Dpcl-develop mailing list
Dpc...@li...
https://lists.sourceforge.net/lists/listinfo/dpcl-develop
|