From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 86601 invoked by alias); 8 May 2015 09:29:12 -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 86581 invoked by uid 89); 8 May 2015 09:29:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.3 required=5.0 tests=AWL,BAYES_05,KAM_LAZY_DOMAIN_SECURITY,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mail.bfw-online.de Received: from mail.bfw-online.de (HELO mail.bfw-online.de) (62.245.186.164) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 08 May 2015 09:29:10 +0000 Received: from weller by mail.bfw-online.de with local (Exim 4.85) (envelope-from ) id 1Yqeag-0000zM-G0 for gdb@sourceware.org; Fri, 08 May 2015 11:29:06 +0200 Date: Fri, 08 May 2015 09:29:00 -0000 From: Weller To: gdb@sourceware.org Subject: find_overload_match for constructor Message-ID: <20150508092906.GA23005@bfw-online.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-SW-Source: 2015-05/txt/msg00010.txt.bz2 Hey everyone, I'm currently stomped on how to call_function_by_hand for a constructor. Basically I have a class in C++ which wraps multiple native data types to the underlying base class like this: class constant_t: public value_t { constant_t (int); constant_t (double); constant_t (const char *); } Now when I have a command line like (gdb) p $testnr1 + 0.1 I need the function call to the constructor of constant_t so that I can use the operator+ on the value_t of $testnr1. I looked through the code and the only thing I could find which came close to this was the code used for the operator overload on C++ classes with find_overload_match but I can't quite figure out how I would call this in case of an overloaded constructor. Do I need to create an object of type constant_t with it being passed to **args and **objp? In that case how would I achieve that, as the the created object is kinda what I want in the first place. Any help is appreciated, Lennart