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

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

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -