Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Automating GDB using perl script

by perl_sck_58 (Novice)
on May 07, 2015 at 06:50 UTC ( [id://1125957]=perlquestion: print w/replies, xml ) Need Help??

perl_sck_58 has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks,

I am trying to automate gdb debugging session using Perl script.
What exactly I want to do in the script is, send a command to gdb then read its response, again send a command to gdb and then read the response, and this continues.
Are there any modules that will help me do it? I tried using IPC::Open2 but I faced problems in output buffering.
Note: I am using Windows and dont want to install cygwin. Please help

Thanks in Advance

Replies are listed 'Best First'.
Re: Automating GDB using perl script
by BrowserUk (Patriarch) on May 07, 2015 at 08:03 UTC

    Try Win32::Socketpair::winopen2().


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority". I'm with torvalds on this
    In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked
Re: Automating GDB using perl script
by pme (Monsignor) on May 07, 2015 at 07:35 UTC
Re: Automating GDB using perl script
by Anonymous Monk on May 07, 2015 at 22:55 UTC

    Possibly related: Using Perl to automate GDB.

    From the looks of it, gdb has support for python scripting in the native interface. There's also a custom protocol to talk to remote debugging agents (gdbserver). And there should be gui front-ends for windows, too.

    So, a number of alternatives, a number of tools that could potentially be instrumented with perl. Though these noble endeavors may involve some significant effort. :)

    If a simple terminal session is sufficient for your needs, consider rephrasing the question a la "How does one use ssh and expect to run an interactive program somewhere ..."

Re: Automating GDB using perl script
by Anonymous Monk on May 07, 2015 at 07:33 UTC

    IPC::Open2 but I faced problems in output buffering.

    What kind of problems ?

Re: Automating GDB using perl script
by GotToBTru (Prior) on May 07, 2015 at 14:48 UTC

    I'm curious why you would want to automate debugging?

    Dum Spiro Spero

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1125957]
Approved by GotToBTru
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (7)
As of 2024-04-24 20:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found