From: "Shiladitya (শিলাদিত্য)" <shiladitya.biswas@gmail.com>
To: Shriek <shriek.007@gmail.com>, gdb@sourceware.org
Subject: Re: Need help in debugging daemons with GDB
Date: Wed, 09 Aug 2006 14:20:00 -0000 [thread overview]
Message-ID: <113c79ae0608090720g24e47d72qd87649a9d4b34233@mail.gmail.com> (raw)
In-Reply-To: <113c79ae0608082338l1975b171p70ecb223cb468c1@mail.gmail.com>
There is a simple way to get around that. Create a shell script by the same
name as the daemon that you intend to debug and replace the daemon by
the script. Let us say you daemon is called "shriek". Rename it to
"shriek_real" and name your shell script as "shriek". shriek will
look like this :
"
#! /bin/sh
/usr/bin/xterm -e gdb -x {full_path}/gdb_script
"
and your gdb_script will look like this:
"
file {full_path}/shriek_real
b addr
r
"
You will be able to get control of the daemon right at its entry point
when you restart the daemon "script".
Hope that helps
> On 8/9/06, Shriek <shriek.007@gmail.com> wrote:
> > I am not sure this is the correct mailing list for this but did not
> > find another suitable one ...
> > I am debugging a daemon in FreeBSD and I am particularly interested in
> > the initialization functions activity as the daemon starts ...
> > conventionally I attach the GDB to the PID and supply the unstripped
> > object file of the daemon as argument. Now the problem with this is
> > when you stop the daemon and restart there is no info of the PID
> > avaliable for attaching the GDB, thus I cannot get to see the
> > initialization functions ... and by the time you get to know PID the
> > initialization stuff is already history :-)
> >
>
>
> --
> --
> Shiladitya
>
prev parent reply other threads:[~2006-08-09 14:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-09 6:26 Shriek
2006-08-09 6:39 ` Mark Kettenis
[not found] ` <113c79ae0608082338l1975b171p70ecb223cb468c1@mail.gmail.com>
2006-08-09 14:20 ` Shiladitya (শিলাদিত্য) [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=113c79ae0608090720g24e47d72qd87649a9d4b34233@mail.gmail.com \
--to=shiladitya.biswas@gmail.com \
--cc=gdb@sourceware.org \
--cc=shriek.007@gmail.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