[cfe-dev] [analyzer] gdb pretty printers for analyzer specific types

David Blaikie via cfe-dev cfe-dev at lists.llvm.org
Wed Aug 5 10:53:36 PDT 2020


We don't have many pretty printers because people haven't
implemented/desired them, I guess. I implemented a handful to start &
some folks added/improved on them a bit.

In general you don't want to call into the process's code in a pretty
printer if you can help it - because that risks heisenbugs (risks that
pretty printing a value could change the state of the process being
debugged) and doesn't work on core files (which have no running
process to interact with).

But sometimes it's hard to avoid & I think I've done it in one or two
places in the existing LLVM Pretty printers - so it's by no means an
impossibility.

On Wed, Aug 5, 2020 at 10:41 AM Bal√°zs Benics via cfe-dev
<cfe-dev at lists.llvm.org> wrote:
>
> I was thinking about some pretty printers.
> And I'm thinking about SVals and SymExprs specifically.
>
> Why do we have no pretty printers for such types?
>
> I guess we could reuse their dump() method to acquire string representation.
> The only problem is that that dumps the output to the standard error stream.
>
> What options do I have to get a python pretty-printer using this dump method?
>
> Another possible way to implement such a pretty printer is to hardcode the SVal
> kinds in python to do the right thing for each case.
> I'm not really a big fan of this way though.
>
> If you have experience with gdb pretty printers then your comments more then welcomed.
>
> Balazs.
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev


More information about the cfe-dev mailing list