From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19484 invoked by alias); 4 Jan 2011 04:34:11 -0000 Received: (qmail 19370 invoked by uid 22791); 4 Jan 2011 04:34:09 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST X-Spam-Check-By: sourceware.org Received: from mail-wy0-f169.google.com (HELO mail-wy0-f169.google.com) (74.125.82.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 04 Jan 2011 04:34:03 +0000 Received: by wyj26 with SMTP id 26so14576350wyj.0 for ; Mon, 03 Jan 2011 20:34:01 -0800 (PST) Received: by 10.216.156.196 with SMTP id m46mr4186921wek.75.1294115641080; Mon, 03 Jan 2011 20:34:01 -0800 (PST) MIME-Version: 1.0 Received: by 10.216.182.206 with HTTP; Mon, 3 Jan 2011 20:33:40 -0800 (PST) In-Reply-To: References: From: Hui Zhu Date: Tue, 04 Jan 2011 04:34:00 -0000 Message-ID: Subject: Re: [PATCH] tracepoint: add new trace command "printf"[0] gdb To: Doug Evans Cc: gdb-patches Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-01/txt/msg00052.txt.bz2 On Tue, Jan 4, 2011 at 03:21, Doug Evans wrote: > On Mon, Jan 3, 2011 at 8:29 AM, Hui Zhu wrote: >> Hi, >> >> I add a new patch add new trace command "printf". >> This printf is same with the simple gdb command, it can do formatted >> output. =A0But it will happen in gdbserver part when it break by a >> tracepoint. >> Then the user can get the format value that he want in tracepint. =A0It >> will be more easy and clear to handle the bug sometimes. > > One could do this with a breakpoint and attaching commands to the > breakpoint too, right? > Or are they too cumbersome for the intended use case? > [Extending tracepoints like this doesn't seem justified yet, so I'm > just looking for more data.] > Thanks Doug. I agree with the tracepoint "printf" will be very close with add a breakpoint commands "printf" if the gdb and gdbserver in same pc. But I have some status need the tracepoint "printf" that breakpoint is not very fit with. 1. The gdb and gdbserver connect through a low speed net. Sometimes, the debug target that I use is in the other side of the earth. The breakpoint commands "printf" is too slow for that issue, because each time the inferior is break by the breakpoint, gdbserver need send the rsp package to gdb, and gdb will get the data that "printf" need though low speed net from gdbsever. And sometime, it will disconnect. But if through tracepoint, I will not have this trouble. I can "set disconnected-tracing on" to handle the network disconnect issue. I still need to get the value from inferior through tfind and other commands. It is still be affect by the low speed network. So I make the tracepoint "printf" to handle it. 2. KGTP(https://code.google.com/p/kgtp/) just support the gdb tracepoint rsp commands. For not stop the Linux the Kernel. It doesn't support the breakpoint. So if it want directly show the Kernel val value, it need "printf". This printf will be very powerful that can set most part of Kernel and we can set condition for it. And in https://code.google.com/p/kgtp/wiki/HOWTO#Offline_debug, we can dump the gdbrsp package to a file and send to Kernel. Then kernel can be debug without a local gdb or a remote connect. But user still need copy the trace file to pc that have GDB. But if support tracepoint "printf", we will not need do that. Thanks, Hui