From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from cp165172.hpdns.net (cp165172.hpdns.net [91.238.165.172]) by sourceware.org (Postfix) with ESMTPS id 9DD023945C2B for ; Thu, 12 Aug 2021 15:03:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9DD023945C2B Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=dyxyl.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=dyxyl.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dyxyl.com; s=default; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID: Date:References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=/9Ii+/V/WSiCCU69+gY+i4slLASbVqVP1q7hpN1P3IE=; b=JlhKc65sOJNYwcOK6tYuUeXa2t PftIpu/v1I2szaJgdrXnE+VB4K50hvxql/BZgK2byLCHrhzSmGNbOY05BWic8ImL1ClQSiEyuqGRT E6ACVDwRw8tomasMigIpPTgnVv9pMovrV9sHEdZbUAiGwO+Y4up69MAiwHq9oL6fB5nI=; Received: from cpc92880-cmbg19-2-0-cust615.5-4.cable.virginm.net ([82.27.106.104]:43956 helo=localhost.localdomain) by cp165172.hpdns.net with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mECFH-003O8Z-KE; Thu, 12 Aug 2021 16:03:46 +0100 Received: by localhost.localdomain (Postfix, from userid 597) id B8C566012C; Thu, 12 Aug 2021 16:03:45 +0100 (BST) From: Martin Simmons To: Mahmood Naderan Cc: gdb@sourceware.org Subject: Re: How to check if .gdbinit macros have been loaded? In-Reply-To: <668903330.868573.1628690946039@mail.yahoo.com> (message from Mahmood Naderan on Wed, 11 Aug 2021 14:09:06 +0000 (UTC)) References: <526939713.188425.1628429312671.ref@mail.yahoo.com> <526939713.188425.1628429312671@mail.yahoo.com> <668903330.868573.1628690946039@mail.yahoo.com> Date: Thu, 12 Aug 2021 16:03:45 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-cPanel-MailScanner-Information: Please contact the ISP for more information X-cPanel-MailScanner-ID: 1mECFH-003O8Z-KE X-cPanel-MailScanner: Found to be clean X-cPanel-MailScanner-SpamCheck: X-cPanel-MailScanner-From: qqxnjvamvxwx@dyxyl.com X-Spam-Status: No, score=0.5 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, HK_RANDOM_ENVFROM, HK_RANDOM_FROM, SPF_HELO_NONE, SPF_PASS, TXREP, WEIRD_PORT autolearn=no autolearn_force=no version=3.4.4 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cp165172.hpdns.net X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - dyxyl.com X-Get-Message-Sender-Via: cp165172.hpdns.net: authenticated_id: dyxyl/from_h X-Authenticated-Sender: cp165172.hpdns.net: qqxnjvamvxwx@dyxyl.com X-Source: X-Source-Args: X-Source-Dir: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org 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, 12 Aug 2021 15:04:06 -0000 >>>>> On Wed, 11 Aug 2021 14:09:06 +0000 (UTC), Mahmood Naderan said: >=20 > >What makes you think these commands (macros) will be called > >automatically?=C2=A0 I think you have to call them yourself from the gdb > >command line.=20 > >BTW, the "show user" command will tell you if a particular user defined > command exists. >=20 > Hi Martin, > Yes if I run ''show user" I see the functions defined in the .gdbinit fil= e. >=20 > I tried your suggestion by manually calling one of the functions which is= 'dp 3' [1]. However, it fails with the following error: >=20 >=20 > accel-sim.out: shader.cc:1657: unsigned int shader_core_ctx::translate_lo= cal_memaddr(address_type, unsigned int, unsigned int, unsigned int, new_add= r_type*): Assertion `localaddr % 4 =3D=3D 0' failed. >=20 > Program received signal SIGABRT, Aborted. > __GI_raise (sig=3Dsig@entry=3D6) at ../sysdeps/unix/sysv/linux/raise.c:50 > 50=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ../sysdeps/unix/sysv/linux/raise.c: No s= uch file or directory. > (gdb) dp 3 > Dumping pipeline state... >=20 > Program received signal SIGSEGV, Segmentation fault. > 0x00007ffff7ba9468 in gpgpu_sim::dump_pipeline (this=3D0x0, mask=3D69, s= =3D3, m=3D0) at gpu-sim.cc:2028 > 2028=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 for (unsigned i =3D 0; i < m_shader_co= nfig->n_simt_clusters; i++) { > The program being debugged was signaled while in a function called from G= DB. > GDB has restored the context to what it was before the call. > To change this behavior use "set unwindonsignal off". > Evaluation of the expression containing the function > (gpgpu_sim::dump_pipeline(int, int, int) const) will be abandoned. >=20 >=20 >=20 > I don't know if the .gdbinit functions can be used after the program rece= ives segmentation fault. Was it actually SIGABRT that stopped the program initially, rather than segmentation fault? > Any thoughts on that? The segmentation fault message says this=3D0x0, which probably causes it. The value of "this" comes from gdb's evaluation of GPGPU_Context()->the_gpgpusim->g_the_gpu so maybe that is NULL at that point in the program? __Martin >=20 >=20 >=20 > [1] https://github.com/gpgpu-sim/gpgpu-sim_distribution/blob/master/.gdbi= nit#L10 >=20 >=20 > Regards, > Mahmood >=20 >=20 >=20 >=20 >=20 >=20 > On Monday, August 9, 2021, 4:31:34 PM GMT+2, Martin Simmons wrote:=20 >=20 >=20 >=20 >=20 >=20 >>>>> On Sun, 8 Aug 2021 13:28:32 +0000 (UTC), Mahmood Naderan via Gdb said: > >=20 > > Hi > >=20 > > I use a .gdbinit [1] file which is supposed to print some debug informa= tion when the program is being run.=20 > > When I run GDB, the first printf is written on the screen. So, that mea= ns the .gdbinit file has been loaded. > > However, I don't see the rest of the information that must be printed o= n the screen. There are a lot of printf for this purpose. >=20 > The other printfs are inside define ... end, so you will only see them > when the named command is used. >=20 >=20 > > How can I be sure that the rest of the macros are called? Maybe they hi= t errors and I am not able to see those errors. >=20 >=20 > What makes you think these commands (macros) will be called > automatically?=C2=A0 I think you have to call them yourself from the gdb > command line. >=20 > BTW, the "show user" command will tell you if a particular user defined > command exists. >=20 > __Martin >=20