From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21915 invoked by alias); 29 Dec 2010 06:08:03 -0000 Received: (qmail 21900 invoked by uid 22791); 29 Dec 2010 06:08:02 -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-ww0-f43.google.com (HELO mail-ww0-f43.google.com) (74.125.82.43) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 29 Dec 2010 06:07:56 +0000 Received: by wwi17 with SMTP id 17so9629653wwi.12 for ; Tue, 28 Dec 2010 22:07:54 -0800 (PST) Received: by 10.216.156.196 with SMTP id m46mr14767022wek.75.1293602873978; Tue, 28 Dec 2010 22:07:53 -0800 (PST) MIME-Version: 1.0 Received: by 10.216.182.206 with HTTP; Tue, 28 Dec 2010 22:07:33 -0800 (PST) In-Reply-To: <201012281804.24734.pedro@codesourcery.com> References: <20101228170851.GA2396@adacore.com> <201012281723.59829.pedro@codesourcery.com> <201012281804.24734.pedro@codesourcery.com> From: Hui Zhu Date: Wed, 29 Dec 2010 08:10:00 -0000 Message-ID: Subject: Re: [RFA/RFC] mips tracepoint: fix Bug 12013 To: Pedro Alves Cc: gdb-patches@sourceware.org, Joel Brobecker , Kevin Buettner Content-Type: multipart/mixed; boundary=0016e65b64e0c8adc504988663ba 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: 2010-12/txt/msg00538.txt.bz2 --0016e65b64e0c8adc504988663ba Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-length: 4550 On Wed, Dec 29, 2010 at 02:04, Pedro Alves wrote: > On Tuesday 28 December 2010 17:23:59, Pedro Alves wrote: >> On Tuesday 28 December 2010 17:08:52, Joel Brobecker wrote: >> > > Joel, =A0do you think this patch can check in to 7.2.1. >> > >> > I think that it's borderline, and I'm tempted to say no, considering >> > that this is not a crash or a regression (just a limitation). =A0But >> > it looks relatively safe to me. =A0So, if Pedro agrees, it's OK with m= e. >> >> Yeah. =A0I understand that without this patch, MIPS tracepoints are >> practically useless on 7.2, so on those grounds, I'd be okay. >> >> However, I just went to check whether collecting a pseudo or >> user register in x86/x86_64 still gives a reasonable error, and >> I now get: >> >> =A0>./gdb -q ./gdb >> =A0Reading symbols from /home/pedro/gdb/baseline/build/gdb/gdb...done. >> =A0(top-gdb) start >> =A0Temporary breakpoint 3 at 0x4565c3: file ../../src/gdb/gdb.c, line 29. >> =A0Starting program: /home/pedro/gdb/baseline/build/gdb/gdb >> =A0[Thread debugging using libthread_db enabled] >> >> =A0Temporary breakpoint 3, main (argc=3D1, argv=3D0x7fffffffe108) at ../= ../src/gdb/gdb.c:29 >> =A029 =A0 =A0 =A0 =A0memset (&args, 0, sizeof args); >> =A0(top-gdb) maint agent $sp >> =A0../../src/gdb/regcache.c:166: internal-error: register_type: Assertio= n `regnum >=3D 0 && regnum < descr->nr_cooked_registers' failed. >> =A0A problem internal to GDB has been detected, >> =A0further debugging may prove unreliable. >> =A0Quit this debugging session? (y or n) >> >> While before (on 7.2), we'd get: >> >> =A0(top-gdb) maint agent $sp >> =A0'sp' is a pseudo-register; GDB cannot yet trace pseudoregister conten= ts. >> >> We'll need to get this fixed this before considering a backport to 7.2. >> >> > > Fixed for now. =A0I've reinstated the exact same old error, but under > a stricter check: we now error out for user registers, but let > pseudo-registers pass: > > =A0(top-gdb) maint agent $pc > =A0'pc' is a pseudo-register; GDB cannot yet trace pseudoregister content= s. > > Pseudo-registers will error out further on, on the new errors that Hui > added when the new gdbarch callbacks aren't implemented. =A0On x86_64: > > =A0(top-gdb) maint agent $rsp > =A0Scope: 0x4565c3 > =A0Reg mask: 80 > =A0 0 =A0end > > =A0(top-gdb) maint agent $esp > =A0'esp' is a pseudo-register; GDB cannot yet trace its contents. > > -- > Pedro Alves > > 2010-12-28 =A0Pedro Alves =A0 > > =A0 =A0 =A0 =A0gdb/ > =A0 =A0 =A0 =A0* ax-gdb.c (gen_expr) : Error out if trying to > =A0 =A0 =A0 =A0collect a user register. > > --- > =A0gdb/ax-gdb.c | =A0 =A06 ++++++ > =A01 file changed, 6 insertions(+) > > Index: src/gdb/ax-gdb.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- src.orig/gdb/ax-gdb.c =A0 =A0 =A0 2010-12-28 16:22:01.000000000 +0000 > +++ src/gdb/ax-gdb.c =A0 =A02010-12-28 17:54:45.000000000 +0000 > @@ -1978,6 +1978,12 @@ gen_expr (struct expression *exp, union > =A0 =A0 =A0 =A0if (reg =3D=3D -1) > =A0 =A0 =A0 =A0 =A0internal_error (__FILE__, __LINE__, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0_("Register $%s not av= ailable"), name); > + =A0 =A0 =A0 /* No support for tracing user registers yet. =A0*/ > + =A0 =A0 =A0 if (reg >=3D gdbarch_num_regs (exp->gdbarch) > + =A0 =A0 =A0 =A0 =A0 + gdbarch_num_pseudo_regs (exp->gdbarch)) > + =A0 =A0 =A0 =A0 error (_("'%s' is a pseudo-register; " > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"GDB cannot yet trace pseudoregister= contents."), > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0name); > =A0 =A0 =A0 =A0value->kind =3D axs_lvalue_register; > =A0 =A0 =A0 =A0value->u.reg =3D reg; > =A0 =A0 =A0 =A0value->type =3D register_type (exp->gdbarch, reg); > (top-gdb) maintenance agent $pc 'pc' is a pseudo-register; GDB cannot yet trace pseudoregister contents. (top-gdb) maintenance agent $ax 'ax' is a pseudo-register; GDB cannot yet trace its contents. This place is a bit confusing. Do you think we change the "pseudo-register" to "user-register" in gen_expr? For example: (top-gdb) maintenance agent $pc 'pc' is a user-register; GDB cannot yet trace user-register contents. (top-gdb) maintenance agent $ax 'ax' is a pseudo-register; GDB cannot yet trace its contents. I make a patch for it. Thanks, Hui 2010-12-29 Hui Zhu * ax-gdb.c (gen_expr): Change error message. --0016e65b64e0c8adc504988663ba Content-Type: text/plain; charset=US-ASCII; name="gen_expr_change_message.txt" Content-Disposition: attachment; filename="gen_expr_change_message.txt" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gi9tq0z40 Content-length: 785 LS0tCiBheC1nZGIuYyB8ICAgIDQgKystLQogMSBmaWxlIGNoYW5nZWQsIDIg aW5zZXJ0aW9ucygrKSwgMiBkZWxldGlvbnMoLSkKCi0tLSBhL2F4LWdkYi5j CisrKyBiL2F4LWdkYi5jCkBAIC0xOTgxLDggKzE5ODEsOCBAQCBnZW5fZXhw ciAoc3RydWN0IGV4cHJlc3Npb24gKmV4cCwgdW5pb24KIAkvKiBObyBzdXBw b3J0IGZvciB0cmFjaW5nIHVzZXIgcmVnaXN0ZXJzIHlldC4gICovCiAJaWYg KHJlZyA+PSBnZGJhcmNoX251bV9yZWdzIChleHAtPmdkYmFyY2gpCiAJICAg ICsgZ2RiYXJjaF9udW1fcHNldWRvX3JlZ3MgKGV4cC0+Z2RiYXJjaCkpCi0J ICBlcnJvciAoXygiJyVzJyBpcyBhIHBzZXVkby1yZWdpc3RlcjsgIgotCQkg ICAiR0RCIGNhbm5vdCB5ZXQgdHJhY2UgcHNldWRvcmVnaXN0ZXIgY29udGVu dHMuIiksCisJICBlcnJvciAoXygiJyVzJyBpcyBhIHVzZXItcmVnaXN0ZXI7 ICIKKwkJICAgIkdEQiBjYW5ub3QgeWV0IHRyYWNlIHVzZXItcmVnaXN0ZXIg Y29udGVudHMuIiksCiAJCSBuYW1lKTsKIAl2YWx1ZS0+a2luZCA9IGF4c19s dmFsdWVfcmVnaXN0ZXI7CiAJdmFsdWUtPnUucmVnID0gcmVnOwo= --0016e65b64e0c8adc504988663ba--