Whole document tree
    

Whole document tree

Debugging with GDB: GDB/MI Simple Examples
[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

19.1.3 Simple Examples of GDB/MI Interaction

This subsection presents several simple examples of interaction using the GDB/MI interface. In these examples, `->' means that the following line is passed to GDB/MI as input, while `<-' means the output received from GDB/MI.

Target Stop

Here's an example of stopping the inferior process:

 
-> -stop
<- (gdb)

and later:

 
<- *stop,reason="stop",address="0x123",source="a.c:123"
<- (gdb)

Simple CLI Command

Here's an example of a simple CLI command being passed through GDB/MI and on to the CLI.

 
-> print 1+2
<- ~3\n
<- (gdb)

Command With Side Effects

 
-> -symbol-file xyz.exe
<- *breakpoint,nr="3",address="0x123",source="a.c:123"
<- (gdb)

A Bad Command

Here's what happens if you pass a non-existent command:

 
-> -rubbish
<- error,"Rubbish not found"
<- (gdb)



This document was generated by root on January, 30 2002 using texi2html