From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15814 invoked by alias); 13 Apr 2008 04:18:55 -0000 Received: (qmail 15804 invoked by uid 22791); 13 Apr 2008 04:18:55 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 13 Apr 2008 04:18:36 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id BCA589802B; Sun, 13 Apr 2008 04:18:34 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id 9D95598011; Sun, 13 Apr 2008 04:18:34 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1Jktfl-00055K-Ov; Sun, 13 Apr 2008 00:18:33 -0400 Date: Sun, 13 Apr 2008 06:41:00 -0000 From: Daniel Jacobowitz To: Nick Roberts Cc: Marty Leisner , gdb@sourceware.org Subject: Re: breaking on open(2) on linux Message-ID: <20080413041833.GA19526@caradoc.them.org> Mail-Followup-To: Nick Roberts , Marty Leisner , gdb@sourceware.org References: <200804122237.m3CMbtfl022914@dell2.home> <18433.16837.203782.236874@kahikatea.snap.net.nz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <18433.16837.203782.236874@kahikatea.snap.net.nz> User-Agent: Mutt/1.5.17 (2007-12-11) X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-04/txt/msg00105.txt.bz2 On Sun, Apr 13, 2008 at 11:12:05AM +1200, Nick Roberts wrote: > Marty Leisner writes: > > I've used gdb for 20 years...I've found the ability to > > break on a system call and then backtrace very useful when > > reverse engineering code > > > > Now, I can't do it (not sure when I last could -- I recall its been > > a problem before, but I worked around it). > > > > strace shows open(2) calls... > > The breakpoint is probably being set elsewhere, e.g. open in libpthread.so Nowadays (6.8) you'll get a breakpoint at every copy so it should work OK. Glibc is not good about passing all calls to e.g. open through the "open" function. Many will be inlined. GDB does not support stopping on system calls, though I hope it will some day (someone tried to contribute this, but the assignment paperwork never went through and I can no longer reach him). -- Daniel Jacobowitz CodeSourcery