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
- attach :: Maybe FilePath -> ProcessID -> IO (Either String (GDB, MIOutput))
- detach :: GDB -> IO ()
- runCommand :: GDBCommand -> GDB -> IO (Either String MIOutput)
- data GDBCommand
- data MIOutput = MIOutput [MIOOB] (Maybe MIResult)
- data MIOOB
- data MIResult
- type MIKeyVal = (String, MIValue)
- data MIValue
- parse :: SourceName -> [Char] -> Either ParseError MIOutput
Documentation
:: 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.
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. |
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.
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. |
The type of the GDB result. (TODO: many result types aren't implemented yet.)
The type of a GDB value, used in the output of structured data.
parse :: SourceName -> [Char] -> Either ParseError MIOutputSource