From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yb1-xb33.google.com (mail-yb1-xb33.google.com [IPv6:2607:f8b0:4864:20::b33]) by sourceware.org (Postfix) with ESMTPS id 48D5D3858406 for ; Fri, 5 Nov 2021 03:14:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 48D5D3858406 Received: by mail-yb1-xb33.google.com with SMTP id j75so19442879ybj.6 for ; Thu, 04 Nov 2021 20:14:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=t3GkI/NWwf9YANaNmpZDOTBLpE2iIu6B4jcUvxjcfZ4=; b=hCsn/che6pJ2X0+vK1lRzf8HhgyO1fLkq1Kqb6M7iBURHwvvtJrXUaC1B0iVtbbdZd Tu8gHi6uLPaQk2H8tJQ+TiOrMnGbPdTI1bEAiO9/YBOXOssA/Gyejrfm9JkIHzeZOpal bt+0Q+MCn18e+BYvOS5S7yqhnJ+x/TKPYJaCAJuFVpPm/lDT6vSaZQzY9PoVeRV9orn6 ldTVKyiQAAZZBW9SbwxKgTIXfG5JRyis2MFKH9LmC13Y+eVFL5RPblEd8yC3IZkFhfOh muAP2DuTwRBPt603j/O81uMIxbneV0bPzgIK5gIW2tM7Nkw1/cQsHNfE963c1zS2TUjM rG2Q== X-Gm-Message-State: AOAM533KgOWjfWXaTj/AGTi/RYZKRHYrUTUKJD1+sE6fsaaMJrFkQZGE GCyYF8uwLrZRvnGFxYvSsbRTDJwQLGkx/v+Y9JTuqNXP5HQ= X-Google-Smtp-Source: ABdhPJxb6ULhnj5LUuS89VcShjJASww5f5y+/PtRvLS4dasrpM2Zzpfd7ZCsdeJyU+zTmMBoQ0sARsZJpHC6+ZWTBfY= X-Received: by 2002:a25:dc54:: with SMTP id y81mr41592670ybe.183.1636082056721; Thu, 04 Nov 2021 20:14:16 -0700 (PDT) MIME-Version: 1.0 From: David Blaikie Date: Thu, 4 Nov 2021 20:14:05 -0700 Message-ID: Subject: Concatenating LazyStrings To: gdb X-Spam-Status: No, score=0.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, 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 Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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, 05 Nov 2021 03:14:19 -0000 If I've got a pretty printer (for instance, for llvm's Twine type ( https://github.com/llvm/llvm-project/blob/6d03227c16ee1950db0e1aa05fbc3201770248eb/llvm/utils/gdb-scripts/prettyprinters.py#L354 + https://llvm.org/doxygen/classllvm_1_1Twine.html ) that wants to pretty print a string made up of other strings (from other pretty printers) - how would I do that? Specifically, I can't figure out how to correctly concatenate a gdb LazyString value with another string. (even if I have to stringify the LazyString (making it unlazy) in the process - calling ".value()" on the LazyString doesn't seem to be enough - I can't seem to figure out how to to-string-ify that resulting gdb Value (it doesn't have a pretty printer that I can find - nor a to_string/str/string() function) to then concatenate it with another string)