9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] multiprocess truss
@ 2001-10-22 20:20 rog
  2001-10-23  2:43 ` Bruce Janson
  0 siblings, 1 reply; 2+ messages in thread
From: rog @ 2001-10-22 20:20 UTC (permalink / raw)
  To: 9fans

> Have a look at how the truss code in acid handles the hang bit
> and I think you'll find it's not too hard to do what you want.  Truss
> deliberately avoids doing what you're asking because otherwise
> programs like rc, mk, etc. are a true pain to truss.

i'd looked at (and tried) leaving the hang bit set; unfortunately, a
new process hangs only on exec, not on fork, which isn't good enough
for truss/trump which both need to be able to set up breakpoints
before the new process has executed a line of code.

i have a feeling it's not possible without a kernel change.

  rog.



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [9fans] multiprocess truss
  2001-10-22 20:20 [9fans] multiprocess truss rog
@ 2001-10-23  2:43 ` Bruce Janson
  0 siblings, 0 replies; 2+ messages in thread
From: Bruce Janson @ 2001-10-23  2:43 UTC (permalink / raw)
  To: 9fans

In article <20011022200738.1D713199E8@mail.cse.psu.edu> you write:
>> Have a look at how the truss code in acid handles the hang bit
>> and I think you'll find it's not too hard to do what you want.  Truss
>> deliberately avoids doing what you're asking because otherwise
>> programs like rc, mk, etc. are a true pain to truss.
>
>i'd looked at (and tried) leaving the hang bit set; unfortunately, a
>new process hangs only on exec, not on fork, which isn't good enough
>for truss/trump which both need to be able to set up breakpoints
>before the new process has executed a line of code.
>
>i have a feeling it's not possible without a kernel change.
..

I am unfamiliar with the most recent plan9 tracing support but I
recently bumped into the analogous feature under linux...
There (and perhaps in other ptrace()-based systems?) they seem to
have chosen the wrong default: tracing is not inherited across
fork()s.  This means that under linux one must overwrite the
text of a process as it enters a fork() so that the child (and
the parent uninterestingly) either breakpoint trap or loop until
reattached to by the tracer.  The tracer then restores the
overwritten text and continues both.

The other default would have been nicer: tracing is inherited
until explicitly cleared.  Then tracers would need to know less
about the instruction set of the target architecture (and over-
writing text is, aside from being gross, fragile if interrupted).

But it sounds as though plan9 may have chosen the same default.
If so I would be interested to hear why.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-10-23  2:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-10-22 20:20 [9fans] multiprocess truss rog
2001-10-23  2:43 ` Bruce Janson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).