Re: [MERGE] Fix for bug 2608

From: Alex Rousskov <rousskov_at_measurement-factory.com>
Date: Tue, 03 Mar 2009 08:59:39 -0700

On 03/03/2009 06:38 AM, Kinkie wrote:
> this patch implements a replacement for the call to basename() in
> debugs().
>
bb:tweak

* Make RELATIVE_PATH_TO_DEBUG_CC a char* ThisFileNameTail constant or
some such. No need for a #define.

* Move ThisFileNameTail into BuildPrefixInit(), replacing rptdcc.

* Move BuildPrefixLength into SkipBuildPrefix. Keep it static, of course.

* Remove SQUIDCEXTERN unless you think SkipBuildPrefix needs to have C
binding. If C binding is necessary, please check whether it should be
defined with that binding as well (and not just declared).

* Consider replacing the entire ThisFileNameTail length calculation
magic with a straightforward $top_srcdir-based solution.

* I believe the proposed solution will not work (and may lead to
coredumps or even exploits) for debugging in files that are _generated_
during Squid build, because their path does not have the same prefix as
the src/Debug.cc path. We use debugs() in generated source files. For
example,

  cf_parser.h: debugs(0, 10, "parse_line: " << buff << "\n" );

Do we use HERE in any generated source files? If yes, the proposed
change should be rejected: We will need a special #define that would go
into config.h and will be overwritten in generated files. The define
will contain top_srcdir or top_builddir.

Thank you,

Alex.
Received on Tue Mar 03 2009 - 16:00:07 MST

This archive was generated by hypermail 2.2.0 : Tue Mar 03 2009 - 12:00:03 MST