mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Albert Cahalan" <acahalan@gmail.com>
To: linux-kernel@vger.kernel.org, roland@redhat.com,
	76306.1226@compuserve.com, cwright@cs.sunysb.edu,
	renzo@cs.unibo.it, blaisorblade@yahoo.it, jdike@addtoit.com
Subject: Re: [RFC PATCH 0/4] utrace: new modular infrastructure for user debug/tracing
Date: Mon, 19 Jun 2006 00:44:29 -0400	[thread overview]
Message-ID: <787b0d920606182144q9e4fe00re909df57dd520f39@mail.gmail.com> (raw)

Roland McGrath writes:

> This series of patches revamps the support for user process debugging
> from the ground up, replacing the old ptrace support completely.
>
> Two major problems with ptrace are its interface and its implementation.

Yay!

Having written a debugger for Linux, I can assure everyone that
this is long overdue. We've been putting it off for years because
the code is so horrible and nasty, yet not normally used prior to
the creation of user-mode Linux.

Doing serious work with ptrace() is a horrible joke involving
interfaces that are crufty, undocumented, and insufficient.

BTW: debuggers can't get and set the signal context (with cr2!),
can't get and set LDT entries, don't get events when unshare()
succeeds, can't call ptrace() from any desired thread, can't do
a stop or start that affects more than one task, can't adjust the
target's signal data (handlers,blocked,ignored,etc.), can't adjust
file pointers and flags in the target, etc.

With great difficulty, some of the above can be hacked around by
inserting code into the target and running it. This is horribly
painful. It puts writing a debugger out of reach of many people
who might otherwise have only very basic code insertion needs
or none at all.

> system call interface is clunky to use and to extend, and makes it
> difficult to reduce the overhead of doing several operations and of
> transferring large amounts of data.

See the FreeBSD ptrace() man page. We're just being dumb.

> There is no way for more than one
> party to trace a process.  The reporting model using SIGCHLD and wait4
> is tricky to use reliably from userland, and especially hard to
> integrate with other kinds of event loop.

We needlessly make wait4/waitid/waitpid fail to accept
equivalent flags. (some may need to be inverted sense)

We don't appear to have any way to get these events into a
select() or poll(). We could use this even for non-debugger apps.

             reply	other threads:[~2006-06-19  4:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-19  4:44 Albert Cahalan [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-06-15 22:58 Chuck Ebbert
2006-06-16 14:42 ` Frank Ch. Eigler
2006-06-21 13:49   ` Daniel Jacobowitz
2006-06-19 10:35 ` Roland McGrath
2006-06-13 23:10 Roland McGrath

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=787b0d920606182144q9e4fe00re909df57dd520f39@mail.gmail.com \
    --to=acahalan@gmail.com \
    --cc=76306.1226@compuserve.com \
    --cc=blaisorblade@yahoo.it \
    --cc=cwright@cs.sunysb.edu \
    --cc=jdike@addtoit.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=renzo@cs.unibo.it \
    --cc=roland@redhat.com \
    /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

all inboxes | Powered by JetHome®