public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Hide variables?
@ 2023-02-22  5:08 Levo D
  2023-02-24 20:22 ` Tom Tromey
  0 siblings, 1 reply; 2+ messages in thread
From: Levo D @ 2023-02-22  5:08 UTC (permalink / raw)
  To: gdb

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Hide variables?
  2023-02-22  5:08 Hide variables? Levo D
@ 2023-02-24 20:22 ` Tom Tromey
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Tromey @ 2023-02-24 20:22 UTC (permalink / raw)
  To: Levo D; +Cc: gdb

>>>>> "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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-02-24 20:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-22  5:08 Hide variables? Levo D
2023-02-24 20:22 ` Tom Tromey

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).