This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: Pipe question
- From: "Eli Zaretskii" <eliz at is dot elta dot co dot il>
- To: a2782 at dis dot ulpgc dot es
- Cc: gdb at sources dot redhat dot com
- Date: Wed, 04 Dec 2002 18:17:24 +0300
- Subject: Re: Pipe question
- References: <200212041436.gB4EaaP03992@siglo21.dis.ulpgc.es>
- Reply-to: Eli Zaretskii <eliz at is dot elta dot co dot il>
> Date: Wed, 4 Dec 2002 14:36:36 GMT
> From: a2782@dis.ulpgc.es
>
> system(strcat(\"gdb --quiet -f \",executable));
I hope this is not your actual code: you cannot strcat onto a
constant string. It's a bug.
> But when I close the program, I only write \"quit\\n\" to togdb[1]. This
> causes that the program doesn\'t end properly (GDB, which is the child
> process, ends well). I have to go and type \"kill\" in a console. Could
> anybody tell me what instructions I have to put in the end of the
> program in order to finish it succesfully (without kill)?
When you give GDB the `quit' command, it asks whether to kill the
program being debugged; you need to respond with "yes". So something
like "quit\nyes\n" should do the trick (but I didn't actually try
this, so I might miss something).