<?xml version="1.0" encoding="UTF-8"?>        <rss version="2.0"
             xmlns:atom="http://www.w3.org/2005/Atom"
             xmlns:dc="http://purl.org/dc/elements/1.1/"
             xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
             xmlns:admin="http://webns.net/mvcb/"
             xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
             xmlns:content="http://purl.org/rss/1.0/modules/content/">
        <channel>
            <title>
									macOS - Lazarus - Install GDB as debugger through HomeBrew - Delphi, Lazarus, Free Pascal				            </title>
            <link>https://www.tweaking4all.com/forum/delphi-lazarus-free-pascal/macos-lazarus-install-gdb-as-debugger-through-homebrew/</link>
            <description>Tweaking4All.com Discussion Board</description>
            <language>en-US</language>
            <lastBuildDate>Mon, 15 Jun 2026 20:34:27 +0000</lastBuildDate>
            <generator>wpForo</generator>
            <ttl>60</ttl>
							                    <item>
                        <title>RE: macOS - Lazarus - Install GDB as debugger through HomeBrew</title>
                        <link>https://www.tweaking4all.com/forum/delphi-lazarus-free-pascal/macos-lazarus-install-gdb-as-debugger-through-homebrew/#post-5075</link>
                        <pubDate>Sat, 23 Sep 2023 11:34:43 +0000</pubDate>
                        <description><![CDATA[NOTE:
Even though GDB is said to support Apple Silicon, the GDB setup through Brew does not support Apple Silicon (yet).
gdb: The x86_64 architecture is required for this software.
Error:...]]></description>
                        <content:encoded><![CDATA[<p><span style="color: #ff0000"><strong>NOTE:</strong></span></p>
<p>Even though GDB is said to support Apple Silicon, the <strong>GDB setup through</strong> <strong>Brew does not support Apple Silicon</strong> (yet).</p>
<pre contenteditable="false">gdb: The x86_64 architecture is required for this software.
Error: gdb: An unsatisfied requirement failed this build.</pre>]]></content:encoded>
						                            <category domain="https://www.tweaking4all.com/forum/delphi-lazarus-free-pascal/">Delphi, Lazarus, Free Pascal</category>                        <dc:creator>Hans</dc:creator>
                        <guid isPermaLink="true">https://www.tweaking4all.com/forum/delphi-lazarus-free-pascal/macos-lazarus-install-gdb-as-debugger-through-homebrew/#post-5075</guid>
                    </item>
				                    <item>
                        <title>macOS - Lazarus - Install GDB as debugger through HomeBrew</title>
                        <link>https://www.tweaking4all.com/forum/delphi-lazarus-free-pascal/macos-lazarus-install-gdb-as-debugger-through-homebrew/#post-5074</link>
                        <pubDate>Sat, 23 Sep 2023 11:30:51 +0000</pubDate>
                        <description><![CDATA[I keep running in to LLDB issues, so I figure; why not give good old GDB another try.Building from source was a little much and HowBrew alreayd provides version 13.x at the time of this writ...]]></description>
                        <content:encoded><![CDATA[<p>I keep running in to LLDB issues, so I figure; why not give good old GDB another try.<br />Building from source was a little much and HowBrew alreayd provides version 13.x at the time of this writing.</p>
<p><span style="color: #808080"><em><strong>Note</strong></em>: I do assume that you have an official developer certificate from Apple (something like "Developer ID Application: John Doe (X5G11N0FH1)"). </span><br /><span style="color: #808080">You can of course generate your own certificate (so called "self signed") but since I have to pay for mine yearly so I can provide free signed and notarized software here, I figured I'd rather use that.</span></p>
<p> </p>
<p>So this is how I go this to work:</p>
<p>1) Install homebrew if needed:<br /><br /></p>
<pre contenteditable="false">/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"</pre>
<p><br />2) Install GDB (v13.x):<br /><br /></p>
<pre contenteditable="false">brew install gdb</pre>
<p>3) Create an entitlements file.</p>
<p>I called it "<strong>gdb-entitlements.xml</strong>" and just placed it in the dir I'm working in (in my case in ~ ).<br /><br />Content:</p>
<pre contenteditable="false">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;
&lt;dict&gt;
    &lt;key&gt;com.apple.security.cs.allow-jit&lt;/key&gt;
    &lt;true/&gt;
    &lt;key&gt;com.apple.security.cs.allow-unsigned-executable-memory&lt;/key&gt;
    &lt;true/&gt;
    &lt;key&gt;com.apple.security.cs.allow-dyld-environment-variables&lt;/key&gt;
    &lt;true/&gt;
    &lt;key&gt;com.apple.security.cs.disable-library-validation&lt;/key&gt;
    &lt;true/&gt;
    &lt;key&gt;com.apple.security.cs.disable-executable-page-protection&lt;/key&gt;
    &lt;true/&gt;
    &lt;key&gt;com.apple.security.cs.debugger&lt;/key&gt;
    &lt;true/&gt;
    &lt;key&gt;com.apple.security.get-task-allow&lt;/key&gt;
    &lt;true/&gt;
&lt;/dict&gt;
&lt;/plist&gt;</pre>
<p><br />4) Codesign with your own certificate: </p>
<p><span style="color: #808080"><em><strong>Note</strong></em>: replace &lt;YOUR CERTIFICATE NAME&gt; with the full name as shown in Keychain in the section "Name" next to field "Common Name", something like "Developer ID Application: John Doe (X5G11N0FH1)".</span><br /><br /></p>
<pre contenteditable="false">codesign --entitlements gdb-entitlement.xml -fs "&lt;YOUR CERTIFICATE NAME&gt;" $(which gdb)</pre>
<p><br />5) Optionally verify signing if needed with:<br /><br /></p>
<pre contenteditable="false">codesign -vv $(which gdb)</pre>
<p><br />Now in Lazarus, go to "<strong>Lazarus</strong>" - "<strong>Preferences</strong>" - "<strong>IDE Options</strong>" - "<strong>Debugger</strong>" - "<strong>Debugger backend</strong>" and set it to standard GNU Debugger, path "<strong>/usr/local/bin/gdb</strong>".</p>
451
<p><br />Note:</p>
<ul>
<li>When debugging you may need to to a <strong>Clean Up and Build</strong> for your project as it may still contain invalid debug info.</li>
<li>You may need to <strong>set debugger on project level</strong> as well, in case you have changed that in the past to a non-default debugger.</li>
<li>For your project make sure Options -&gt; Compiler Options -&gt; Debugging -&gt; "<strong>Type of debug info</strong>" is set to "Automatic" in case you had set that to something else in the past.</li>
<li><span style="color: #ff0000"><strong>I had to restart Lazarus once for some reason before the debugger kicked in correctly.</strong></span> <br />Somehow it gave an error. After restarting Lazarus GDB worked just fine.</li>
<li>I tested this on Monterey (Intel Mac).</li>
</ul>]]></content:encoded>
						                            <category domain="https://www.tweaking4all.com/forum/delphi-lazarus-free-pascal/">Delphi, Lazarus, Free Pascal</category>                        <dc:creator>Hans</dc:creator>
                        <guid isPermaLink="true">https://www.tweaking4all.com/forum/delphi-lazarus-free-pascal/macos-lazarus-install-gdb-as-debugger-through-homebrew/#post-5074</guid>
                    </item>
							        </channel>
        </rss>
		