From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DC3543858C2C; Sat, 3 Sep 2022 21:15:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DC3543858C2C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1662239714; bh=2QUHOqfLbomPyqX2YrvA6fDKEeqOHlMnRWMIW+uTOWQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=SfaeCAf252yWKHWsSUWTyzllsM4Bal0gSX+80Prj0Lzau2dFn1B9jaDwIfEQSLGtV VTCAYlKIuMfrGXWhYnmhPSx5PEQE3ZXD3B75l/ybd1B5FL4pH4+S4cc7crXwakDuHD Oo9Z2BJfoKPslAbO2WynWwB+jgGEuif1U2w28em8= From: "tromey 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: Sat, 03 Sep 2022 21:15:14 +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: tromey 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 #3 from Tom Tromey --- (In reply to Enze Li from comment #2) > "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. I think gdb's lexing here is weird, because it disagrees with C: prentzel. gcc --syntax-only q.c q.c:1:11: error: exponent has no digits 1 | float x =3D 80e; | ^~~ (gdb) print 80e $1 =3D 80 (gdb) ptype 80e type =3D double So not treating this as floating point (and rejecting the parse) might be fine. > In GDB, do users usually use decimal numbers to define the address of > breakpoints? No but nothing prohibits it. > Or, if only hexadecimal numbers are used to set the breakpoint > address, how about we restrict the value of the address to start with 0x? That's harder than it sounds because the text after the "*" is an arbitrary expression, not just an integer. --=20 You are receiving this mail because: You are on the CC list for the bug.=