From owner-freebsd-questions Thu Jan 28 08:24:26 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id IAA07297 for freebsd-questions-outgoing; Thu, 28 Jan 1999 08:24:26 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from cc942873-a.ewndsr1.nj.home.com (cc942873-a.ewndsr1.nj.home.com [24.2.89.207]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id IAA07274 for ; Thu, 28 Jan 1999 08:24:22 -0800 (PST) (envelope-from cjc@cc942873-a.ewndsr1.nj.home.com) Received: (from cjc@localhost) by cc942873-a.ewndsr1.nj.home.com (8.8.8/8.8.8) id LAA20121; Thu, 28 Jan 1999 11:25:35 -0500 (EST) (envelope-from cjc) From: "Crist J. Clark" Message-Id: <199901281625.LAA20121@cc942873-a.ewndsr1.nj.home.com> Subject: Re: [2nd attempt] Basic help with gdb In-Reply-To: <36B084E5.E4B99645@uk.radan.com> from Mark Ovens at "Jan 28, 99 03:40:21 pm" To: marko@uk.radan.com (Mark Ovens) Date: Thu, 28 Jan 1999 11:25:35 -0500 (EST) Cc: questions@FreeBSD.ORG Reply-To: cjclark@home.com X-Mailer: ELM [version 2.4ME+ PL40 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Mark Ovens wrote, > I didn't get any response the first time I asked this, so I'll try > again. > > I'm trying to learn how to use gdb and can't seem to get the > ``-tty='' option to work. I do not have a fix, but rather just gave this a shot myself. Here's my experience. > OK, I start 2 shell windows, ttyp1 and ttyp2. I have two xterms owned by the same user, ttyp7 and ttyp9. > Start gdb in ttyp1 with ``gdb -tty=/dev/ttyp2 prog''. I hacked up an existing program leaving only the I/O routines (some printf() and scanf()s). Then I started in ttyp7, gdb -tty=/dev/ttyp9 _test_io > I get the ``(gbd)'' prompt. Me too. > Type ``r'' Well, I typed 'run.' ;) > but then get an error in *ttyp2* ``cannot use /dev/tty for input'' > (note it says ``tty'' not ``ttyp2''). Now things differ. The first prompt from my program pops out from behind the shell prompt in ttyp9. It is working. However, I enter some input, and it goes to the shell rather than the program. But the next line of input _does_ go to the program, but there is no local echo of my typing on ttyp9. The program steals the input at ttyp9 from the shell running there until the program exits, when the shell gets control back. The program funtions normally. I guess I'm saying it pretty much works for me. If I really needed to, I could try to figure out a way to get the shell out of the picture and get the local echo. > I'm using shelltool(1) under olvwm for this but I get the same problem > if I use xterms or the console (ttyv[012]). I'm just using xterms under twm (yes, I do like twm). Nothin' fancy. > How do you make this work? Can anyone help? I'm not sure what to tell you... Maybe just check 'ls -l tty{,p*}.' Try to figure out what is different between our systems? -- Crist J. Clark cjclark@home.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message