hgdbmi-0.1: GDBMI interface (program-driven control of GDB)



GDB/MI lets programs drive GDB. It can be used, for example, by GDB frontends. This module wraps attaching GDB to a process and parsing the (surprisingly complicated) GDB/MI output.



data GDB Source

A connection to a GDB process.



:: Maybe FilePath

Working directory for GDB. (Important if the process has loaded libraries from relative paths.)

-> ProcessID 
-> IO (Either String (GDB, MIOutput)) 

Attach to a process, returning an error or the GDB connection and its initial output.

detach :: GDB -> IO ()Source

Close a GDB connection.

runCommand :: GDBCommand -> GDB -> IO (Either String MIOutput)Source

Run a GDB command.

data GDBCommand Source

A GDB command. CLICommand is any command you'd normally type at the GDB prompt. MICommand are more machine-parsing friendly commands; see the GDB/MI docs for details.


CLICommand String 
MICommand String

TODO: expand this to support arguments.

data MIOutput Source

The output of running a GDB command. Output is a collection of Out-Of-Band messages (such as logging information) and an optional final result.


MIOutput [MIOOB] (Maybe MIResult) 


data MIOOB Source

The type of OOB mesages. (TODO: many of these aren't properly parsed yet.)


MIStatus String

Contains on-going status information about the progress of a slow operation.

MIExec String

Contains asynchronous state change on the target (stopped, started, disappeared).

MINotify String

Contains supplementary information that the client should handle (e.g., a new breakpoint information).

MIConsole String

Output that should be displayed as is in the console. It is the textual response to a CLI command.

MITarget String

The output produced by the target program.

MILog String

Output text coming from GDB's internals, for instance messages that should be displayed as part of an error log.


data MIResult Source

The type of the GDB result. (TODO: many result types aren't implemented yet.)


MIDone [MIKeyVal]

The synchronous operation was successful, along with potential key-value return data.

MIError String

The operation failed. The string contains the corresponding error message.


type MIKeyVal = (String, MIValue)Source

A key-value pair output from GDB.

data MIValue Source

The type of a GDB value, used in the output of structured data.


MIString String 
MITuple [MIKeyVal]