From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 26 18:40:52 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4CFFB16A4CE for ; Mon, 26 Apr 2004 18:40:52 -0700 (PDT) Received: from web10501.mail.yahoo.com (web10501.mail.yahoo.com [216.136.130.151]) by mx1.FreeBSD.org (Postfix) with SMTP id 17D4543D5C for ; Mon, 26 Apr 2004 18:40:52 -0700 (PDT) (envelope-from b_oshea@yahoo.com) Message-ID: <20040427014052.6433.qmail@web10501.mail.yahoo.com> Received: from [156.153.254.42] by web10501.mail.yahoo.com via HTTP; Mon, 26 Apr 2004 18:40:52 PDT Date: Mon, 26 Apr 2004 18:40:52 -0700 (PDT) From: Brian O'Shea To: GiZmen , freebsd-hackers@freebsd.org In-Reply-To: <20040426221900.GA26440@blurp.one.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: problem with gdb X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2004 01:40:52 -0000 --- GiZmen 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