From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id EF40F3858D39 for ; Fri, 26 Nov 2021 11:16:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EF40F3858D39 Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-530-37ooq6s3P-6aM6CuohhWaA-1; Fri, 26 Nov 2021 06:16:25 -0500 X-MC-Unique: 37ooq6s3P-6aM6CuohhWaA-1 Received: by mail-wr1-f72.google.com with SMTP id x17-20020a5d6511000000b0019838caab88so1633620wru.6 for ; Fri, 26 Nov 2021 03:16:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Ry2xiU8h0qQiAGKGtdIus0bF/TatbeQfvgxeLix4SdU=; b=Sk8K48H2M41Nr8v7lXoUT2TnJ0iKPP9S/GBktvqEE4gsTXaNYqXCEN4ZH4kS1rWcqf KusEFxkdffeK7kXyFyI9bjAk2zstskJJJmRr2Xf9jj+fHaeRtKiyj4T1yplZBigT41fO 5vehSBZbGA1QvyHNfp+iK+ceBTdgV5M5upS7/YS6pQ0+/+N6IwiTxXbtiRt1s/GFr+VZ qwRWFkzbYfFaYi863TJVEFJFZm+zFiNFOqnoaLT8j1GK+Vl4k5N0PQ5j6LsbIgzhEzKZ gw9+GkYjrLeOcg1bg/j8hl0ODfT1Qz9oXf4OCCvqSOKc7yyhwQq65zDbUioFEDuQdDFW 31ng== X-Gm-Message-State: AOAM531yATVDvGrQqHjOd7Hauxzmh6fCDhpp/rZ1JKAFHRCnQdgDYkZe JwxhWhFtDaM0kRvxvvafBCFfnS1mQ1/Fs0k8jIm2ePtUJ/dx0H9OY+MMA/N4IwAT4dncujwtPne a0yNekYQaP3g= X-Received: by 2002:a7b:c7c6:: with SMTP id z6mr14536152wmk.173.1637925383935; Fri, 26 Nov 2021 03:16:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJx7DDY6ipkh9NQjpv/l505SNJC3U+J82hqRNYNQ81X0xnjrdtMDtQ6iUj9RSP+mBgLS0oXj2A== X-Received: by 2002:a7b:c7c6:: with SMTP id z6mr14536127wmk.173.1637925383707; Fri, 26 Nov 2021 03:16:23 -0800 (PST) Received: from localhost (host86-166-129-255.range86-166.btcentralplus.com. [86.166.129.255]) by smtp.gmail.com with ESMTPSA id b11sm10632285wmj.35.2021.11.26.03.16.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Nov 2021 03:16:23 -0800 (PST) Date: Fri, 26 Nov 2021 11:16:21 +0000 From: Andrew Burgess To: Simon Sobisch Cc: gdb@sourceware.org Subject: Re: Broken source view with Pygments and non-UTF-8 encoded source Message-ID: <20211126111621.GA514766@redhat.com> References: <60c53fa8bf160533a2eddf1da280eb50c7461a6a.camel@fit.cvut.cz> MIME-Version: 1.0 In-Reply-To: X-Operating-System: Linux/5.8.18-100.fc31.x86_64 (x86_64) X-Uptime: 11:15:35 up 7 days, 14 min, X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no 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: Fri, 26 Nov 2021 11:16:30 -0000 * Simon Sobisch via Gdb [2021-11-25 20:28:18 +0100]: > 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. Could you post here, or provide a link to, an example source file that triggers the error please. Thanks, Andrew > > 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