* How to dump_decl_name to a string instead to a file?
@ 2021-07-01 7:35 Erick Ochoa
2021-07-01 9:28 ` Richard Biener
0 siblings, 1 reply; 2+ messages in thread
From: Erick Ochoa @ 2021-07-01 7:35 UTC (permalink / raw)
To: gcc
Hello,
I have a function that looks at identifiers of formal parameters. I
found that when I ran this function on larger projects, the compiler
segfaulted. I looked into this and I found that there are some formal
parameters which have NULL in their DECL_NAME and that triggered a
NULL dereference.
I also noticed that these parameters when printed with
dump_function_to_file were displayed using their DECL_UIDs. Digging a
little bit deeper, the function responsible for printing parameters
names is dump_decl_name. However, I am interested not in printing the
names but having them as strings.
I noticed that dump_decl_name takes a pretty_printer argument. Is it
possible to somehow pass a pretty_printer and get the string instead
of printing it?
Thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: How to dump_decl_name to a string instead to a file?
2021-07-01 7:35 How to dump_decl_name to a string instead to a file? Erick Ochoa
@ 2021-07-01 9:28 ` Richard Biener
0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2021-07-01 9:28 UTC (permalink / raw)
To: Erick Ochoa; +Cc: GCC Development
On Thu, Jul 1, 2021 at 9:40 AM Erick Ochoa via Gcc <gcc@gcc.gnu.org> wrote:
>
> Hello,
>
> I have a function that looks at identifiers of formal parameters. I
> found that when I ran this function on larger projects, the compiler
> segfaulted. I looked into this and I found that there are some formal
> parameters which have NULL in their DECL_NAME and that triggered a
> NULL dereference.
>
> I also noticed that these parameters when printed with
> dump_function_to_file were displayed using their DECL_UIDs. Digging a
> little bit deeper, the function responsible for printing parameters
> names is dump_decl_name. However, I am interested not in printing the
> names but having them as strings.
>
> I noticed that dump_decl_name takes a pretty_printer argument. Is it
> possible to somehow pass a pretty_printer and get the string instead
> of printing it?
You can look at its buffer I think.
Richard.
> Thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-07-01 9:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-01 7:35 How to dump_decl_name to a string instead to a file? Erick Ochoa
2021-07-01 9:28 ` Richard Biener
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).