Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!think.com!barmar From: barmar@think.com (Barry Margolin) Newsgroups: comp.windows.x Subject: Re: How do you use an Xterm with a debugger Message-ID: <1991Mar17.072157.19385@Think.COM> Date: 17 Mar 91 07:21:57 GMT References: <1991Mar13.011536.17184@motcad.portal.com> <1991Mar14.072808.20247@Think.COM> <1991Mar15.074424.857@servalan.uucp> Sender: news@Think.COM Organization: Thinking Machines Corporation, Cambridge MA, USA Lines: 24 In article <1991Mar15.074424.857@servalan.uucp> rmtodd@servalan.uucp (Richard Todd) writes: >barmar@think.com (Barry Margolin) writes: >>In article <1991Mar13.011536.17184@motcad.portal.com> jtc@motcad.portal.com (J.T. Conklin) writes: >>>I would like to be able to open an Xterm so I can redirect terminal output >>>to it from within gdb. >>Why don't you just run gdb from the xterm window? >Uh, I think you've misinterpreted slightly what the original poster's >after. Yes, I did. However, a variant on my response is still applicable. Gdb has an "attach" command that allows it to be used to debug a process that is already running, rather than running the application in a subprocess. So, you could start up the application in one xterm, run gdb in another xterm, and then attach gdb to the application process. The only problem with this approach is that you can't set breakpoints before starting the application, so if the buggy area of the program is run early you may not be able to attach quickly enough. -- Barry Margolin, Thinking Machines Corp. barmar@think.com {uunet,harvard}!think!barmar