This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: -femit-struct-debug-reduced/baseonly debug info


Ok, it's understandable, but the logic of implementation tells the following:
./gcc/opts.c

  51 void
  52 set_struct_debug_option (struct gcc_options *opts, location_t loc,
  53                          const char *spec)
  54 {

*************

  62   /* Default is to apply to as much as possible. */
  63   enum debug_info_usage usage = DINFO_USAGE_NUM_ENUMS;
  64   int ord = 1, gen = 1;

*************

  96   if (usage == DINFO_USAGE_NUM_ENUMS)
  97     {
  98       if (ord)
  99         {
 100           opts->x_debug_struct_ordinary[DINFO_USAGE_DFN] = files;
 101           opts->x_debug_struct_ordinary[DINFO_USAGE_DIR_USE] = files;
 102           opts->x_debug_struct_ordinary[DINFO_USAGE_IND_USE] = files;
 103         }
 104       if (gen)
 105         {
 106           opts->x_debug_struct_generic[DINFO_USAGE_DFN] = files;
 107           opts->x_debug_struct_generic[DINFO_USAGE_DIR_USE] = files;
 108           opts->x_debug_struct_generic[DINFO_USAGE_IND_USE] = files;
 109         }
 110     }
 111   else
 112     {
 113       if (ord)
 114         opts->x_debug_struct_ordinary[usage] = files;
 115       if (gen)
 116         opts->x_debug_struct_generic[usage] = files;
 117     }


This means that first optional parameter shouldn't affect so much. In case it's omitted debug info should be emitted both for [dir:] and [ind:].

Two cases:
1) test.c -O0 -g2 -femit-struct-debug-detailed=ind:ord:base

    opts->x_debug_struct_ordinary[usage] = files;

2) test.c -O0 -g2 -femit-struct-debug-detailed=ord:base

    opts->x_debug_struct_ordinary[DINFO_USAGE_DFN] = files;
    opts->x_debug_struct_ordinary[DINFO_USAGE_DIR_USE] = files;
    opts->x_debug_struct_ordinary[DINFO_USAGE_IND_USE] = files;

What am I missing? On my view, there is smth wrong, or processing of this option has some additional shadow logic, that I failed to find.

/*
With optimism,
Evgeny Gavrin

email : evgeny.gavrin@hotmail.com
*/


----------------------------------------
> Date: Wed, 19 Jun 2013 08:51:17 -0700
> Subject: Re: -femit-struct-debug-reduced/baseonly debug info
> From: iant@google.com
> To: evgeny.gavrin@hotmail.com
> CC: gcc-help@gcc.gnu.org
>
> On Wed, Jun 19, 2013 at 8:38 AM, Evgeny Gavrin
> <evgeny.gavrin@hotmail.com> wrote:
>>
>> So, as I understand, when compiling like "gcc-4.7 test.c -O0 -g2 -femit-struct-debug-detailed=ind:ord:base" info about structs declared in test-nonbase.h shouldn't be emitted.
>
> Because you used "ind", the compiler generates debug info for
> essentially every struct that is explicitly named in your source code.
>
> Ian 		 	   		  

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]