Bug 174893 - Created a bool pretty printer at WTF for debugging purposes
Summary: Created a bool pretty printer at WTF for debugging purposes
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Xabier Rodríguez Calvar
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-07-27 08:47 PDT by Xabier Rodríguez Calvar
Modified: 2017-07-31 02:15 PDT (History)
11 users (show)

See Also:


Attachments
Patch (2.00 KB, patch)
2017-07-27 08:48 PDT, Xabier Rodríguez Calvar
no flags Details | Formatted Diff | Diff
Patch (4.13 KB, patch)
2017-07-28 04:48 PDT, Xabier Rodríguez Calvar
no flags Details | Formatted Diff | Diff
Patch (4.62 KB, patch)
2017-07-28 08:47 PDT, Xabier Rodríguez Calvar
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Xabier Rodríguez Calvar 2017-07-27 08:47:43 PDT
created boolToChars in WTFString.h for debugging purposes
Comment 1 Xabier Rodríguez Calvar 2017-07-27 08:48:42 PDT
Created attachment 316548 [details]
Patch
Comment 2 Darin Adler 2017-07-27 09:18:16 PDT
Comment on attachment 316548 [details]
Patch

Seems OK to have this function in WTF. But "chars" is not an abbreviation we should use in new code, and I don’t think this necessarily should be in WTFString.h either, since it has nothing to do with WTF::String. I’d also like to see an example of using it in the patch that adds it rather than just adding the unused function.
Comment 3 Xabier Rodríguez Calvar 2017-07-27 14:42:45 PDT
(In reply to Darin Adler from comment #2)
> Comment on attachment 316548 [details]
> Patch
> 
> Seems OK to have this function in WTF. But "chars" is not an abbreviation we
> should use in new code, and I don’t think this necessarily should be in
> WTFString.h either, since it has nothing to do with WTF::String. I’d also
> like to see an example of using it in the patch that adds it rather than
> just adding the unused function.

Any suggestions on where to locate it or a better name? About the examples I guess I can just use it somewhere.
Comment 4 Xabier Rodríguez Calvar 2017-07-28 04:48:37 PDT
Created attachment 316632 [details]
Patch
Comment 5 Yusuke Suzuki 2017-07-28 04:50:11 PDT
How about adding MAKE_PRINT_ADAPTOR instead?
For example, JSC/SpeculatedType uses this mechanism to dump a special string while SpeculatedType is just uint64_t.
Comment 6 Xabier Rodríguez Calvar 2017-07-28 08:47:46 PDT
Created attachment 316642 [details]
Patch
Comment 7 Xabier Rodríguez Calvar 2017-07-28 08:49:57 PDT
(In reply to Yusuke Suzuki from comment #5)
> How about adding MAKE_PRINT_ADAPTOR instead?
> For example, JSC/SpeculatedType uses this mechanism to dump a special string
> while SpeculatedType is just uint64_t.

I think it's overengineering for what I need. Besides, there's already PrintStream taking bool and I don't use it because I just want to avoid casting when printing log or doing what the function does but inlined.

Anyway, you gave me the idea of PrintStream.h maybe being the place for the function.
Comment 8 WebKit Commit Bot 2017-07-31 02:15:02 PDT
Comment on attachment 316642 [details]
Patch

Clearing flags on attachment: 316642

Committed r220058: <http://trac.webkit.org/changeset/220058>
Comment 9 WebKit Commit Bot 2017-07-31 02:15:04 PDT
All reviewed patches have been landed.  Closing bug.
Comment 10 Radar WebKit Bug Importer 2017-07-31 02:15:42 PDT
<rdar://problem/33621437>