From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D7DCB3858422; Fri, 20 Oct 2023 20:22:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D7DCB3858422 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1697833358; bh=DG+aeCzGOqgZyiA8RWLPqjtjhSmzDvfrDUuB5M+NjiQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=qX26S1QWAkjebEou0N4yHCKonmV4F9+5sdYriqRTQH5dakgMJ+6l9qllvcenyCCmV zup/Rzy8DlOc+Tc+OYsfyPiyZEpPgFOfLNru/c0ibL8MZeN0He5TGxPxwKuFU48n5y E1yu+GlfMrL5ley8yy8WDPjzRBTP1ZDKncD4y/zI= From: "cvs-commit at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug cli/30966] [gdb/cli] pygments finds language based on file name, source-highlight finds language based on debug info Date: Fri, 20 Oct 2023 20:22:38 +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: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW 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=3D30966 --- Comment #3 from cvs-commit at gcc dot gnu.org --- The master branch has been updated by Tom de Vries : https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Deefa43c9366e= 3665f1451d6bbfd46b84dea0d15d commit eefa43c9366e3665f1451d6bbfd46b84dea0d15d Author: Tom de Vries Date: Fri Oct 20 22:23:13 2023 +0200 [gdb/cli] Allow source-highlight to autodetect language Currently when gdb asks the source-highlight library to highlight a fil= e, it tells it what language file to use. For instance, if gdb learns from the debug info that the file is language_c, the language file "c.lang" is used. This mapping is hardcoded in get_language_name. However, if gdb doesn't know what language file to use, it falls back to using python pygments, and in absence of that, unhighlighted source text. In the case of python pygments, it autodetects which language to use ba= sed on the file name. Add the same capability when using the source-highlight library. Tested on x86_64-linux. Verified that it works by: - making get_language_name return nullptr for language_c, and - checking that source-highlight still manages to highlight a hello wor= ld. Reviewed-By: Guinevere Larsen Approved-By: Tom Tromey PR cli/30966 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=3D30966 --=20 You are receiving this mail because: You are on the CC list for the bug.=