Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Apr 2004 18:40:52 -0700 (PDT)
From:      Brian O'Shea <b_oshea@yahoo.com>
To:        GiZmen <gizmen@blurp.one.pl>, freebsd-hackers@freebsd.org
Subject:   Re: problem with gdb
Message-ID:  <20040427014052.6433.qmail@web10501.mail.yahoo.com>
In-Reply-To: <20040426221900.GA26440@blurp.one.pl>

next in thread | previous in thread | raw e-mail | index | archive | help
--- GiZmen <gizmen@blurp.one.pl> wrote:
> > On Sunday, 25 April 2004 at 20:42:07 +0200, GiZmen wrote:
> > > Hello,
> > >
> > > I have problem with gdb. When i start gdb as a regular user or even user
> > > i wheel group, i cant debug program that i want. I start gdb with my
> program
> > > and i set breakpoint and i run this program. And i do not stop i this
> > > breakpoint. gdb prints output and this message:
> > >
> > > Program exited normally.
> > > You can't do that without a process to debug.
> > >
> > > and it return to gdb prompt.
> > >
> > > When i do the the same as root it works perfectly. I dont have any
> > > idea what is the cause of this problem.

When you run the program in a debugger as root, the program also runs as
root.  Is it possible that there are some other permission problems (such
as file permissions that the program relies upon) that change the logic
of your program when it is run by root, vs. by another user?

For example, if the breakpoint is set in code that is only executed when
a file open succeeds, it might not reach the code where the breakpoint
is set (but it would reach the breakpoint if run by a priveleged user
such as root).

if ((fd = open("/etc/passwd", O_RDWT) != -1) {
    ...
    /* your breakpoint set in here somewhere */
    ...
}

Cheers,
-brian



	
		
__________________________________
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs  
http://hotjobs.sweepstakes.yahoo.com/careermakeover 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040427014052.6433.qmail>