From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3907 invoked by alias); 8 May 2013 19:42:00 -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 3897 invoked by uid 89); 8 May 2013 19:41:59 -0000 X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RDNS_NONE,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 Received: from Unknown (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 08 May 2013 19:41:48 +0000 Received: from [132.207.72.20] ([132.207.72.20]) by smtp.polymtl.ca (8.14.3/8.14.3) with ESMTP id r48Jfa4E029185 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 8 May 2013 15:41:37 -0400 Message-ID: <1368042096.5194.41.camel@station15.dorsal.polymtl.ca> Subject: Re: Debugging agent library From: Suchakra Sharma To: Yao Qi Cc: Simon Marchi , gdb@sourceware.org Date: Wed, 08 May 2013 19:42:00 -0000 In-Reply-To: <5189B577.6070006@codesourcery.com> References: <1367868074.5194.19.camel@station15.dorsal.polymtl.ca> <5188AE42.50308@codesourcery.com> <5189B577.6070006@codesourcery.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Poly-FromMTA: ([132.207.72.20]) at Wed, 8 May 2013 19:41:36 +0000 X-SW-Source: 2013-05/txt/msg00044.txt.bz2 Hi Yao, > If the suggestions above don't work for you, you probably have to turn > on some debugging outputs. You can start gdbserver with option > "--debug", and further, hack the variable "debug_agent" to 1 in > gdb/common/agent.c. Thanks for your detailed reply. We were able to rectify the issue. We tried with a clean install of gdb and libdagent on another machine which did not show any issue. The problem was probably because we tinkered around the dagent code a bit before using it. All works well now. > > Also, is it possible to write our own application to control tracing, > > instead of using GDB? I guess we would need to talk to the agent using > > the IPA protocol, is that right? > > Tracing control involves two sides, GDB and the agent. IPA protocol is > used to control the agent, however, in order to finish/control tracing, > GDB side should be controlled as well. Your tool can get the trace data > from agent, but these data needs GDB interpretation, map the address to > a symbol, for example. I am afraid you can't use your own application > to do tracing with agent. > > On the other hand, I am curious on the reasons to write your own tool to > control tracing instead of using GDB. Tracing is interesting to GDB, > and you can see how much progress GDB made on tracing in the past > several years. GDB is extensible on both its c code and python script, > and you can extend it for your purpose. Last by not least, > contributions are always welcome, and people here are friendly and nice > to answer questions, AFAICS. Indeed, dynamic tracing with GDB is getting more awesome day by day (this view is reinforced by some tests I ran in-house which really show how powerful and fast it is) A you know LTTng/UST already has quite fast static tracing features, so our main aim is to get dynamic tracing infrastructure of GDB in LTTng/UST for fast dynamic user space tracing in an elegant way. We are not 100% clear how it shall be achieved at this moment but we are exploring all avenues for now. At first glance it looked as if we could do it using this library coupled with GDB (controlled through LTTng/UST acting as our tool). Your ideas are welcome and we surely shall contribute once we get a good knack of how to extend GDB's functionality for our use. Regards, Suchakra & Simom -- Suchakrapani Datt Sharma Laboratorie DORSAL École Polytechnique de Montréal