tags:

views:

121

answers:

1

Hi,

I am going to start up gdb from python.

For example:

prog.shell.py:
    #do lots of things
    #
    #
    p.subprocess.Popen("gdb --args myprog", shell=True, stdin=sys.stdin, stdout=sys.stdout)

But the gdb is not invoked as I expected, the interaction with gdb is broken. I have also tried os.system(), but it still doesnt work.

Appreciate for any help.

+3  A: 

I think you meant

p = subprocess.Popen(...)

You probably need to wait for p to finish:

p.wait()
Dave
Yes. It works! Thanks a lot.
limi