From: Steffen Dettmer <steffen.dettmer@googlemail.com>
To: "gdb@sourceware.org" <gdb@sourceware.org>
Subject: Re: Detecting when gdb is attached
Date: Wed, 10 Nov 2010 14:57:00 -0000 [thread overview]
Message-ID: <AANLkTi=FUV7eu7UchycWj-oL7QtgoQW6cUrOpF5QZ3K5@mail.gmail.com> (raw)
In-Reply-To: <372C920CA9488345BDECCD4B62FF71D00F717855E5@DEWDFECCR08.wdf.sap.corp>
On Thu, Nov 4, 2010 at 2:40 PM, Gruenhagen, Andreas
<andreas.gruenhagen@sap.com> wrote:
> I'm developing an application which cannot be started from
> within the gdb. Therefore, I have the start the application and
> attach the gdb afterwards. In some cases it would be nice to
> have the application wait in a spin loop until the debugger is
> attached. Is there any way of accomplishing such a thing?
how should the application know whether to enter the wait loop
until gdb is attached or run as usual?
> I thought of having some sort of action which is executed when
> the gdb is attached and detached, this could be for example
> used to switch a static flag in the debugee. Is something like
> this possible ?
via ~/.gdbinit for example you could simply try:
print some_sort_of_action()
to invoke the function some_sort_of_action in the application
maybe?
oki,
Steffen
prev parent reply other threads:[~2010-11-10 14:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-04 13:40 Gruenhagen, Andreas
2010-11-04 16:19 ` Doug Evans
2010-11-04 17:26 ` paawan oza
2010-11-10 14:57 ` Steffen Dettmer [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='AANLkTi=FUV7eu7UchycWj-oL7QtgoQW6cUrOpF5QZ3K5@mail.gmail.com' \
--to=steffen.dettmer@googlemail.com \
--cc=gdb@sourceware.org \
/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