launch gdb and print out variable value using ruby -


i want write ruby program inspect variable value of program launch gdb , print value. how achieve this?

if in shell, :

  shell > gdb test   [...gbd started]   (gdb) p variable   $1 = 20   (gdb)  

i hear other ways can achieve same goal, not necessaliy use gdb.

try open4, allows open stdin, stdout, stderr arbitrary command. use open4 run gdb describe, have done , works quite nicely. might want create wrapper class handles running commands , returning status, open4 gives file handles.


Comments

Popular posts from this blog

ruby - When to use an ORM (Sequel, Datamapper, AR, etc.) vs. pure SQL for querying -

php - PHPDoc: @return void necessary? -

c++ - Convert big endian to little endian when reading from a binary file -