/talk-to-gdb-mi

A Simple API for GNU debugger's Machine Interface (GDB/MI).

Primary LanguageJavaScript

A Simple API for GNU debugger's Machine Interface (GNU/MI).

⚠️ DEPRECIATED IN FAVOR OF ANOTHER LIGHTWEIGHT IMPLEMENTATION ,TALK-TO-GDB

What does this library enable?

  • built in parsing
  • pattern based message filter

Usage

/*** Get a GDB/MI instance ***/
const {init}=require('./')

const debuggee='./a.out'

//optinally,pass a debuggee
const gdb=await init(debuggee)

/*** Listen for any message with a pattern ***/
var pattern={
token:(token)=>token===undefined||token<30,
'class':'done'
}
var outstream=gdb.onmessage(pattern)
//stream will get all `done` messages with a token. less then 30 or undefined


/*** Listen to All messages ***/
//outstream is a nodejs stream
var outstream=gdb.onmessage(/**/)


/*** Listen to console output **/
var outstream=gdb.onmessage({'stream-type':'console-stream-output'})

/*** Listen to log output  **/
var outstream=gdb.onmessage({'stream-type':'log-stream-output'})

/*** Listen to all of async type **/
var outstream=gdb.onmessage({'async-type':(a)=>a!==undefined})

.
.
.

DEBUG

  • DEBUG=msgstream:* all logs at important points in stream pipelining
  • DEBUG=msgstream:error
  • DEBUG=msgstream:counter
  • DEBUG=msgstream:matcher
  • DEBUG=msgstream:selfdestruct

References