From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26686 invoked by alias); 5 Apr 2013 11:49:03 -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 26677 invoked by uid 89); 5 Apr 2013 11:49:02 -0000 X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KHOP_RCVD_TRUST,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE autolearn=ham version=3.3.1 Received: from mail-oa0-f48.google.com (HELO mail-oa0-f48.google.com) (209.85.219.48) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Fri, 05 Apr 2013 11:49:00 +0000 Received: by mail-oa0-f48.google.com with SMTP id j1so3810479oag.7 for ; Fri, 05 Apr 2013 04:48:59 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.60.27.66 with SMTP id r2mr7842284oeg.139.1365162539017; Fri, 05 Apr 2013 04:48:59 -0700 (PDT) Received: by 10.182.128.104 with HTTP; Fri, 5 Apr 2013 04:48:58 -0700 (PDT) Date: Fri, 05 Apr 2013 11:49:00 -0000 Message-ID: Subject: Spotting inferior function calls from Python From: Nick Bull To: gdb@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 X-SW-Source: 2013-04/txt/msg00010.txt.bz2 Hi, I would like my Python code to be notified when gdb causes a function to be run on the inferior outside of the normal program flow. For example, this could be used to warn the user that any side-effects might change future program execution. I can't simply hook the 'call' command because there are many other commands which could in principle invoke inferior functions, and too many false positives would be inconvenient. It looks as though all such function calls happen via call_function_by_hand. So the simplest approach would be for me to create a new observer type which is notified in call_function_by_hand, and a corresponding Python event type. Does that sound sensible? And is such a patch likely to be accepted for inclusion, assuming all formatting and copyright assignment requirements are met? Thanks Nick Bull