From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id wo2qLPDjn2EdEgAAWB0awg (envelope-from ) for ; Thu, 25 Nov 2021 14:28:48 -0500 Received: by simark.ca (Postfix, from userid 112) id A72EB1F0CE; Thu, 25 Nov 2021 14:28:48 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id CD9E61EDF0 for ; Thu, 25 Nov 2021 14:28:47 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CF5B53858D35 for ; Thu, 25 Nov 2021 19:28:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CF5B53858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1637868526; bh=nS+nk3paVCqaCJkAdwKaRR8mKQGadMnLCwQcc13BOz4=; h=Date:To:References:Subject:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=AyVTNrmzuXsW+aGmBlrPAxEnWFutEDvmh7L5AUoJ9gzpDtMdtk5OS2JQ1aMhWNvji /XS0g9Kz9uUd0QU7YPm6efT9bxbhxQEqHGVV4NjVGTMNGyGSyP7B+I1Q0198BmGHvv /rB/qiSjRCV7Y9IvxR78Yaxozs6lKh75sExwSZXA= Received: from eggs.gnu.org (eggs.gnu.org [209.51.188.92]) by sourceware.org (Postfix) with ESMTPS id 383B83858D35 for ; Thu, 25 Nov 2021 19:28:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 383B83858D35 Received: from [2001:470:142:3::e] (port=55890 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mqKPs-0000PD-RO for gdb@sourceware.org; Thu, 25 Nov 2021 14:28:20 -0500 Received: from ip5f5a8896.dynamic.kabel-deutschland.de ([95.90.136.150]:55739 helo=[192.168.111.41]) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mqKPs-0001j5-OK for gdb@sourceware.org; Thu, 25 Nov 2021 14:28:20 -0500 Message-ID: Date: Thu, 25 Nov 2021 20:28:18 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.3.1 To: gdb@sourceware.org References: <60c53fa8bf160533a2eddf1da280eb50c7461a6a.camel@fit.cvut.cz> Content-Language: en-US Subject: Broken source view with Pygments and non-UTF-8 encoded source In-Reply-To: <60c53fa8bf160533a2eddf1da280eb50c7461a6a.camel@fit.cvut.cz> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Simon Sobisch via Gdb Reply-To: Simon Sobisch Errors-To: gdb-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb" I _really_ like the Pygments option, but it sadly doesn't work when the source code as invalid UTF8 data in it. As soon as this is the case "list" does not show a nice highlighted code any more but instead Python Exception is raised (UnicodeDecodeError) and then non-colored lines are shown. This is especially bad when you "step" through the code because you get the python exception for every line. I _think_ this is related to GDB not passing the source encoding it knows of (likely get from LANG) to Pygments. More details about that: https://pygments.org/docs/unicode/ Additional to the kind request of fixing that in GDB 11.x/12 Is there a way to disable the source highlighting for a single file or only globally? Simon