From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id UKLLKCAutl+QPAAAWB0awg (envelope-from ) for ; Thu, 19 Nov 2020 03:34:40 -0500 Received: by simark.ca (Postfix, from userid 112) id A4C0D1F08B; Thu, 19 Nov 2020 03:34:40 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_NONE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from sourceware.org (unknown [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 43D261E58D for ; Thu, 19 Nov 2020 03:34:40 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8CB2C3987C0C; Thu, 19 Nov 2020 08:34:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8CB2C3987C0C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1605774879; bh=s7joQGwJDGEH2KPj9ITY4WVO8y71RujeAjZFGzifM7I=; h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=mvZEw5pYQoFQ845kcY6TQZ6rzxNdayDHnpVeiI46Smcvt8ccyuiQbQPWmZ2CnyLJR g+W0N4EnoS0VpUm807BqxkFt8IrfJKDfWdWRrxCfsJ3Kp5clE5A57zH09g+spwx5RE NIafPvhYib0AJvj/cDSKhzeRLOjIwJlZVL8XFhb8= 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: 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" 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: , From: Nagmat Nazar via Gdb Reply-To: Nagmat Nazar Cc: Simon Marchi , gdb@sourceware.org Errors-To: gdb-bounces@sourceware.org Sender: "Gdb" 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 >