From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4B91C3849AD0; Thu, 16 May 2024 09:33:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4B91C3849AD0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1715852018; bh=Jzwmjgg7FpuhvvsN8zmYuS90os+7fSsmiIHMJGiz8ic=; h=From:To:Subject:Date:In-Reply-To:References:From; b=nd3BTwi07wC33kFJLXg5d+AkYATDKOU0vQkvs5HO4IRDZY/b9K3TvKmRN6acEhfF6 9sESDm6hVSrlcldalHFX9Sgg7TGkwoM6KpXRCLAdAMOi7Scv+ECvyCfzfd6tlWhlUw Rmryt91zm9e1SK6iMb17duLXoJjpqdE8AsLBD0BQ= From: "jwakely.gcc at gmail dot com" To: gdb-prs@sourceware.org Subject: [Bug python/31743] is confusing inside a python pretty printer Date: Thu, 16 May 2024 09:33:37 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: python X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jwakely.gcc at gmail dot com 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=3D31743 --- Comment #2 from Jonathan Wakely --- I think this is only a problem when the repeats feature is used for strings= . If I try a similar example with std::vector> it looks fine: $1 =3D std::vector of length 2, capacity 2 =3D {{_M_elems =3D {7, 8, 9, 0 <= repeats 17 times>}}, {_M_elems =3D {0, 1, 2, 0 }}} I think the difference is that for an arbitrary array the adjacent elements= are never coalesced into a double-quoted string, they're always shown one-by-one and so the part works well. For the string case we get a mix of quoted strings and single chars: "quoted string", 'c' , "another quoted string" Given that adjacent strings are concatenated in C and C++, i.e., "foo" "bar" means "foobar", maybe we could make the display more consistent with that: "quoted string" <'c' repeats N times> "another quoted string" This doesn't put commas between the quoted parts, and doesn't switch between the two forms "s" and 'c' so is a bit closer to being a valid string litera= l in C. --=20 You are receiving this mail because: You are on the CC list for the bug.=