From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15890 invoked by alias); 20 Jan 2003 15:32:59 -0000 Mailing-List: contact insight-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: insight-owner@sources.redhat.com Received: (qmail 15754 invoked from network); 20 Jan 2003 15:32:59 -0000 Received: from unknown (HELO touchme.toronto.redhat.com) (172.16.49.200) by 172.16.49.205 with SMTP; 20 Jan 2003 15:32:59 -0000 Received: from redhat.com (tooth.toronto.redhat.com [172.16.14.29]) by touchme.toronto.redhat.com (Postfix) with ESMTP id 2DA8B800086; Mon, 20 Jan 2003 10:32:58 -0500 (EST) Message-ID: <3E2C1BA5.2040900@redhat.com> Date: Mon, 20 Jan 2003 15:32:00 -0000 From: Fernando Nasser Organization: Red Hat Canada User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020607 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Achim Bursian Cc: insight@sources.redhat.com, gdb@sources.redhat.com Subject: Re: Find out if GUI active in .gdbinit References: <3E2884ED.50F6AF9D@bigfoot.de> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-q1/txt/msg00028.txt.bz2 Achim Bursian wrote: > Hello, > how can I find out if the GUI (Insight) is running while executing > .gdbinit. I want to take different steps when -nw is given (especially > issue some tk commands if Insight is active). > Nothing that I can remember off the top of my head. But it would be a good idea to set a gdb convenience variable $nw so one could perform this test. Maybe you should open a bug report (enhancement request) for that. Another thing, we could make insight look for a .insightinit before going to .gdbinit (similar to what the bash shell does). > And secondly, how can I source a gdb commandfile only if it exists? > Something like > if file exists $HOME/second.gdb > source $HOME/second.gdb > endif > > What is the way to do this in gdb (within .gdbinit)? > Alias the gdb command to a shell script that checks for the file existence and calls gdb with the appropriate -x flag argument. You can do it two ways: Specify -n to skip .gdbinit processing and make -x point to one file (including the extra commands) or another (with just the smaller set). Or leave the .gdbinit in place (no -n) and use -x for the second.gdb file. Mind that .gdbinit is executed before the -x specified one. Hope that helps. -- Fernando Nasser Red Hat Canada Ltd. E-Mail: fnasser@redhat.com 2323 Yonge Street, Suite #300 Toronto, Ontario M4P 2C9