1"use strict";(self.webpackChunkelectronjs=self.webpackChunkelectronjs||[]).push([["3451"],{40781(e,t,n){n.r(t),n.d(t,{metadata:()=>o,default:()=>l,frontMatter:()=>d,contentTitle:()=>s,toc:()=>a,assets:()=>c});var o=JSON.parse('{"id":"latest/development/debugging-with-xcode","title":"Debugging with XCode","description":"Run gn gen with the --ide=xcode argument.","source":"@site/docs/latest/development/debugging-with-xcode.md","sourceDirName":"latest/development","slug":"/latest/development/debugging-with-xcode","permalink":"/docs/latest/development/debugging-with-xcode","draft":false,"unlisted":false,"editUrl":"https://github.com/electron/electron/edit/main/docs/development/debugging-with-xcode.md","tags":[],"version":"current","frontMatter":{"title":"Debugging with XCode","description":"Run gn gen with the --ide=xcode argument.","slug":"debugging-with-xcode","hide_title":false},"sidebar":"docs","previous":{"title":"Debugging on Windows","permalink":"/docs/latest/development/debugging-on-windows"},"next":{"title":"Setting Up Symbol Server in Debugger","permalink":"/docs/latest/development/debugging-with-symbol-server"}}'),i=n(74848),r=n(28453);let d={title:"Debugging with XCode",description:"Run gn gen with the --ide=xcode argument.",slug:"debugging-with-xcode",hide_title:!1},s,c={},a=[{value:"Debugging with XCode",id:"debugging-with-xcode",level:2},{value:"Generate xcode project for debugging sources (cannot build code from xcode)",id:"generate-xcode-project-for-debugging-sources-cannot-build-code-from-xcode",level:3},{value:"Debugging and breakpoints",id:"debugging-and-breakpoints",level:3}];function g(e){let t={code:"code",h2:"h2",h3:"h3",p:"p",pre:"pre",...(0,r.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.h2,{id:"debugging-with-xcode",children:"Debugging with XCode"}),"\n",(0,i.jsx)(t.h3,{id:"generate-xcode-project-for-debugging-sources-cannot-build-code-from-xcode",children:"Generate xcode project for debugging sources (cannot build code from xcode)"}),"\n",(0,i.jsxs)(t.p,{children:["Run ",(0,i.jsx)(t.code,{children:"gn gen"})," with the --ide=xcode argument."]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-sh",children:"$ gn gen out/Testing --ide=xcode\n"})}),"\n",(0,i.jsx)(t.p,{children:"This will generate the electron.ninja.xcworkspace. You will have to open this workspace\nto set breakpoints and inspect."}),"\n",(0,i.jsxs)(t.p,{children:["See ",(0,i.jsx)(t.code,{children:"gn help gen"})," for more information on generating IDE projects with GN."]}),"\n",(0,i.jsx)(t.h3,{id:"debugging-and-breakpoints",children:"Debugging and breakpoints"}),"\n",(0,i.jsx)(t.p,{children:"Launch Electron app after build.\nYou can now open the xcode workspace created above and attach to the Electron process\nthrough the Debug > Attach To Process > Electron debug menu. [Note: If you want to debug\nthe renderer process, you need to attach to the Electron Helper as well.]"}),"\n",(0,i.jsx)(t.p,{children:"You can now set breakpoints in any of the indexed files. However, you will not be able\nto set breakpoints directly in the Chromium source.\nTo set break points in the Chromium source, you can choose Debug > Breakpoints > Create\nSymbolic Breakpoint and set any function name as the symbol. This will set the breakpoint\nfor all functions with that name, from all the classes if there are more than one.\nYou can also do this step of setting break points prior to attaching the debugger,\nhowever, actual breakpoints for symbolic breakpoint functions may not show up until the\ndebugger is attached to the app."})]})}function l(e={}){let{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(g,{...e})}):g(e)}},28453(e,t,n){n.d(t,{R:()=>d,x:()=>s});var o=n(96540);let i={},r=o.createContext(i);function d(e){let t=o.useContext(r);return o.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:d(e.components),o.createElement(r.Provider,{value:t},e.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.