Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: gdb-patches@sourceware.org
Cc: Kevin Buettner <kevinb@redhat.com>
Subject: Re: [WIP] TI msp430 CIO support
Date: Fri, 17 May 2013 21:44:00 -0000	[thread overview]
Message-ID: <201305171744.00275.vapier@gentoo.org> (raw)
In-Reply-To: <20130516212358.23f3bcdb@mesquite.lan>

[-- Attachment #1: Type: Text/Plain, Size: 2088 bytes --]

On Friday 17 May 2013 00:23:58 Kevin Buettner wrote:
> I don't intend to commit this patch as is, but I wanted to post it
> because it provides useful functionality for msp430 programming and
> debugging.  I have found it very useful for running the GDB test suite
> because it provides the necessary functionality for printf() and
> write() to work.
> 
> TI has an I/O mechanism used by their compiler and libraries that they
> call CIO.  In a nutshell, it defines a small number of operations
> such as open, close, read, write, plus a few others.  Drivers exist at
> several levels for implementing this functionality.  E.g. there are
> a board level drivers that causes I/O to occur against devices on the
> board.  When the target is connected to a debugger, a debug-based
> driver is available which causes I/O to be performed on the host
> running GDB (or some other debugger).
> 
> The debugger based driver uses a simple breakpoint driven
> implementation.  The debugger places a breakpoint on a known location
> which is always called when debugger-based I/O is to be performed.
> When the breakpoint at that location is hit, the debugger reads the
> details of the system call and its parameters from a memory based
> buffer.  The debugger writes back the output of the system call to the
> same buffer.  (See my patch for the exact details.)

what if you run the simulator w/out a debugger (i.e. ./sim/msp430/run ...) ?  
seems like the answer is "nothing happens" ?

you could have the simulator detect the case when it's running standalone 
(i.e. not via gdb) and patch the symbols to run a custom insn.  maybe hijack 
an opcode that doesn't map to a valid insn and then when your sim hits that, 
see if it's a known cio point.  if it isn't, throw an exception like normal, 
else let the simulator process the cio operation itself.

you could even have this code run when doing a simulation via gdb and it'll 
"just work".  but you might want to keep the behavior in that case the same as 
if you were running it on real hardware.
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  parent reply	other threads:[~2013-05-17 21:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-17  4:24 Kevin Buettner
2013-05-17  6:36 ` Joel Brobecker
2013-05-17  8:43 ` Yao Qi
2013-05-17 21:44 ` Mike Frysinger [this message]
2013-05-17 23:10   ` Kevin Buettner
2013-05-20 14:39 ` Tom Tromey
2013-05-21 16:00   ` Kevin Buettner

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=201305171744.00275.vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=gdb-patches@sourceware.org \
    --cc=kevinb@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