From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15431 invoked by alias); 23 Feb 2015 05:15:34 -0000 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 Received: (qmail 15415 invoked by uid 89); 23 Feb 2015 05:15:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=2.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KAM_FROM_URIBL_PCCC,KAM_LIVE,RCVD_IN_DNSWL_LOW,SPF_PASS,URI_BLOGSPOT autolearn=no version=3.3.2 X-HELO: mail-ob0-f175.google.com Received: from mail-ob0-f175.google.com (HELO mail-ob0-f175.google.com) (209.85.214.175) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 23 Feb 2015 05:15:32 +0000 Received: by mail-ob0-f175.google.com with SMTP id va2so34491211obc.6 for ; Sun, 22 Feb 2015 21:15:30 -0800 (PST) X-Received: by 10.202.69.2 with SMTP id s2mr5815305oia.107.1424668530192; Sun, 22 Feb 2015 21:15:30 -0800 (PST) MIME-Version: 1.0 Received: by 10.202.217.193 with HTTP; Sun, 22 Feb 2015 21:15:09 -0800 (PST) From: kamaraju kusumanchi Date: Mon, 23 Feb 2015 05:15:00 -0000 Message-ID: Subject: stack specific breakpoint To: "gdb@sourceware.org" Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-02/txt/msg00040.txt.bz2 Is there a way to set a breakpoint in a function A only when it is called from function B? In my case, I have funcB() { .... funcA( funcD(), funcE()) .... } funcC() { .... funcA(funcD(), funcE()) .... } where funcA is called by both funcB and funcC. funcC is called a lot of times (the exact number is not known either at run time or compile time) and funcB is called only a handful of times. The additional twist is that the arguments passed to funcA are the return values from other functions - funcD and funcE. I am interested in stepping into funcA only when it is called from funcB. Is there a way to specify the function hierarchy when setting a break point? I tried setting a break point where funcB calls funcA and then use the "step" command. But this steps into funcD() instead of funcA(). Currently, my work around is to first set a breakpoint where funcB calls funcA and when the code hits that set another break point in funcA. Once code finishes funcA, I will disable it (since it could be called by funcC afterwards). I will reenable it when it hits the funcA line in funcB definition. But doing this enable/disable dance is tiresome. Is there a better way to achiever this? If this is feature is not supported, could you please add this to the wishlist? thanks raju -- Kamaraju S Kusumanchi http://malayamaarutham.blogspot.com/