This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [WIP] TI msp430 CIO support


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: signature.asc
Description: This is a digitally signed message part.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]