From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6688 invoked by alias); 7 May 2013 06:42:26 -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 6666 invoked by uid 89); 7 May 2013 06:42:23 -0000 X-Spam-SWARE-Status: No, score=-3.0 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.1 Received: from smtp-out.nus.edu.sg (HELO imsva06.stf.nus.edu.sg) (137.132.14.27) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 07 May 2013 06:42:22 +0000 Received: from imsva06.stf.nus.edu.sg (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 60DC6460065 for ; Tue, 7 May 2013 14:41:41 +0800 (SGT) Received: from smtp.nus.edu.sg (unknown [137.132.21.158]) by imsva06.stf.nus.edu.sg (Postfix) with ESMTP id 5203746005F for ; Tue, 7 May 2013 14:41:41 +0800 (SGT) Received: from r-0-189-28-172.comp.nus.edu.sg ([172.28.189.0]) by smtp.nus.edu.sg over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Tue, 7 May 2013 14:42:18 +0800 Subject: Re: Timer Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=iso-8859-1 From: =?iso-8859-1?Q?Marc_Br=FCnink?= In-Reply-To: Date: Tue, 07 May 2013 06:42:00 -0000 Cc: gdb Content-Transfer-Encoding: quoted-printable Message-Id: <52771B43-9617-412D-B9F8-5730757D6BAF@nus.edu.sg> References: To: Doug Evans X-TM-AS-MML: No X-TMASE-Version: IMSVA-8.2.0.1679-7.0.1014-19848.005 X-TMASE-Result: 10--15.675400-5.000000 X-TMASE-MatchedRID: dzgRF5KJYaODCdFIVzIzHcM+NV+TRYVZSSQ7jOqms04f13AJWvS7FXN3 sLsG0mhumHy7uaiMrL4aEOdBrK4beyB3VCBA4MU353iz0JYiopxEbxUbCvHWy49URkDgdlb5GSq dEmeD/nU3Z3efQH+wj6Fu39/h1AiFOSHVOjy4KMN7IwNLrvA1+7+SVkd+t14KEzQnFLEeMUndB/ CxWTRRuyUIayx+Skid X-SW-Source: 2013-05/txt/msg00030.txt.bz2 On May 7, 2013, at 12:43 PM, Doug Evans wrote: > On Mon, May 6, 2013 at 2:52 AM, Marc Br=FCnink wrote: >> I want to execute a piece of code at regular intervals. Actually I'm sam= pling $pc. >> (let's not go into detail why I use gdb) >>=20 >> My current solution just starts another process that sends a SIGTRAP to = the debugged application. Using a simple script I can print the $pc. >>=20 >> However, I just realised that this approach does not work too well. If g= db is stopped due to a breakpoint it will interpret the received SIGTRAP as= another hit of the very same breakpoint. >>=20 >> Reproduce: >> 1. Attach to any program >> 2. Create any breakpoint >> 3. Wait until breakpoint is hit >> 4. Send SIGTRAP to debugged application >> 5. continue >>=20 >> Actually, now that I think about it, I should have anticipated this beha= viour. >> Is there a better way to execute a piece of code at regular intervals? >=20 > bash$ man setitimer I suppose you are suggesting to modify either GDB or the application. This = is exactly what I don't want. Any other way to accomplish this (using gdb)? Marc >From gdb-return-42104-listarch-gdb=sources.redhat.com@sourceware.org Tue May 07 07:33:38 2013 Return-Path: Delivered-To: listarch-gdb@sources.redhat.com Received: (qmail 32724 invoked by alias); 7 May 2013 07:33:38 -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 Delivered-To: mailing list gdb@sourceware.org Received: (qmail 32653 invoked by uid 89); 7 May 2013 07:33:37 -0000 X-Spam-SWARE-Status: No, score=-4.6 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL autolearn=ham version=3.3.1 Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 07 May 2013 07:33:36 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1UZcP1-0005rE-1r from Yao_Qi@mentor.com ; Tue, 07 May 2013 00:33:35 -0700 Received: from SVR-ORW-FEM-04.mgc.mentorg.com ([147.34.97.41]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Tue, 7 May 2013 00:33:35 -0700 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-04.mgc.mentorg.com (147.34.97.41) with Microsoft SMTP Server id 14.2.247.3; Tue, 7 May 2013 00:33:33 -0700 Message-ID: <5188AE42.50308@codesourcery.com> Date: Tue, 07 May 2013 07:33:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: Suchakra Sharma CC: , Subject: Re: Debugging agent library References: <1367868074.5194.19.camel@station15.dorsal.polymtl.ca> In-Reply-To: <1367868074.5194.19.camel@station15.dorsal.polymtl.ca> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-SW-Source: 2013-05/txt/msg00031.txt.bz2 Content-length: 1745 Hello, Suchakra, On 05/07/2013 03:21 AM, Suchakra Sharma wrote: > Hi, > > We tried to find out how to use the debugging agent library here [1] but > were unsuccessful. As of now, we have built a test app linked to dagent It would be nice if you post some details about how you use dagent and the error message you got. > which creates a socket file and expects commands. We wish to use it with > GDB as well as other applications to primarily objective of tracing > using GDB's fast tracepoint infra. Any help in this regard will be > appreciated. > > [1] https://github.com/MentorEmbedded/Debug-Agent-Library/wiki > I checked out the wiki and realize that the existing documentation has an assumption that readers are much familiar with GDB and GDB tracepoint. The session below shows how to install fast tracepoint through dagent. In one console, start the program in GDBserver, $ LD_PRELOAD=/install/lib/libdagent.so ./gdbserver/gdbserver :1234 ./testsuite/gdb.base/break In the other console, start GDB and connect to GDBserver, $ ./gdb ./testsuite/gdb.base/break (gdb) target remote :1234 (gdb) b main (gdb) c (gdb) b marker4 // set breakpoint to make sure program doesn't exit (gdb) ftrace *0x0804851e // set fast tracepoint at certain address (gdb) set agent on // enable agent (gdb) tstart // start tracing (gdb) c (gdb) tstop // stop tracing (gdb) tfind // examine the trace frames tracepoint collects Found trace frame 0, tracepoint 3 #0 main (argc=, argv=, envp=) at ../../../../git/gdb/testsuite/gdb.base/break.c:94 94 marker1 (); /* set breakpoint 11 here */ Let me know if you get something else or obviously wrong. -- Yao (齐尧)