Hide variables?

Tom Tromey tom@tromey.com
Fri Feb 24 20:22:22 GMT 2023


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


More information about the Gdb mailing list