From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24511 invoked by alias); 8 May 2009 00:19:49 -0000 Received: (qmail 24503 invoked by uid 22791); 8 May 2009 00:19:48 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,FB_WORD1_END_DOLLAR,J_CHICKENPOX_34,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.45.13) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 08 May 2009 00:19:42 +0000 Received: from zps77.corp.google.com (zps77.corp.google.com [172.25.146.77]) by smtp-out.google.com with ESMTP id n480JfoI013824 for ; Thu, 7 May 2009 17:19:41 -0700 Received: from wf-out-1314.google.com (wfc25.prod.google.com [10.142.3.25]) by zps77.corp.google.com with ESMTP id n480Jd2U019155 for ; Thu, 7 May 2009 17:19:39 -0700 Received: by wf-out-1314.google.com with SMTP id 25so925280wfc.30 for ; Thu, 07 May 2009 17:19:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.142.241.15 with SMTP id o15mr1387364wfh.258.1241741979476; Thu, 07 May 2009 17:19:39 -0700 (PDT) In-Reply-To: <4A031574.6040704@vmware.com> References: <6c288c860905070203u799d766bid9fa2ebb04c6e98e@mail.gmail.com> <4A031574.6040704@vmware.com> Date: Fri, 08 May 2009 00:19:00 -0000 Message-ID: <8ac60eac0905071719p2e2c0741l943d417636c15d5c@mail.gmail.com> Subject: Re: Break whenever an application enters a given library From: Paul Pluzhnikov To: Michael Snyder Cc: Mausoom Sarkar , "gdb@sourceware.org" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true 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: 2009-05/txt/msg00036.txt.bz2 On Thu, May 7, 2009 at 10:08 AM, Michael Snyder wrote: > Mausoom Sarkar wrote: >> >> =A0 =A0I want gdb to break whenever calls are made to functions within a >> particular library. How can I set such a library level breakpoint? > > In general, you can't. > Maybe set an access watchpoint on the library's whole text section? Another way is to do something like this: bash$ nm /path/to/lib.so | grep ' T ' | sed -e 's/.* T //' -e 's/^/break /' > gdb.cmds (gdb) source gdb.cmds Cheers, --=20 Paul Pluzhnikov