[bug #68290] GDB 7.1+ current-line arrow prefix "=>" makes find_pc() fail
Shingo Ishida <[email protected]> Tue, 28 Apr 2026 02:47:58 -0400 (EDT)
| Newsgroups | gmane.comp.debugging.ddd.bugs |
|---|---|
| Message-ID | <[email protected]> |
--8323329-1714636915-1777358878=:4097169
Content-Type: TEXT/plain; CHARSET=utf-8
Content-Transfer-Encoding: QUOTED-PRINTABLE
Content-Disposition: inline
URL:=0A <https://savannah.gnu.org/bugs/?68290>=0A=0A Summa=
ry: GDB 7.1+ current-line arrow prefix "=3D>" makes=0Afind_pc() fail=0A =
Group: DDD=0A Submitter: shishida=0A =
Submitted: Tue 28 Apr 2026 06:47:52 AM UTC=0A Category:=
Gdb integration=0A Severity: 3 - Normal=0A P=
riority: 5 - Normal=0A Item Group: None=0A St=
atus: None=0A Privacy: Public=0A Assigned to: N=
one=0A Open/Closed: Open=0A Discussion Lock: Unlocked=
=0A Release: 3.4.1=0A=0A=0A ____________________________=
___________________________=0A=0AFollow-up Comments:=0A=0A=0A--------------=
-----------------------------------------=0ADate: Tue 28 Apr 2026 06:47:52 =
AM UTC By: Shingo Ishida <shishida>=0A=3D Bug Report: GDB 7.1+ current-line=
arrow prefix "=3D>" makes find_pc() fail =3D=0A=0A=3D=3D Description =3D=
=3D=0AGDB 7.1 and later mark the current execution line in disassemble outp=
ut=0Awith a =3D> prefix (3 characters) and indent non-current=0Alines with=
3 spaces. DDD 3.4.1 does not recognize this format: the routines=0Athat lo=
cate the PC address in the disassembly (SourceView::find_pc(),=0Afirst_addr=
ess(), last_address()) cannot match the =3D> =0Aline. As a result, whenever=
show_pc() runs, DDD concludes that the PC=0Ais not in the current disassem=
bly and issues a fresh disassemble command.=0A=0A=3D=3D Affected Versions =
=3D=3D=0A* DDD 3.4.1 (confirmed by source code inspection and live observat=
ion)=0A* Any version of DDD paired with GDB 7.1 or later=0A=0A=3D=3D Cause =
=3D=3D=0AGDB output changed in 7.1 as follows:=0A=0A*Old GDB (7.0.1 and ear=
lier):*=0A=0A=0A0x08048400 <main+0>: push %ebp=0A0x08048401 <main+1>: =
mov %esp,%ebp=0A=0A=0A*New GDB (7.1+):*=0A=0A=0A 0x08048400 <main+0=
>: push %ebp=0A=3D> 0x08048401 <main+1>: mov %esp,%ebp=0A=0A=0AD=
DD 3.4.1 does not handle the =3D> prefix or the 3-space indent=0A=0A=3D=3D=
Steps to Reproduce =3D=3D=0A1. Launch DDD 3.4.1 with GDB 7.1 or later.=0A2=
. Load a program compiled with debug information that *keeps running* (bloc=
ks=0Aon input, has a sleep loop, etc.).=0A3. Start the program with run, le=
aving it in the running state (no breakpoint=0Astop).=0A4. Move the mouse o=
ver several identifiers in the source window and wait for=0Athe value-tip d=
elay on each.=0A=0A=3D=3D Expected Behavior =3D=3D=0A* Disassembly is displ=
ayed with consistent indentation; the current line=0Acarries DDD's +nomarku=
p+>-nomarkup- marker.=0A* Hovering over a variable while the program is run=
ning does not produce extra=0Adisassemble requests or repeated "Disassembli=
ng location" messages.=0A* The busy/hourglass cursor is not shown unnecessa=
rily and the UI does not=0Abecome sluggish.=0A=0A=3D=3D Suggested Fix =3D=
=3D=0AStrip the =3D> prefix (and the corresponding 3-space=0Aindent on non=
-current lines) in SourceView::process_disassemble(), before=0Athe line[0] =
=3D=3D '0' check:=0A=0A=0A// In the for loop, after untabify(line), before =
the line[0] =3D=3D '0' check:=0Astring arrow("=3D> ");=0Aif (line.length() =
>=3D 3 && line.index(arrow) =3D=3D 0) {=0A line =3D line.after(arrow);=
=0A}=0Aelse if (line.length() >=3D 3 && line.contains(" ", 0)) {=0A li=
ne =3D line.from(3);=0A}=0A=0A=0AAlso update the rxnladdress regex used by=
=0Afirst_address() / last_address() to=0Aaccept the =3D> prefix.=0A=0A=3D=
=3D References =3D=3D=0A* This prefix shipped in GDB 7.1.=0A* Implementatio=
n: +nomarkup+gdb/printcmd.c::pc_prefix()-nomarkup- (returns the=0Aliterals =
+nomarkup+"=3D> "-nomarkup- / three spaces) and its callers in=0A+nomarkup+=
gdb/disasm.c::dump_insns()-nomarkup-.=0A=0A=0A=0A=0A=0A=0A=0A=0A _______=
________________________________________________=0A=0AReply to this item at=
:=0A=0A <https://savannah.gnu.org/bugs/?68290>=0A=0A______________________=
_________________________=0AMessage sent via Savannah=0Ahttps://savannah.gn=
u.org/=0A
--8323329-1714636915-1777358878=:4097169
Content-Type: APPLICATION/pgp-signature; name=signature.asc
-----BEGIN PGP SIGNATURE-----
iHUEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCafBYHgAKCRCqLAuaBUf3
Tkb4AP9FRbCB5h8F5UEfkB+NN+gRnh6D50RqctUCxkOP/z4r4gD+IoUtapRoyfgP
4ji13h1wNKOCcvXBEAat6hWEoZcNgQM=
=H2UI
-----END PGP SIGNATURE-----
--8323329-1714636915-1777358878=:4097169--