From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-il1-x129.google.com (mail-il1-x129.google.com [IPv6:2607:f8b0:4864:20::129]) by sourceware.org (Postfix) with ESMTPS id 50A8638560BB for ; Fri, 3 Jun 2022 16:19:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 50A8638560BB Received: by mail-il1-x129.google.com with SMTP id s1so7401218ilj.0 for ; Fri, 03 Jun 2022 09:19:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=GA55yb7zhpUzkYryrQCjyatl+ipfrM8uW/ikHQ85cCY=; b=kZx6uf+fLtQyYgxZvUhbLet5qUk+mLWpSxwM1kUJacesVL7TEB9y4/dVimt8GfKy+3 xNzQ5fboYoI6tuatsIbONMi29QcC+4QId7wX5HDdTB1gbDrt3r20T6hPs1bcR6qGRdo1 19+reORHpgsMUM2YvUqDJH/KHPPIZ0VfKtkaxx56t6H5V6KgDxP7mRJKlM9JtUhaSNm4 nqFvfTC9gJTR2L0yX7qnZew4QtZhgE8AWSkxC58kfImfdXa9Afy/xmkhTWz+GkDF5+au Elqt8272N5moJS8KTUJ+9E454o8D4/ihdT7QMK0FmnUjitQ0ctHonNjWb6N4vC88ign5 C5rg== X-Gm-Message-State: AOAM533HKDtSZmA+J/Xm1VyVfCkBJAkHD013J9s4v4PEe8ga1uDnyZ/a NVXvXe6bhuUgwhvOm0VXzwgXpw== X-Google-Smtp-Source: ABdhPJzFgbjZel+hfyGpDw9MP2nhceGWdCl1TSkmNECdq11EbXRZ5+Z4c09/9lIu3KvGgl3i4/7oGA== X-Received: by 2002:a6b:7416:0:b0:668:b24f:aef7 with SMTP id s22-20020a6b7416000000b00668b24faef7mr5109130iog.95.1654273177609; Fri, 03 Jun 2022 09:19:37 -0700 (PDT) Received: from murgatroyd (71-211-167-178.hlrn.qwest.net. [71.211.167.178]) by smtp.gmail.com with ESMTPSA id y21-20020a6be515000000b00665754e45c2sm2547276ioc.24.2022.06.03.09.19.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jun 2022 09:19:37 -0700 (PDT) From: Tom Tromey To: Jon Turney Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [PATCH] Handle encoding failures in Windows thread names References: <20220421143926.2550856-1-tromey@adacore.com> <6f7e3db5-76f4-e21d-edbd-2cd1993a7bdd@dronecode.org.uk> <878rqf3zkx.fsf@tromey.com> <1133f958-06f5-7ece-6202-078cc6d3c8f6@dronecode.org.uk> X-Attribution: Tom Date: Fri, 03 Jun 2022 10:19:36 -0600 In-Reply-To: <1133f958-06f5-7ece-6202-078cc6d3c8f6@dronecode.org.uk> (Jon Turney's message of "Thu, 2 Jun 2022 20:29:36 +0100") Message-ID: <877d5x3ejr.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jun 2022 16:19:39 -0000 >> If there's some way for gdb to know the locale of the inferior, I guess >> we could use that here. I don't have Cygwin and so I can't test it or >> anything, but if I knew what to do I could try to write a patch for >> someone else to test. Jon> I am confused by this, but probably I'm missing something. No, I was confused. Jon> Probably, the "right" thing to do on cygwin is use wcstombs(), but Jon> apparently that can't report the encoding failure condition you want Jon> to detect. At some point I switched which API was in use here for precisely this reason. Another approach might be to use gdb's charset conversion code. Tom