This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: I want to know the information about the function arguments
- From: Martin Jambor <mjambor at suse dot cz>
- To: 冠人 王 <guanjen375 at yahoo dot com dot tw>, 冠人 王 <guanjen375 at yahoo dot com dot tw>, "gcc\@gcc.gnu.org" <gcc at gcc dot gnu dot org>
- Cc:
- Date: Wed, 06 Jun 2018 13:04:58 +0200
- Subject: Re: I want to know the information about the function arguments
- References: <1445820821.870222.1528269245322.ref@mail.yahoo.com> <1445820821.870222.1528269245322@mail.yahoo.com>
Hi,
On Wed, Jun 06 2018, 冠人 王 via gcc wrote:
> When I modify the gcc source code, sometimes I do not know what parameters does the function call.
> For example,
> bool warn_if_unused_value(const tree exp,location_t locus){ function declaration ...
> }
> I want to know what "exp" and "locus" are by using fprintf such as
> fprintf(stderr,"%s\n%s\n",exp,locus) --> I know it does not work since exp and locus is not strings
> How should I do to know the content of variable "exp" and "locus" ?
For trees, look for example at:
- debug_tree (tree);
- print_node (FILE *, const char *, tree, int);
- print_node_brief (FILE *, const char *, const_tree, int);
For location_t, I *think* you need to expand it yourself first. Look at
how it is being done for example in tree-dump.c.
Generally speaking, for any given type, try searching for functions with
"debug" or "dump" in their names that dump any particular type.
HTH
Martin