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

Reply via email to