Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michael Snyder <msnyder@vmware.com>
To: Stan Shebs <stan@codesourcery.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [RFC] Observer mode
Date: Thu, 29 Apr 2010 18:12:00 -0000	[thread overview]
Message-ID: <4BD9CC1D.9040104@vmware.com> (raw)
In-Reply-To: <4BD9C057.9090805@codesourcery.com>

Stan Shebs wrote:
> Here is another patch that pushes the envelope a bit, and for which I 
> would like to get some prior agreement that it's a good idea.
> 
> The basic idea here is that GDB is to be used to look at targets 
> installed in the field and in use.  In such a situation it may connect 
> to the target and examine state, but not alter that state or interrupt 
> anything.  In our particular target, tracing is allowed, but only using 
> fast tracepoints, because they are done using jumps and thus act as if 
> they were part of the program; taking a trap, even for a slow 
> tracepoint, disrupts thread execution unacceptably.  We have been 
> calling this "observer mode", and the customer's GDB is actually 
> configured to launch in this mode, to reduce the chance of accidental 
> stopping - the debugger user has to ask specifically to change it to 
> normal debugging mode.
> 
> The patch for this is conceptually straightforward, merely introducing a 
> set of user-settable variables, such as may-write-memory, which gate all 
> user attempts to write memory, being tested at the target vector level.  
> Later patches in the series add a "set observer" variable which 
> set/clears all of the individual permissions together, and also ensure 
> that non-stop mode is on.
> 
> Although enabling/disabling at the target vector is somewhat brute 
> force, it seems to work reasonably well in practice; GDB doesn't get 
> knotted into weird states, and the error messages from failed 
> modification attempts (direct or indirect) are reasonable.
> 
> If people like this idea, I'll update the old patch and resubmit.

How different is this from async mode?

> 2009-05-19  Stan Shebs  <stan@codesourcery.com>
>  
>     * target.h (target_insert_breakpoint): Change macro to function.
>     (target_remove_breakpoint): Ditto.
>     (target_stop): Ditto.
>     * target.c (may_write_registers): New global.
>     (may_write_memory): New global.
>     (may_insert_breakpoints): New global.
>     (may_insert_tracepoints): New global.
>     (may_insert_fast_tracepoints): New global.
>     (may_stop): New global.
>     (target_xfer_partial): Test for write permission.
>     (target_store_registers): Ditto.
>     (target_insert_breakpoint): New function.
>     (target_remove_breakpoint): New function.
>     (target_stop): New function.
>     (_initialize_targets): Add new set/show variables.
>     * tracepoint.c (download_target): Check permission,
>     return a success/fail result.
>     (trace_start_command): Don't start tracing if no
>     tracepoints were downloaded.
> 
>     gdb/doc/
>     * gdb.texinfo (Observation Mode): New section.
> 


  parent reply	other threads:[~2010-04-29 18:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-29 17:23 Stan Shebs
2010-04-29 17:54 ` Eli Zaretskii
2010-04-29 18:12 ` Michael Snyder [this message]
2010-04-30  3:19   ` Stan Shebs
2010-04-30 18:21 ` Tom Tromey

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=4BD9CC1D.9040104@vmware.com \
    --to=msnyder@vmware.com \
    --cc=gdb-patches@sourceware.org \
    --cc=stan@codesourcery.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