<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>141153</bug_id>
          
          <creation_ts>2015-02-02 04:16:16 -0800</creation_ts>
          <short_desc>[GDB] Couldn&apos;t use gdb tool well for WebKit GTK</short_desc>
          <delta_ts>2017-03-11 10:49:16 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKitGTK</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>Gtk</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Park HyukWoo">clover2123</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bugs-noreply</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1066071</commentid>
    <comment_count>0</comment_count>
    <who name="Park HyukWoo">clover2123</who>
    <bug_when>2015-02-02 04:16:16 -0800</bug_when>
    <thetext>I built WebKit Gtk(revision 174059) on Ubuntu 14.04 with follow commands

$ Tools/Scripts/build-webkit --gtk --debug

and finally got MiniBrowser file in WebKitBuild/Debug/bin folder.

but when I debug MiniBrowser with gdb tool, I couldn&apos;t set breakpoints for it.

for example, I ran the following simple html file 

== test.html == 
&lt;html&gt;
&lt;head&gt;
&lt;script&gt;
window.onload = function() {
    var now = new Date();
    var a = 4;
    var c = Math.sqrt(4);
    alert(&quot;wow&quot;);
}
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;/body&gt;
&lt;/html&gt;

and set some breakpoints in WebCore and JavaScriptCore module 

but when I ran MiniBrowser in gdb, it finished execution(html load) without any break even if some breakpoints were set.

I ran MiniBrowser in gdb with follow commands

$ Tools/jhbuild/jhbuild-wrapper --gtk run gdb --args WebKitBuild/Debug/bin/MiniBrowser

$ b JSC::evaluate

$ b WebCore::Document::dispatchWindowLoadEvent



did i do something wrong? (maybe multi-thread issue?)

what should i do to debug WebCore/JavaScriptCore module in MiniBrowser?

I&apos;m debugging MiniBrowser to know the loading sequence of html file in WebKit Gtk.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1066350</commentid>
    <comment_count>1</comment_count>
    <who name="Park HyukWoo">clover2123</who>
    <bug_when>2015-02-02 20:44:31 -0800</bug_when>
    <thetext>[SOLVED]

I made a mistake for debugging WebProcess.
I wrote the debugging tips for others.

when you want to debug Web Process,
you should use gdb in remote terminal and attach to &apos;WebKitWebProcess&apos; process.
because Web Process is executed in WebKitWebProcess not in MiniBrowser process.

So, just connect to WebKitWebProcess in gdb by following command

$ gdb -p &lt;pid of WebKitWebProcess&gt;

However that doesn&apos;t work in all cases, because the web process might already have crashed when you are trying to connect to it.

You can use the WEB_PROCESS_CMD_PREFIX environment variable for that purpose. If that variable is defined the web process will be run using its value as a prefix.

Example:

WEB_PROCESS_CMD_PREFIX=&apos;/usr/bin/gdbserver localhost:8080&apos; WebKitBuild/Debug/bin/MiniBrowser

and in a different terminal:

$ libtool --mode=execute gdb WebKitBuild/Debug/bin/WebKitWebProcess
(gdb) target remote localhost:8080</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>