From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29365 invoked by alias); 14 Mar 2013 11:13:09 -0000 Received: (qmail 29354 invoked by uid 22791); 14 Mar 2013 11:13:07 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-we0-f178.google.com (HELO mail-we0-f178.google.com) (74.125.82.178) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 14 Mar 2013 11:12:34 +0000 Received: by mail-we0-f178.google.com with SMTP id o45so1927322wer.23 for ; Thu, 14 Mar 2013 04:12:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-originating-ip:in-reply-to:references :from:date:message-id:subject:to:cc:content-type:x-gm-message-state; bh=msBsTU0AFeCy++jgQ7U7SrIGxNEbhjDOKXYY8kUNjHE=; b=bdRz7GIPyI4g2Y1zxXz2QygwpYij6K2LEk8bdTESIi5JgRK2XGRVdwl9iqHce2o9I1 /q//zcfDwKjjGwA9EB0e9tWCTrEpxLXUsb0+INBBi5xWpgFhQU0wQN9r6sF56N40RjnF jEXuQVR/JpZ9pha4V5I9Tncr18hFTMSMC+p9miAq/BlrNxnM2pAPTjSeTgTocvdQC/8s EIMqdJouH3ws5AQbo82PGsRs3ltuqJlykU+U2CS7a7o8KPSgk/YXMlcermV6aJn5Uz9q 1M1GsHq546Vl+4MxgIKHyiwxXBTLKOGD43DdksTRMsjZYxadrqY4QLqFX2rM5z0Ga0qH mqTA== X-Received: by 10.194.110.69 with SMTP id hy5mr3274782wjb.1.1363259552860; Thu, 14 Mar 2013 04:12:32 -0700 (PDT) MIME-Version: 1.0 Received: by 10.194.242.199 with HTTP; Thu, 14 Mar 2013 04:12:11 -0700 (PDT) In-Reply-To: <51419BBB.1030800@redhat.com> References: <51419BBB.1030800@redhat.com> From: Gareth McMullin Date: Thu, 14 Mar 2013 11:13:00 -0000 Message-ID: Subject: Re: Exposing inferior_created in Python To: Phil Muldoon Cc: gdb@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQmp6NkdQ639LXLpc3r/xqwrTNC6wFDxyqqZoAmmnj8ur/KeOFtpGP4bkm1IaR/ocfenIbZO 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: 2013-03/txt/msg00014.txt.bz2 On Thu, Mar 14, 2013 at 10:43 PM, Phil Muldoon wrote: >> I'm interested in having the inferior_created observer exposed as a >> Python event > > I think it is fine to create event and observers in GDB/Python that > you have identified a need for. > > That being said, what do you mean by inferior_created event? I was referring to the inferior_created observer documented in the GDB Internals Manual, Appendix A. What I want it to have a callback called just after the 'vAttach' or 'vRun' packet has been sent to the remote server, and the stop reply has been received, but before execution is resumed with 'vCont' or 'c'. I would like to read and write inferior memory from this callback. > Currently we have observers in the Python API for: > > * Breakpoint events > * Continue events. > * Exiting events > * New object file events > * Signal events > * Inferior halting/stopping events > * Thread events > > Would the thread event/observer satisfy your use-case? I am pretty > much guessing, though, until you can expand on the inferior_created > case. I had considered trying to use the events.cont and events.exited callbacks, hoping the first cont after an exited would be where I want it, but as I understand the continue event is only called after the target is resumed. Is there an observer exposed that will be called as I describe above? If I can achieve this without modifying GDB that would be great. In my working copy I now have it doing what I want, but I've used the inferior_appeared observer rather than inferior_created, because it provided the inferior as a parameter rather than the target_ops. For my purposes it is probably sufficient to call gdb.selected_inferior() in the callback to get the inferior, as there will only be one. I'm not too familiar with the GDB internals; which would be the better observer to expose? Cheers, Gareth -- Black Sphere Technologies Ltd. Web: www.blacksphere.co.nz Mobile: +64 27 777 2182 Tel: +64 9 478 8885 Skype: gareth.mcmullin LinkedIn: http://nz.linkedin.com/in/gsmcmullin