From: Fernando Nasser <fnasser@redhat.com>
To: Achim Bursian <bursian@bigfoot.de>
Cc: insight@sources.redhat.com, gdb@sources.redhat.com
Subject: Re: Find out if GUI active in .gdbinit
Date: Mon, 20 Jan 2003 15:32:00 -0000 [thread overview]
Message-ID: <3E2C1BA5.2040900@redhat.com> (raw)
In-Reply-To: <3E2884ED.50F6AF9D@bigfoot.de>
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
prev parent reply other threads:[~2003-01-20 15:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-01-17 22:34 Achim Bursian
2003-01-20 15:32 ` Fernando Nasser [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3E2C1BA5.2040900@redhat.com \
--to=fnasser@redhat.com \
--cc=bursian@bigfoot.de \
--cc=gdb@sources.redhat.com \
--cc=insight@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).