From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from pb-smtp20.pobox.com (pb-smtp20.pobox.com [173.228.157.52]) by sourceware.org (Postfix) with ESMTPS id 063B7393A412 for ; Tue, 25 May 2021 17:12:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 063B7393A412 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=kichwacoders.com Authentication-Results: sourceware.org; spf=none smtp.mailfrom=jonah@kichwacoders.com Received: from pb-smtp20.pobox.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 34B6512DF2E for ; Tue, 25 May 2021 13:12:28 -0400 (EDT) (envelope-from jonah@kichwacoders.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h= mime-version:references:in-reply-to:from:date:message-id:subject :to:cc:content-type; s=sasl; bh=RmhRj9IRds23uormWQV2E3wJjqq51kL8 bghQvy0w5h4=; b=qs6LR85IINvNeSH2MdQo+qAnvukc0ef274DLkEQX3SvHwzGM F7cb8Q9EXgykmBNqdm+hfYJ0JmqGon1QObs0VVUEbmiPCTefyDQ0yEh+u5Ltucz0 eR3wRAVL12CCrms+3MK+hFMo2FL7f3wbOtK93Vtq2NDuYlr1RwfMiKGBef8= Received: from pb-smtp20.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 2E73B12DF2D for ; Tue, 25 May 2021 13:12:28 -0400 (EDT) (envelope-from jonah@kichwacoders.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=kichwacoders.com; h=mime-version:references:in-reply-to:from:date:message-id:subject:to:cc:content-type; s=mesmtp; bh=RmhRj9IRds23uormWQV2E3wJjqq51kL8bghQvy0w5h4=; b=VqPZdpj9V3SlG86JhCp03E1Za2u6daC1oNpm/GgATW72WfiktgY5ArDL4sDvOkyQON+cR+dZzjnkpYTOTzkQ+dcueZ9owW+mOISaK2OejNqLdOCdzNqJSLLlaU/6dEJdu2Tf554P3pzFvYC9k2YVL3aBTYjNN8WVCroKM3lXzEU= Received: from mail-wr1-f47.google.com (unknown [209.85.221.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pb-smtp20.pobox.com (Postfix) with ESMTPSA id 9C92912DF2C for ; Tue, 25 May 2021 13:12:24 -0400 (EDT) (envelope-from jonah@kichwacoders.com) Received: by mail-wr1-f47.google.com with SMTP id n4so7100205wrw.3 for ; Tue, 25 May 2021 10:12:24 -0700 (PDT) X-Gm-Message-State: AOAM531UxMWwjrUlms8TmAxWTTNtP6z1t4YIw1ER688yhKzCy58+6JtS 0RS/4sX6fFakKaqsOiCIBhkeBwWMpRCgRAbH7y0= X-Google-Smtp-Source: ABdhPJzSuK2gMe/cQEckX4qIVqV6f+T3YCY4Ys/URA/2oKxsStQ9FHUWjpKdE5QyH213kaYxKIBt5JnuzpCXIv+1HPY= X-Received: by 2002:adf:f3c9:: with SMTP id g9mr27712670wrp.160.1621962742858; Tue, 25 May 2021 10:12:22 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jonah Graham Date: Tue, 25 May 2021 13:11:46 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: MI to access value of $ prefixed variable name To: Simon Marchi Cc: GDB Development X-Pobox-Relay-ID: 5FD80A14-BD7C-11EB-9645-D5C30F5B5667-18936988!pb-smtp20.pobox.com X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, HTML_MESSAGE, KAM_SHORT, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Tue, 25 May 2021 17:12:30 -0000 On Tue, 25 May 2021 at 10:04, Simon Marchi wrote: > On 2021-05-25 12:35 a.m., Jonah Graham wrote: > > Hello, > > > > I have a user of Eclipse CDT who is having problems displaying a C > variable > > called $j (dollar sign prefixed variable) - > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=573703 > > > > I understand this is because $ prefixed variables are treated specially > by > > GDB. > > > > 47-stack-list-locals --thread 1 --frame 0 1 > > 47^done,locals=[{name="$f",value="0"}] > > > > 52-var-create --thread 1 --frame 0 - * $f > > 52^done,name="var3",numchild="0",value="void",type="void",has_more="0" > > > > Note type "void" above, $f is an int in the C code, but is indeed void > (as > > expected) in GDB. -stack-list-locals shows the correct value, but I can't > > use the returned name back to -var-create because of the naming conflict. > > > > There wasn't anything I saw in the help ( > > > https://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Variable-Objects.html > ) > > on this topic. > > Huh, I didn't know this was possible: > > https://gcc.gnu.org/onlinedocs/gcc/Dollar-Signs.html#Dollar-Signs The main place I have seen this in practice is generated code. > I didn't look in depth, but I don't think there's a way to make it work. > I don't remember seeing a way to escape that dollar sign. > No problem - thanks for the answer. I'd say that the simplest solution would be: don't use dollar sign in > identifiers. But if somebody really wants GDB to support it, then they > can always send a patch for it (I don't think this is a priority for > anyone). > OK. I will update the bugzilla in CDT with this information. Jonah