public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Levo D <may-not-reply@mail9fcb1a.bolinlang.com>
Cc: <gdb@sourceware.org>
Subject: Re: Hide variables?
Date: Fri, 24 Feb 2023 13:22:22 -0700	[thread overview]
Message-ID: <87pm9yg6f5.fsf@tromey.com> (raw)
In-Reply-To: <20230222050804.9B8FA17750B@bolin> (Levo D.'s message of "Wed, 22 Feb 2023 05:08:04 +0000 (UTC)")

>>>>> "Levo" == Levo D <may-not-reply@mail9fcb1a.bolinlang.com> writes:

Levo> I'm generating c source. The code isn't sophisticated yet so there's a
Levo> lot of unnamed temporary variables. Would it be possible to have gdb
Levo> hide them? Is there a prefix I can use (like _hiddenMyVarName), or a
Levo> way to use a pretty printer to hide them? Is there a standard tool to
Levo> strip the variables from the binary? I use 3 compilers with gdb,
Levo> clang, gcc and tcc (tiny c compiler). I found a solution for clang but
Levo> it doesn't work with gcc or tcc

I think the answer is pretty much "no" to all.

If you can convince the compiler to mark them DW_AT_artificial then
perhaps they'd be hidden.  Even then I'm not 100% certain.

You could maybe write a frame filter to do this for 'bt' but it won't be
used in other situations.

Tom

      reply	other threads:[~2023-02-24 20:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-22  5:08 Levo D
2023-02-24 20:22 ` Tom Tromey [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pm9yg6f5.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb@sourceware.org \
    --cc=may-not-reply@mail9fcb1a.bolinlang.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).