From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 120014 invoked by alias); 8 Oct 2015 13:05:35 -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 120000 invoked by uid 89); 8 Oct 2015 13:05:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.8 required=5.0 tests=AWL,BAYES_20,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mout.gmx.net Received: from mout.gmx.net (HELO mout.gmx.net) (212.227.17.21) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 08 Oct 2015 13:05:33 +0000 Received: from [199.64.75.69] by 3capp-gmx-bs23.server.lan (via HTTP); Thu, 8 Oct 2015 15:05:29 +0200 MIME-Version: 1.0 Message-ID: From: "Klaus Rudolph" To: Ashutosh Cc: gdb@sourceware.org Subject: Aw: Using C++ code inside gdb Content-Type: text/plain; charset=UTF-8 Date: Thu, 08 Oct 2015 13:05:00 -0000 Sensitivity: Normal In-Reply-To: References: X-UI-Message-Type: mail X-UI-Out-Filterresults: notjunk:1;V01:K0:HqqHKhT/708=:hc/ft+jBUO2Ic+Gs3Q+jGK bKJ3utuc6Z29KlcvDTclEgnIoVr+J8oZ8/peUjsQCDRTcZAAKQ+kEI5Bhfm+tNSOcvMk4h+Jy 1ZlcavOhpCGT6cOS58APNKkqoMLQEfTN96MEUkCtxn3HFxKFxiWuk696mcayjIxSnFi+Nq7ff hPsSCPtXPF3pKZy+xcuVV90E5OwFSOm4ysyUOvFBc/szdcUFXJ7nqBbNEkPISM2pDvg8yxfO+ HIbQy8MdKxeo7eSAcxhwbM3R3z+f/NiBhgXWNccCbx1xJSRaQ7SiduifzRdsc7ZKWKQ6MOH6m +b9U06+sIy0egFTzrVQfEIrvxP7m1woqikbSMuWmmJCdysnsEYjpikOdQklRWUJDMvnZNBSEU 5FFsRyvM4+SNW22ZXygMRCCrJDkcfQoZPh0CSbauTwQnBJUf2yuCVBJZKqdCL8HbQvinh7U9/ Q58S/LR6IQ== X-IsSubscribed: yes X-SW-Source: 2015-10/txt/msg00023.txt.bz2 > > I plan to add a standalone module inside gdb code that contains > information about the memories in the target, but want to organize it > in the form of a C++ class. My question is: Has anybody earlier tried > adding C++ code to gdb code-base and how easy it would be to do so? > Any guidelines? > You can call every function/method with "print funcName" from gdb command line. So if you add your debug code to your executable you should be able to run every function from your debug extension. You must take care that your debug code is not optimized out because you have no calls from your application to the debug code itself. So you do not need any changes to the debugger or gdbserver itself. But maybe I have a misunderstanding from your question... Regards Klaus