From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by sourceware.org (Postfix) with ESMTPS id 0D776384A87E for ; Thu, 19 Nov 2020 08:34:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 0D776384A87E Received: by mail-ej1-x635.google.com with SMTP id gj5so6703219ejb.8 for ; Thu, 19 Nov 2020 00:34:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Qp/QryXhA7myJWuNpu8tzvJ/4rLjzdzSP44aosBbv3o=; b=Le/XsPQvatjt7fnspgpoc49DJyMfTt2+pVwBypdZdM1pnPodUa2mMK2+Kiri6/Xuwp Aza4BrckXNYGsWAl9uh+ck0Yw4kWF23mZd8/89aMj43cMkZXtfYyAc3gK5oQHbNJH0zv P2OpiVXlPBp6l8JcFclYNrfXsprk2++KEYAFmQyRc0w3BKR3teD2DAloHD6mpC2Uujnd gAN/NaHD62DAPmEDrDsNQ/9WjWLRI4W7PXkfPHJLXsdS0t7RZqnZKNhyDONes2nHlWDy 64BR4Ne4by27Z9T50zTybkANC+H2A2RkEkhEnT0Gk9X3663frJXwY4/sUsFjAaDx9rbe WfRQ== X-Gm-Message-State: AOAM532lBDimC8LHcSuMJLjFAdzNmubxOXJiBXUma+iwR1Vmte9qLpQb pEOdktFsYnKrdNSnqITCjRuB16kbdZoKwATvApI= X-Google-Smtp-Source: ABdhPJwEwxK88Qa7BFRxxqXaP9HwBMnz6KDjqc/CK9HZowyuEBRSubMv/b+sqqBzHH95JNc3FiurmuhPg62E96cneo8= X-Received: by 2002:a17:906:b20c:: with SMTP id p12mr27170635ejz.369.1605774875044; Thu, 19 Nov 2020 00:34:35 -0800 (PST) MIME-Version: 1.0 References: <8477dd9d-5952-ca65-3b11-386259f27e61@simark.ca> In-Reply-To: From: Nagmat Nazar Date: Thu, 19 Nov 2020 17:34:21 +0900 Message-ID: Subject: Re: What are the procedures to use self declared convenience functions in GDB? To: "Aktemur, Tankut Baris" Cc: Simon Marchi , gdb@sourceware.org X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Nov 2020 08:34:37 -0000 Dear Mr. Baris, Thanks for your response, I have added it to Makefile.in as you told me, but it is not functioning. How can I check If it was loaded or not? Kind regards, Nagmat On Thu, Nov 19, 2020 at 4:48 PM Aktemur, Tankut Baris < tankut.baris.aktemur@intel.com> wrote: > On Wednesday, November 18, 2020 9:39 PM, Simon Marchi wrote: > > On 2020-11-18 12:18 a.m., Nagmat Nazar wrote: > > > Dear Simon, > > > > > > I have written convenience function as on explanation: > > > https://sourceware.org/gdb/onlinedocs/gdb/Functions-In-Python.html > > > greet.py > > > ``` > > > > > > class Greet (gdb.Function): > > > """Return string to greet someone. > > > Takes a name as argument.""" > > > > > > def __init__ (self): > > > super (Greet, self).__init__ ("greet") > > > > > > def invoke (self, name): > > > return "Hello, %s!" % name.string () > > > > > > Greet () > > > > > > ``` > > > image.png > > > > > > I have placed greet.py into ~/gdb/python/lib/gdb/function/, but as you > see on the picture > > it still gives error. What else shall I do in order to use this function? > > > > > > Kind regards > > > Nagmat > > > > Just putting the file in ~/gdb/python/lib/gdb/function/ won't magically > load it. > > > > You should either use the source command inside GDB (or in a .gdbinit) > or the -x switch when > > starting GDB. > > > > Simon > > If you list the file name in gdb/data-directory/Makefile.in's > PYTHON_FILE_LIST, I believe > it's loaded automatically at GDB startup time. > > -Baris > > > Intel Deutschland GmbH > Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany > Tel: +49 89 99 8853-0, www.intel.de > Managing Directors: Christin Eisenschmid, Gary Kershaw > Chairperson of the Supervisory Board: Nicole Lau > Registered Office: Munich > Commercial Register: Amtsgericht Muenchen HRB 186928 >