From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 From: Simon Sobisch 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-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org 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: , X-List-Received-Date: Thu, 25 Nov 2021 19:28:23 -0000 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