Debugging using XCode

540 views
Skip to first unread message

Sriram Srinivasan

unread,
Feb 14, 2015, 1:00:45 AM2/14/15
to Chromium-dev
Hi, 
 I am following instructions in this wiki so I can attach XCode debugger to Chrome to debug an issue. Where are the generated .xcodeproj saved?

I am not able to find them after regenerating the projects.

Thanks,
Sriram

Thiago Farina

unread,
Feb 14, 2015, 6:45:02 AM2/14/15
to Sriram Srinivasan, Chromium-dev
On Sat, Feb 14, 2015 at 4:00 AM, Sriram Srinivasan <srir...@chromium.org> wrote:
Hi, 
 I am following instructions in this wiki so I can attach XCode debugger to Chrome to debug an issue. Where are the generated .xcodeproj saved?

What is set your GYP_GENERATORS variable?

Is it to something like GYP_GENERATORS=ninja,xcode?

btw, I'm assuming you are building with GYP.

I am not able to find them after regenerating the projects.

I think GYP should put it under out/Debug or out/Release by default, unless you tell it to put elsewhere, which is also possible.

Please, provide more details of your setup so we can help you figure it out.

Regards,

--
Thiago Farina

Sriram Srinivasan

unread,
Feb 17, 2015, 1:04:33 PM2/17/15
to Thiago Farina, Chromium-dev

yes, I have my GYP_GENERATORS set to that. See below:

echo $GYP_GENERATORS

ninja,xcode

Also I tried searching for files under both the directory and still could not find any .xcodeproj file. 


Thiago Farina

unread,
Feb 17, 2015, 1:11:59 PM2/17/15
to Sriram Srinivasan, Chromium-dev
Looks like it is called xcode-ninja these days.


Are you at least getting ninja files under out/Debug? Do you pass -Goutput_dir to gyp_chromium? Do you set GYP_GENERATOR_OUTPUT?

-- 
Thiago Farina

arunoday sarkar

unread,
Feb 17, 2015, 2:15:41 PM2/17/15
to Thiago Farina, Sriram Srinivasan, Chromium-dev
To my knowledge there might be a better way to debug using Xcode.

First of all when you load Chromium into Xcode , the universe will explode. Indexing takes about an hour or perhaps more if you have a relatively slower system. There is a doc on how to load the entire project without slowing down your system.

You might just want to generate your project using ninja and build them.

Once built , launch Xcode by creating a dummy project and attach the PID to the debugger. At this point you may open any files you were working on and start adding break point.

Hope this helps.

Cheers

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev

To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.

Sylvain Defresne

unread,
Feb 17, 2015, 2:38:54 PM2/17/15
to a.sark...@gmail.com, Thiago Farina, Sriram Srinivasan, Chromium-dev
With xcode-ninja, you should be able to open the project without any problem (at least, I regularly do it). With that settings, Xcode invokes ninja to do the build and does not have to process all the dependency, while still giving you access to the source.

I'm doing it using the following file named chromium.gyp_env located at ~/chromium (i.e. the same location as the .gclient file), when the chromium source is at ~/chromium/src:

$ cat chromium.gyp_env
{
  "GYP_GENERATORS"     : "ninja,xcode-ninja",
  "GYP_GENERATOR_FLAGS":
      "xcode_project_version=3.2 " +
      "xcode_ninja_main_gyp=src/build/ninja/all.ninja.gyp " +
      "xcode_ninja_executable_target_pattern=" +
          "^(chrome_initial|(sync_(integration_)?tests)|" +
          "(base|net|ui|components)_unittests|unit_tests|" +
          "browser_tests|interactive_ui_tests)$",
}

Then in Xcode select chrome_initial (or your test target) and use command-B (to build) or command-R (to launch).
-- Sylvain
Reply all
Reply to author
Forward
0 new messages