From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D9C86385734B; Sun, 4 Sep 2022 08:45:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D9C86385734B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1662281113; bh=VPXfhbI1kVF83uwiSu6i91gfg/SZyTgDnMfEz1HAjAw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Cos2QauIro+i+QG2IYU1g0NsgiW13UzmS05+S2JoxdjFLCTlFrSSwJ8XGuTZnlKpK 7RUvhauaia5NaN43TZJjeOW5lOxW6RKkGW/LpD0YfUvbcQUVbiVbZOn1IRVVJBQDX5 /n5+wHzYmJt+pgdYekMVlR/SUIfTZ8u3yBaLRhDg= From: "lienze at sourceware dot org" To: gdb-prs@sourceware.org Subject: [Bug cli/24124] Command `b *804874e` sets breakpoint at 0xc480a - hex value of 804874 Date: Sun, 04 Sep 2022 08:45:13 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: cli X-Bugzilla-Version: 8.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: minor X-Bugzilla-Who: lienze at sourceware dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D24124 --- Comment #4 from Enze Li --- (In reply to Tom Tromey from comment #3) > (In reply to Enze Li from comment #2) >=20 > > "804874e" is parsed as a floating point number because "en" stands for > > "10^n". If there is no decimal number after "e", "e" will be ignored. = "d" > > and "f" are not as special as "e", that is why breakpoint address with = a "d" > > or "f" are recognized as illegal. This is my understanding. >=20 > I think gdb's lexing here is weird, because it disagrees with C: >=20 > prentzel. gcc --syntax-only q.c > q.c:1:11: error: exponent has no digits > 1 | float x =3D 80e; > | ^~~ >=20 > (gdb) print 80e > $1 =3D 80 > (gdb) ptype 80e > type =3D double >=20 > So not treating this as floating point (and rejecting the parse) > might be fine. >=20 > > In GDB, do users usually use decimal numbers to define the address of > > breakpoints? >=20 > No but nothing prohibits it. >=20 > > Or, if only hexadecimal numbers are used to set the breakpoint > > address, how about we restrict the value of the address to start with 0= x? >=20 > That's harder than it sounds because the text after the "*" is an > arbitrary expression, not just an integer. Hi Tom, Thanks for your reply. I have a proposed patch. FTR, I've posted here[1].=20 [1] https://sourceware.org/pipermail/gdb-patches/2022-September/191680.html --=20 You are receiving this mail because: You are on the CC list for the bug.=