From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32094 invoked by alias); 4 Jul 2011 05:38:36 -0000 Received: (qmail 31910 invoked by uid 22791); 4 Jul 2011 05:38:34 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-fx0-f54.google.com (HELO mail-fx0-f54.google.com) (209.85.161.54) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 04 Jul 2011 05:38:20 +0000 Received: by mail-fx0-f54.google.com with SMTP id 4so4660330fxe.13 for ; Sun, 03 Jul 2011 22:38:20 -0700 (PDT) Received: by 10.223.85.203 with SMTP id p11mr8932629fal.132.1309757900066; Sun, 03 Jul 2011 22:38:20 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.112.3 with HTTP; Sun, 3 Jul 2011 22:37:40 -0700 (PDT) In-Reply-To: References: From: Hui Zhu Date: Mon, 04 Jul 2011 06:04:00 -0000 Message-ID: Subject: Re: [RFA/tracepoint] Make GDB can work with some old GDB server To: gdb-patches ml 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-07/txt/msg00080.txt.bz2 Ping. On Fri, Jun 24, 2011 at 16:46, Hui Zhu wrote: > Hi, > > I got some bug report about ppa in https://lkml.org/lkml/2011/6/4/65 > It is: > kgdb_breakpoint () at kernel/kgdb.c:1721 > 1721 =A0 =A0 =A0 =A0 =A0 =A0wmb(); /* Sync point after breakpoint */ > Sending packet: $qSymbol::#5b...Ack > Packet received: > Packet qSymbol (symbol-lookup) is NOT supported > Sending packet: $qTStatus#49...Ack > Packet received: E22 > trace API error 0x2. > (gdb) bt > No stack. > (gdb) > > This is because this kgdb(I think trunk have fixed this bug) don't > support qtstatus and reply -0x22. > So gdb throw a error. =A0Then all connect process stop. > > This is a bug of kgdb, but I think make gdb just output a warning is > not affect anything else. =A0So I make this patch. > > Please help me review it. > > Thanks, > Hui > > > 2011-06-24 =A0Hui Zhu =A0 > > =A0 =A0 =A0 =A0* remote.c (remote_start_remote): Add TRY_CATCH for > =A0 =A0 =A0 =A0remote_get_trace_status. > =A0 =A0 =A0 =A0* tracepoint.c (disconnect_tracing): Ditto. > --- > =A0remote.c =A0 =A0 | =A0 13 ++++++++++++- > =A0tracepoint.c | =A0 14 +++++++++++++- > =A02 files changed, 25 insertions(+), 2 deletions(-) > > --- a/remote.c > +++ b/remote.c > @@ -3146,6 +3146,8 @@ remote_start_remote (int from_tty, struc > =A0 struct remote_state *rs =3D get_remote_state (); > =A0 struct packet_config *noack_config; > =A0 char *wait_status =3D NULL; > + =A0int ret =3D 0; > + =A0volatile struct gdb_exception ex; > > =A0 immediate_quit++; =A0 =A0 =A0 =A0 =A0 =A0/* Allow user to interrupt i= t. =A0*/ > > @@ -3389,7 +3391,16 @@ remote_start_remote (int from_tty, struc > > =A0 /* Possibly the target has been engaged in a trace run started > =A0 =A0 =A0previously; find out where things are at. =A0*/ > - =A0if (remote_get_trace_status (current_trace_status ()) !=3D -1) > + =A0TRY_CATCH (ex, RETURN_MASK_ERROR) > + =A0 =A0{ > + =A0 =A0 =A0ret =3D remote_get_trace_status (current_trace_status ()); > + =A0 =A0} > + =A0if (ex.reason < 0) > + =A0 =A0{ > + =A0 =A0 =A0warning(_("%s"), ex.message); > + =A0 =A0 =A0ret =3D -1; > + =A0 =A0} > + =A0if (ret !=3D -1) > =A0 =A0 { > =A0 =A0 =A0 struct uploaded_tp *uploaded_tps =3D NULL; > =A0 =A0 =A0 struct uploaded_tsv *uploaded_tsvs =3D NULL; > --- a/tracepoint.c > +++ b/tracepoint.c > @@ -1939,11 +1939,23 @@ trace_status_mi (int on_stop) > =A0void > =A0disconnect_tracing (int from_tty) > =A0{ > + =A0int ret =3D 0; > + =A0volatile struct gdb_exception ex; > + > =A0 /* It can happen that the target that was tracing went away on its > =A0 =A0 =A0own, and we didn't notice. =A0Get a status update, and if the > =A0 =A0 =A0current target doesn't even do tracing, then assume it's not > =A0 =A0 =A0running anymore. =A0*/ > - =A0if (target_get_trace_status (current_trace_status ()) < 0) > + =A0TRY_CATCH (ex, RETURN_MASK_ERROR) > + =A0 =A0{ > + =A0 =A0 =A0ret =3D target_get_trace_status (current_trace_status ()); > + =A0 =A0} > + =A0if (ex.reason < 0) > + =A0 =A0{ > + =A0 =A0 =A0warning(_("%s"), ex.message); > + =A0 =A0 =A0ret =3D -1; > + =A0 =A0} > + =A0if (ret < 0) > =A0 =A0 current_trace_status ()->running =3D 0; > > =A0 /* If running interactively, give the user the option to cancel and >