rewrite_to_chrome_style: Not rewriting some WTF::String debugging helpers |
|||
Issue description
Not sure what's going on: NDEBUG should be defined (since the header is getting rewritten, but WTFString.cpp is not:
Example patch needed to make things compile:
diff --git a/third_party/WebKit/Source/wtf/text/WTFString.cpp b/third_party/WebKit/Source/wtf/text/WTFString.cpp
index e9dc7ba..35fd53f 100644
--- a/third_party/WebKit/Source/wtf/text/WTFString.cpp
+++ b/third_party/WebKit/Source/wtf/text/WTFString.cpp
@@ -1249,7 +1249,7 @@ String* string(const char*);
Vector<char> asciiDebug(StringImpl*);
Vector<char> asciiDebug(String&);
-void String::show() const
+void String::Show() const
{
DataLogF("%s\n", asciiDebug(Impl()).Data());
}
,
Jan 6 2017
This method is still not properly handled as of the Jan 5th 2017 version of the tool.
,
Jan 16 2017
There's a bunch of things in WTFString.cpp that don't get rewritten.. but they are not inside the WTF namespace for some reason. They must not get used at all to even compile (away)?
} // namespace WTF
#ifndef NDEBUG
// For use in the debugger
String* string(const char*);
Vector<char> asciiDebug(StringImpl*);
Vector<char> asciiDebug(String&);
void String::show() const {
DataLogF("%s\n", asciiDebug(Impl()).Data());
}
,
Jan 16 2017
http://blink-dev.chromium.narkive.com/woFWA7zx/displaying-a-wtf-string-in-gdb complains of this crashing. Hm. It was added in 5049b1e6bd23b7251c57c737c62a2e3e9ad47021 by rniwa and the impl was outside of the WTF namespace since then.
,
Jan 16 2017
It looks like an oversight to me. The AtomicString one was added at the same time, and it's in WTF. The WTFString one was put lower to make use of some file-static methods that live outside of WTF. We should just put them in anonymous namespace and move show into WTF namespace. Which brings to mind we are ignoring anon namespace stuff then?
,
Jan 16 2017
We shouldn't be, as long as it's nested inside a top-level blink or wtf namespace.
,
Jan 16 2017
The helper string() method comes from 937b4ab3e082405efafd01e49da1e1001f32f425 and it just calls a constructor. You can do that from gdb directly if you really want to, looks like it should go. The asciiDebug method is called from String::show() so no need to expose it to gdb, just call show().
,
Jan 16 2017
The show method is handled right after https://codereview.chromium.org/2636083002/
,
Jan 16 2017
,
Jan 17 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/a2377c097a1fa051f90f9c02d96d010073fcb701 commit a2377c097a1fa051f90f9c02d96d010073fcb701 Author: danakj <danakj@chromium.org> Date: Tue Jan 17 01:21:55 2017 WTF: Put String::show()'s definition into the WTF namespace. The rename tool doesn't see it otherwise. Also cleanup a bit and drop some old functions in here meant to be called from gdb, and move the asciiDebug helper into an anonymous namespace inside WTF so that the rename tool also renames it. BUG= 598176 Review-Url: https://codereview.chromium.org/2636083002 Cr-Commit-Position: refs/heads/master@{#443964} [modify] https://crrev.com/a2377c097a1fa051f90f9c02d96d010073fcb701/third_party/WebKit/Source/wtf/text/WTFString.cpp [modify] https://crrev.com/a2377c097a1fa051f90f9c02d96d010073fcb701/third_party/WebKit/Source/wtf/text/WTFString.h
,
Jan 17 2017
|
|||
►
Sign in to add a comment |
|||
Comment 1 by lukasza@chromium.org
, Sep 2 2016