Hi Joel,
there should be a email thread (~2 weeks ago?) called "Single Header File
for Debug Flag" that explains the pros/cons of this a bit.

-Korey

On Mon, Jun 27, 2011 at 7:09 PM, Joel Hestness <[email protected]>wrote:

> Hey guys,
>  I hate to complain, but I just spent almost an hour debugging debug flags.
>  I wanted to raise the problem, and get it on the mailing list in case
> anyone else runs into it.
>  I recently updated to the current gem5 repo, and started merging some
> patches from before the changes to debug tracing.  When I tried to compile,
> I kept getting errors such as:
>
> build/X86_FS/mem/ruby/system/Sequencer.cc: In member function 'void
> Sequencer::recordStatistic(SequencerStatisticType)':
> build/X86_FS/mem/ruby/system/Sequencer.cc:757: error: 'RubyStats' is not a
> member of 'Debug'
>
>  With the old trace flags, I could simply write a DPRINTF statement with a
> new flag, and add the new flag name in the corresponding SConscript with
> "TraceFlag('<flag_name>')".  Even after fixing the SConscript to use
> "DebugFlag" instead of "TraceFlag", I was still getting these errors.  I
> searched on the mailing list, but couldn't find anything.  After inspecting
> a bunch of code, I got a hint that I might need to include some generated
> code in the source file that uses the trace flag (for reference, the
> generated code is: ./build/<arch>_<mode>/debug/<flag_name>.hh).  This was
> painful to figure out, especially since the debug flag files are generated
> on the fly during compilation, so not all of them are in the build
> directory
> when you run across the error.
>
>  So, besides the mess of work for me to fix my patches (I need to #include
> each generated debug flag file in the source files that use them), this is
> very tricky to debug and might also cause pain down the road, since
> #includes tend to be harder to merge than typical functional code changes.
>
>  I'd love a cleaner, less-obfuscated solution to this.  Can someone
> describe how it's done differently now and how we might be able to fix it?
>  Can we generate a single debug flags file instead of one for each flag?
>
>  Thanks,
>  Joel
>
> --
>   Joel Hestness
>  PhD Student, Computer Architecture
>  Dept. of Computer Science, University of Texas - Austin
>  http://www.cs.utexas.edu/~hestness
> _______________________________________________
> gem5-dev mailing list
> [email protected]
> http://m5sim.org/mailman/listinfo/gem5-dev
>



-- 
- Korey
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to