Bug 47601 - [gdb] Add pretty-print supports for UString,Identifier and JSString
Summary: [gdb] Add pretty-print supports for UString,Identifier and JSString
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-13 10:47 PDT by Yi Shen
Modified: 2010-10-14 06:19 PDT (History)
6 users (show)

See Also:


Attachments
first try (2.45 KB, patch)
2010-10-13 10:51 PDT, Yi Shen
no flags Details | Formatted Diff | Diff
fix style (2.38 KB, patch)
2010-10-13 10:58 PDT, Yi Shen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yi Shen 2010-10-13 10:47:14 PDT
To make gdb debugging easy, I add three pretty-print supports for UString,Identifier and JSString.
e.g.

Breakpoint 1, callDefaultValueFunction (exec=0xb68674f8, object=0xb6815400, 
    propertyName="toString")
    at ../../../JavaScriptCore/runtime/JSObject.cpp:249
249	    CallType callType = getCallData(function, callData);
(gdb) l
244	
245	static ALWAYS_INLINE JSValue callDefaultValueFunction(ExecState* exec, const JSObject* object, const Identifier& propertyName)
246	{
247	    JSValue function = object->get(exec, propertyName);
(gdb) d 1
(gdb) p function.toString(exec)
$1 = "function toString() {\n    [native code]\n}"
(gdb) p propertyName
$2 = "toString"

(gdb) l
295	EncodedJSValue JSC_HOST_CALL stringProtoFuncReplace(ExecState* exec)
296	{
297	    JSValue thisValue = exec->hostThisValue();
298	    JSString* sourceVal = thisValue.toThisJSString(exec);
299	    JSValue pattern = exec->argument(0);
300	    JSValue replacement = exec->argument(1);
(gdb) p *sourceVal
$2 = "abs round ceil floor"
(gdb) p pattern.toString(exec)
$3 = "/\\s+$/"
(gdb) p replacement.toString(exec)
[Thread 0xb74ffb70 (LWP 5092) exited]
$4 = "-1.9918709106886894"
Comment 1 Yi Shen 2010-10-13 10:51:47 PDT
Created attachment 70626 [details]
first try
Comment 2 WebKit Review Bot 2010-10-13 10:53:27 PDT
Attachment 70626 [details] did not pass style-queue:

Failed to run "['WebKitTools/Scripts/check-webkit-style']" exit_code: 1
WebKitTools/gdb/webkit.py:102:  expected 2 blank lines, found 1  [pep8/E302] [5]
WebKitTools/gdb/webkit.py:116:  expected 2 blank lines, found 1  [pep8/E302] [5]
WebKitTools/gdb/webkit.py:121:  expected 2 blank lines, found 1  [pep8/E302] [5]
Total errors found: 3 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Yi Shen 2010-10-13 10:58:01 PDT
Created attachment 70631 [details]
fix style
Comment 4 WebKit Commit Bot 2010-10-13 16:43:04 PDT
Comment on attachment 70631 [details]
fix style 

Clearing flags on attachment: 70631

Committed r69713: <http://trac.webkit.org/changeset/69713>
Comment 5 WebKit Commit Bot 2010-10-13 16:43:09 PDT
All reviewed patches have been landed.  Closing bug.
Comment 6 WebKit Review Bot 2010-10-13 17:10:33 PDT
http://trac.webkit.org/changeset/69713 might have broken Chromium Mac Release
Comment 7 Yi Shen 2010-10-14 06:19:34 PDT
(In reply to comment #6)
> http://trac.webkit.org/changeset/69713 might have broken Chromium Mac Release

My changes should NOT be involved in any building process.