From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14019 invoked by alias); 15 Nov 2013 22:28:47 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 13840 invoked by uid 89); 15 Nov 2013 22:28:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_05,RDNS_NONE,SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-ee0-f54.google.com Received: from Unknown (HELO mail-ee0-f54.google.com) (74.125.83.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 15 Nov 2013 22:27:24 +0000 Received: by mail-ee0-f54.google.com with SMTP id e51so1111690eek.41 for ; Fri, 15 Nov 2013 14:27:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=u/rGm3KLythODh8OATmoMGwNE++8x0WPtGWBif4KtrE=; b=DdWjR4prnGCLKMWGg4McYpC5eZYq7Kyt56zbniwnk70UsufYxhRaEDdXWW4yMY/7ho TSoDO7N+wQQE4HuvSq7rY8Fw9gvriuaC/kRzrfvOfsSmU8kGNlaWDYB1MkLlgi29IRyf 3ysClaGwNJd6GAVJWj7+t6u+GkGs5tEfAOM3JO19Av2BqYMHpWuK54RZ97CACxlCjqGU JlpJWB/uRshwwBsZhYocbD5ly4in0YxG46sfLZeESy43D/J2ADm/BnR9GwMIs8iigKcg qE/vsu1wuYsjEu48Nxsi3mrwVhJLNpZBGR7gAp0K/Z4bjmVkaG85h88PAOqx46HOZZLD FtQw== X-Gm-Message-State: ALoCoQkf6gdrvpNi2BnFLWgOmToU+Wz0mR0h++MHwMmYlxykfHBfcqw+XB0PYCGi9ZTycNlPBFEJogTPJ0nyuIvG0oxGYCuwN9jqE9JYVe2GwSGH2ie4TZsRG9T6PNZ61oSjZ/l6BUXEH+sfOsriyD20CZ5o6HcL2bYwYNxfzgsEFSS7pm7CtftZDz/z10IFaT9ZYWQVxjJo/AY+aI7hSB+UnWHu5g3wEQ== MIME-Version: 1.0 X-Received: by 10.15.111.196 with SMTP id cj44mr1798765eeb.94.1384554435388; Fri, 15 Nov 2013 14:27:15 -0800 (PST) Received: by 10.15.52.133 with HTTP; Fri, 15 Nov 2013 14:27:15 -0800 (PST) In-Reply-To: <87txfds4vf.fsf@fleche.redhat.com> References: <87r4hefx59.fsf@fleche.redhat.com> <871u995pbt.fsf@fleche.redhat.com> <87ehaq5nkr.fsf@fleche.redhat.com> <87txfds4vf.fsf@fleche.redhat.com> Date: Sat, 16 Nov 2013 00:05:00 -0000 Message-ID: Subject: Re: [RFC] Debug Methods in GDB Python From: Siva Chandra To: Tom Tromey Cc: gdb-patches Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes X-SW-Source: 2013-11/txt/msg00432.txt.bz2 Thanks a lot for reviewing. On Fri, Nov 15, 2013 at 1:59 PM, Tom Tromey wrote: > I can do that if you want; but meanwhile I think if you wrote the > tests... Yes. Now that you are OK with the general approach, I am going to write the tests and elaborate the docs. Will send out patches for these early next week. > Also I was curious if this supports operator overloading. Like can I > define an "operator+"? Yes. Operator overloading is handled the same way as methods. The operator functions have to be methods though. > Siva> + if (ext_fnp) > Siva> + { > Siva> + if (ext_fn_is_method (ext_fnp)) > Siva> + { > Siva> + struct value *ret_val; > Siva> + > Siva> + ret_val = ext_fn_invoke_method (ext_fnp, arg2, argvec + 2, > Siva> + nargs - 1); > Siva> + if (ret_val == NULL) > Siva> + error (_("Error invoking debug method for method %s."), > Siva> + tstr); > Siva> + > Siva> + return ret_val; > Siva> + } > Siva> + } > > What happens here if "ext_fnp && !ext_fn_is_method"? > Siva> +struct py_ext_object > Siva> +{ > Siva> + /* Holds an instance of the DebugMethod class. */ > Siva> + PyObject *object; > Siva> + > Siva> + /* Holds the type of the 'this' object. */ > Siva> + PyObject *match_py_obj_type; > Siva> + > Siva> + /* Holds the matching method name. */ > Siva> + const char *match_method; > > How "match_method" is allocated and how its lifetime is managed is > really unclear to me. I will address the above two question in the next round of review.