<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.trinitydesktop.net/index.php?action=history&amp;feed=atom&amp;title=Debugging_TDE_applications</id>
	<title>Debugging TDE applications - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.trinitydesktop.net/index.php?action=history&amp;feed=atom&amp;title=Debugging_TDE_applications"/>
	<link rel="alternate" type="text/html" href="https://wiki.trinitydesktop.net/index.php?title=Debugging_TDE_applications&amp;action=history"/>
	<updated>2026-05-12T11:26:51Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.13</generator>
	<entry>
		<id>https://wiki.trinitydesktop.net/index.php?title=Debugging_TDE_applications&amp;diff=3150&amp;oldid=prev</id>
		<title>Blu256: Update information about placing a breakpoint in gdb</title>
		<link rel="alternate" type="text/html" href="https://wiki.trinitydesktop.net/index.php?title=Debugging_TDE_applications&amp;diff=3150&amp;oldid=prev"/>
		<updated>2023-06-13T13:27:57Z</updated>

		<summary type="html">&lt;p&gt;Update information about placing a breakpoint in gdb&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 13:27, 13 June 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 56:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 56:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-deletedline diff-side-deleted&quot;&gt;&lt;div&gt;You can now set breakpoints everywhere. For example lets set a breakpoint in the &amp;lt;code&amp;gt;TDEApplication&amp;lt;/code&amp;gt; constructor. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Unfortunately&lt;/del&gt; &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;gdb&lt;/del&gt; &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;is&lt;/del&gt; &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;not very good in handling&lt;/del&gt; C++ &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;names&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;so&lt;/del&gt; &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;it&lt;/del&gt; &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;is&lt;/del&gt; not &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;really possible to specify the constructor directly after the break command. Instead we&lt;/del&gt; look up &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;a&lt;/del&gt; line of source code where we want to place the breakpoint. An external editor is of great use at this point. With the list command we can select the source file we are interested in and verify that we have found the correct source line:&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;div&gt;You can now set breakpoints everywhere. For example lets set a breakpoint in the &amp;lt;code&amp;gt;TDEApplication&amp;lt;/code&amp;gt; constructor. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;We&lt;/ins&gt; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;can&lt;/ins&gt; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;use&lt;/ins&gt; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;the&lt;/ins&gt; C++ &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;function name or&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;if&lt;/ins&gt; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;that&lt;/ins&gt; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;does&lt;/ins&gt; not &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;work,&lt;/ins&gt; look up &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;the&lt;/ins&gt; line of source code where we want to place the breakpoint. An external editor is of great use at this point. With the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;`&lt;/ins&gt;list&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;`&lt;/ins&gt; command we can select the source file we are interested in and verify that we have found the correct source line:&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=&quot;shell-session&quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=&quot;shell-session&quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;!-- diff cache key mwdb:diff:wikidiff2:1.12:old-1637:rev-3150:1.13.0 --&gt;
&lt;/table&gt;</summary>
		<author><name>Blu256</name></author>
	</entry>
	<entry>
		<id>https://wiki.trinitydesktop.net/index.php?title=Debugging_TDE_applications&amp;diff=1637&amp;oldid=prev</id>
		<title>Blu256: small formatting fixes</title>
		<link rel="alternate" type="text/html" href="https://wiki.trinitydesktop.net/index.php?title=Debugging_TDE_applications&amp;diff=1637&amp;oldid=prev"/>
		<updated>2021-07-31T09:57:18Z</updated>

		<summary type="html">&lt;p&gt;small formatting fixes&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 09:57, 31 July 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-deletedline diff-side-deleted&quot;&gt;&lt;div&gt;This is a short tutorial on debugging Trinity applications. Throughout this tutorial I will use &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&quot;&lt;/del&gt;kedit&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&quot;&lt;/del&gt; as example application.&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;div&gt;This is a short tutorial on debugging Trinity applications. Throughout this tutorial I will use &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;code&amp;gt;&lt;/ins&gt;kedit&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;/code&amp;gt;&lt;/ins&gt; as example application.&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;= Configuring for debugging =&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;= Configuring for debugging =&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 17:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 17:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;# You can run gdb after an application has crashed using a core file.&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;# You can run gdb after an application has crashed using a core file.&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-deletedline diff-side-deleted&quot;&gt;&lt;div&gt;= Starting applications from within gdb =&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;=&lt;/ins&gt;= Starting applications from within gdb &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;=&lt;/ins&gt;=&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;To start an application with gdb you can start gdb as follows:&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;To start an application with gdb you can start gdb as follows:&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;!-- diff cache key mwdb:diff:wikidiff2:1.12:old-1636:rev-1637:1.13.0 --&gt;
&lt;/table&gt;</summary>
		<author><name>Blu256</name></author>
	</entry>
	<entry>
		<id>https://wiki.trinitydesktop.net/index.php?title=Debugging_TDE_applications&amp;diff=1636&amp;oldid=prev</id>
		<title>Blu256: Added section on kdDebug() and tdedebugdialog -- additions/corrections welcome</title>
		<link rel="alternate" type="text/html" href="https://wiki.trinitydesktop.net/index.php?title=Debugging_TDE_applications&amp;diff=1636&amp;oldid=prev"/>
		<updated>2021-07-27T13:25:33Z</updated>

		<summary type="html">&lt;p&gt;Added section on kdDebug() and tdedebugdialog -- additions/corrections welcome&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 13:25, 27 July 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 161:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 161:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;$ ulimit -c unlimited&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;$ ulimit -c unlimited&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;div&gt;= Getting kdDebug() output =&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;div&gt;When a program is configured with debugging mode on, you also get to see debug messages from your code (generated by &amp;lt;code&amp;gt;kdDebug()&amp;lt;/code&amp;gt;). The easiest way to see them is run the program from a Konsole window.&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;div&gt;You can configure the messages you see through &amp;lt;code&amp;gt;tdedebugdialog&amp;lt;/code&amp;gt; You can also redirect these messages to the syslog or a file. To configure this, launch &amp;lt;code&amp;gt;tdedebugdialog&amp;lt;/code&amp;gt; with the &amp;lt;code&amp;gt;--fullmode&amp;lt;/code&amp;gt; argument.&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;[[Category:Developers]]&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;[[Category:Developers]]&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;!-- diff cache key mwdb:diff:wikidiff2:1.12:old-1635:rev-1636:1.13.0 --&gt;
&lt;/table&gt;</summary>
		<author><name>Blu256</name></author>
	</entry>
	<entry>
		<id>https://wiki.trinitydesktop.net/index.php?title=Debugging_TDE_applications&amp;diff=1635&amp;oldid=prev</id>
		<title>Blu256: Addition for CMake</title>
		<link rel="alternate" type="text/html" href="https://wiki.trinitydesktop.net/index.php?title=Debugging_TDE_applications&amp;diff=1635&amp;oldid=prev"/>
		<updated>2021-07-27T13:17:16Z</updated>

		<summary type="html">&lt;p&gt;Addition for CMake&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 13:17, 27 July 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 3:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 3:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;= Configuring for debugging =&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;= Configuring for debugging =&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;div&gt;To build with debugging code, pass &amp;lt;code&amp;gt;-DCMAKE_BUILD_TYPE=&quot;Debug&quot;&amp;lt;/code&amp;gt; to CMake while configuring. If the application you are building is still using Autotools, you can use &amp;lt;code&amp;gt;--enable-debug&amp;lt;/code&amp;gt; with the configure script to get debug code in it.&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-deletedline diff-side-deleted&quot;&gt;&lt;div&gt;You can use &amp;lt;code&amp;gt;--enable-debug&amp;lt;/code&amp;gt; with the configure script, if you want to have debug code in your TDE libs. If you have the space and can stand code that&#039;s somewhat slower, this is worth it. The extra information really helps debugging and thus bugfixing.&lt;/div&gt;&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-added&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-deletedline diff-side-deleted&quot;&gt;&lt;div&gt;On the other hand, &amp;lt;code&amp;gt;--disable-debug&amp;lt;/code&amp;gt; removes all debug messages, leading to a faster and cleaner desktop.&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;If you have the space and can stand code that&#039;s somewhat slower, this is worth it. The extra information really helps debugging and thus bugfixing. &lt;/ins&gt;On the other hand,&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt; &amp;lt;code&amp;gt;-DCMAKE_BUILD_TYPE=&quot;Release&quot;&amp;lt;/code&amp;gt; (for CMake) and&lt;/ins&gt; &amp;lt;code&amp;gt;--disable-debug&amp;lt;/code&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt; (for Autotools)&lt;/ins&gt; removes all debug messages, leading to a faster and cleaner desktop.&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;= Debugging with GDB =&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;= Debugging with GDB =&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 89:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 89:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-deletedline diff-side-deleted&quot;&gt;&lt;div&gt;= Attaching &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;gdb&lt;/del&gt; to already running applications =&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;=&lt;/ins&gt;= Attaching &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;GDB&lt;/ins&gt; to already running applications &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;=&lt;/ins&gt;=&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;Sometimes it is not practical to start an application from within gdb (e.g. in those cases where you didn&#039;t know the application was about to crash :-)&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;Sometimes it is not practical to start an application from within gdb (e.g. in those cases where you didn&#039;t know the application was about to crash :-)&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 150:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 150:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-deletedline diff-side-deleted&quot;&gt;&lt;div&gt;= Getting core dumps =&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;=&lt;/ins&gt;= Getting core dumps &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;=&lt;/ins&gt;=&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;If you want to have a core dump after your application crashes you need to &lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;If you want to have a core dump after your application crashes you need to &lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;!-- diff cache key mwdb:diff:wikidiff2:1.12:old-1634:rev-1635:1.13.0 --&gt;
&lt;/table&gt;</summary>
		<author><name>Blu256</name></author>
	</entry>
	<entry>
		<id>https://wiki.trinitydesktop.net/index.php?title=Debugging_TDE_applications&amp;diff=1634&amp;oldid=prev</id>
		<title>Blu256: /* Attaching gdb to already running applications */ Formatting</title>
		<link rel="alternate" type="text/html" href="https://wiki.trinitydesktop.net/index.php?title=Debugging_TDE_applications&amp;diff=1634&amp;oldid=prev"/>
		<updated>2021-07-27T12:58:19Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Attaching gdb to already running applications: &lt;/span&gt; Formatting&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 12:58, 27 July 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 91:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 91:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;= Attaching gdb to already running applications =&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;= Attaching gdb to already running applications =&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-deletedline diff-side-deleted&quot;&gt;&lt;div&gt;Sometimes it is not practical to start an application from within gdb.&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;div&gt;Sometimes it is not practical to start an application from within gdb&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt; (e&lt;/ins&gt;.&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;g. in those cases where you didn&#039;t know the application was about to crash :-)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;a class=&quot;mw-diff-movedpara-left&quot; title=&quot;Paragraph was moved. Click to jump to new location.&quot; href=&quot;#movedpara_4_0_rhs&quot;&gt;&amp;#x26AB;&lt;/a&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-deletedline diff-side-deleted&quot;&gt;&lt;div&gt;&lt;a name=&quot;movedpara_2_0_lhs&quot;&gt;&lt;/a&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;E.g. in those cases where you didn&#039;t know the application was about to crash :-) &lt;/del&gt;When you get the friendly DrKonqi dialog informing you about a crash you are just in time to start your debugger.&lt;/div&gt;&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-added&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;a class=&quot;mw-diff-movedpara-right&quot; title=&quot;Paragraph was moved. Click to jump to old location.&quot; href=&quot;#movedpara_2_0_lhs&quot;&gt;&amp;#x26AB;&lt;/a&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;div&gt;&lt;a name=&quot;movedpara_4_0_rhs&quot;&gt;&lt;/a&gt;When you get the friendly DrKonqi dialog informing you about a crash you are just in time to start your debugger.&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-deletedline diff-side-deleted&quot;&gt;&lt;div&gt;First lets attach gdb to an application that hasn&#039;t crashed (yet).&lt;/div&gt;&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-added&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-deletedline diff-side-deleted&quot;&gt;&lt;div&gt;You start with finding the process of the application with e.g. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&quot;&lt;/del&gt;ps -aux&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&quot;&lt;/del&gt;:&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;First, let&#039;s attach gdb to an application that hasn&#039;t crashed (yet). &lt;/ins&gt;You start with finding the process of the application with e.g. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;code&amp;gt;&lt;/ins&gt;ps -aux&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;/code&amp;gt;&lt;/ins&gt;:&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=&quot;shell-session&quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=&quot;shell-session&quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;!-- diff cache key mwdb:diff:wikidiff2:1.12:old-1633:rev-1634:1.13.0 --&gt;
&lt;/table&gt;</summary>
		<author><name>Blu256</name></author>
	</entry>
	<entry>
		<id>https://wiki.trinitydesktop.net/index.php?title=Debugging_TDE_applications&amp;diff=1633&amp;oldid=prev</id>
		<title>Blu256: Added debugging instructions (imported from tdelibs/DEBUG file)</title>
		<link rel="alternate" type="text/html" href="https://wiki.trinitydesktop.net/index.php?title=Debugging_TDE_applications&amp;diff=1633&amp;oldid=prev"/>
		<updated>2021-07-27T12:56:31Z</updated>

		<summary type="html">&lt;p&gt;Added debugging instructions (imported from tdelibs/DEBUG file)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This is a short tutorial on debugging Trinity applications. Throughout this tutorial I will use &amp;quot;kedit&amp;quot; as example application.&lt;br /&gt;
&lt;br /&gt;
= Configuring for debugging =&lt;br /&gt;
&lt;br /&gt;
You can use &amp;lt;code&amp;gt;--enable-debug&amp;lt;/code&amp;gt; with the configure script, if you want to have debug code in your TDE libs. If you have the space and can stand code that&amp;#039;s somewhat slower, this is worth it. The extra information really helps debugging and thus bugfixing.&lt;br /&gt;
&lt;br /&gt;
On the other hand, &amp;lt;code&amp;gt;--disable-debug&amp;lt;/code&amp;gt; removes all debug messages, leading to a faster and cleaner desktop.&lt;br /&gt;
&lt;br /&gt;
= Debugging with GDB =&lt;br /&gt;
&lt;br /&gt;
The recommended version of gdb to use is version 4.95 or higher, older versions have problems generating proper backtraces.&lt;br /&gt;
&lt;br /&gt;
There are three ways to debug an application with gdb:&lt;br /&gt;
&lt;br /&gt;
# You can start the application from within gdb.&lt;br /&gt;
# You can attach gdb to an already running application.&lt;br /&gt;
# You can run gdb after an application has crashed using a core file.&lt;br /&gt;
&lt;br /&gt;
= Starting applications from within gdb =&lt;br /&gt;
&lt;br /&gt;
To start an application with gdb you can start gdb as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell-session&amp;quot;&amp;gt;&lt;br /&gt;
$ gdb kedit&lt;br /&gt;
GNU gdb 4.95.0&lt;br /&gt;
Copyright 2000 Free Software Foundation, Inc.&lt;br /&gt;
GDB is free software, covered by the GNU General Public License, and you are&lt;br /&gt;
welcome to change it and/or distribute copies of it under certain conditions.&lt;br /&gt;
Type &amp;quot;show copying&amp;quot; to see the conditions.&lt;br /&gt;
There is absolutely no warranty for GDB.  Type &amp;quot;show warranty&amp;quot; for details.&lt;br /&gt;
This GDB was configured as &amp;quot;i686-pc-linux-gnu&amp;quot;...&lt;br /&gt;
(gdb) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can now set the command line arguments that you want to pass to kedit with &lt;br /&gt;
the gdb command &amp;lt;code&amp;gt;set args&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell-session&amp;quot;&amp;gt;&lt;br /&gt;
(gdb) set args myfile.txt&lt;br /&gt;
(gdb) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
gdb has loaded the &amp;lt;code&amp;gt;kedit&amp;lt;/code&amp;gt; executable on startup but it hasn&amp;#039;t loaded any of the libraries yet. This means that you can set any breakpoints in the libraries yet. The easiest way to do that is to set a breakpoint in the first line of main and then start the program:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell-session&amp;quot;&amp;gt;&lt;br /&gt;
(gdb) break main&lt;br /&gt;
Breakpoint 1 at 0x804855c&lt;br /&gt;
(gdb) run&lt;br /&gt;
Starting program: /opt/trinity/bin/kedit myfile.txt&lt;br /&gt;
Breakpoint 1 at 0x4002cf18: file kedit.cpp, line 1595.&lt;br /&gt;
 &lt;br /&gt;
Breakpoint 1, main (argc=2, argv=0xbffff814) at kedit.cpp:1595&lt;br /&gt;
1595            bool have_top_window = false;&lt;br /&gt;
Current language:  auto; currently c++&lt;br /&gt;
(gdb)  &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can now set breakpoints everywhere. For example lets set a breakpoint in the &amp;lt;code&amp;gt;TDEApplication&amp;lt;/code&amp;gt; constructor. Unfortunately gdb is not very good in handling C++ names, so it is not really possible to specify the constructor directly after the break command. Instead we look up a line of source code where we want to place the breakpoint. An external editor is of great use at this point. With the list command we can select the source file we are interested in and verify that we have found the correct source line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell-session&amp;quot;&amp;gt;&lt;br /&gt;
(gdb) list kapp.cpp:220&lt;br /&gt;
215         parseCommandLine( argc, argv );&lt;br /&gt;
216     }&lt;br /&gt;
217&lt;br /&gt;
218     TDEApplication::TDEApplication( bool allowStyles, bool GUIenabled ) :&lt;br /&gt;
219       QApplication( *TDECmdLineArgs::tqt_argc(), *TDECmdLineArgs::tqt_argv(),&lt;br /&gt;
220                     GUIenabled ),&lt;br /&gt;
221       TDEInstance( TDECmdLineArgs::about),&lt;br /&gt;
222       d (new TDEApplicationPrivate)&lt;br /&gt;
223     {&lt;br /&gt;
224         if (!GUIenabled)&lt;br /&gt;
(gdb) break 224&lt;br /&gt;
Breakpoint 2 at 0x4048aa7e: file kapp.cpp, line 224.&lt;br /&gt;
(gdb) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can now continue the execution of kedit. Execution will stop when it hits a breakpoint of when the program exits. In this case execution will stop in the first line of the TDEApplication constructor:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell-session&amp;quot;&amp;gt;&lt;br /&gt;
(gdb) continue&lt;br /&gt;
Continuing.&lt;br /&gt;
Qt: gdb: -nograb added to command-line options.&lt;br /&gt;
         Use the -dograb option to enforce grabbing.&lt;br /&gt;
 &lt;br /&gt;
Breakpoint 2, TDEApplication::TDEApplication (this=0xbffff6a8, allowStyles=true,&lt;br /&gt;
    GUIenabled=true) at kapp.cpp:224&lt;br /&gt;
224         if (!GUIenabled)&lt;br /&gt;
(gdb) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Attaching gdb to already running applications =&lt;br /&gt;
&lt;br /&gt;
Sometimes it is not practical to start an application from within gdb.&lt;br /&gt;
E.g. in those cases where you didn&amp;#039;t know the application was about to crash :-) When you get the friendly DrKonqi dialog informing you about a crash you are just in time to start your debugger.&lt;br /&gt;
&lt;br /&gt;
First lets attach gdb to an application that hasn&amp;#039;t crashed (yet).&lt;br /&gt;
&lt;br /&gt;
You start with finding the process of the application with e.g. &amp;quot;ps -aux&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell-session&amp;quot;&amp;gt;&lt;br /&gt;
&amp;gt; ps -aux | grep kedit &lt;br /&gt;
bastian  21570 15.1  6.8 13740 8800 pts/6    S    15:34   0:01 kedit&lt;br /&gt;
bastian  21582  0.0  0.3  1132  412 pts/6    R    15:34   0:00 grep kedit&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From this you learn that kedit has process id 21570. Now you can start gdb as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell-session&amp;quot;&amp;gt;&lt;br /&gt;
$ gdb kedit 21570&lt;br /&gt;
GNU gdb 4.95.0&lt;br /&gt;
Copyright 2000 Free Software Foundation, Inc.&lt;br /&gt;
GDB is free software, covered by the GNU General Public License, and you are&lt;br /&gt;
welcome to change it and/or distribute copies of it under certain conditions.&lt;br /&gt;
Type &amp;quot;show copying&amp;quot; to see the conditions.&lt;br /&gt;
There is absolutely no warranty for GDB.  Type &amp;quot;show warranty&amp;quot; for details.&lt;br /&gt;
This GDB was configured as &amp;quot;i686-pc-linux-gnu&amp;quot;...&lt;br /&gt;
/home1/bastian/21570: No such file or directory.&lt;br /&gt;
Attaching to program: /opt/trinity/bin/kedit, Pid 21570&lt;br /&gt;
Reading symbols from /opt/trinity/lib/kedit.so.0...done.&lt;br /&gt;
Loaded symbols for /opt/trinity/lib/kedit.so.0&lt;br /&gt;
....&lt;br /&gt;
Reading symbols from /lib/ld-linux.so.2...done.&lt;br /&gt;
Loaded symbols for /lib/ld-linux.so.2&lt;br /&gt;
Reading symbols from /lib/libnss_compat.so.2...done.&lt;br /&gt;
Loaded symbols for /lib/libnss_compat.so.2&lt;br /&gt;
Reading symbols from /lib/libnsl.so.1...done.&lt;br /&gt;
Loaded symbols for /lib/libnsl.so.1&lt;br /&gt;
0x40c3d88e in __select () from /lib/libc.so.6&lt;br /&gt;
(gdb)  &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will usually end up in the middle of a &amp;lt;code&amp;gt;select()&amp;lt;/code&amp;gt; call from the event-loop.&lt;br /&gt;
This is the place where a TDE application spends most of its time, waiting for things to happen.&lt;br /&gt;
&lt;br /&gt;
A backtrace will typically look something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell-session&amp;quot;&amp;gt;&lt;br /&gt;
(gdb) bt&lt;br /&gt;
#0  0x40c3d88e in __select () from /lib/libc.so.6&lt;br /&gt;
#1  0x40a22844 in __DTOR_END__ () at fam.c++:356&lt;br /&gt;
#2  0x407293bf in QApplication::enter_loop (this=0xbffff6e8)&lt;br /&gt;
    at kernel/qapplication.cpp:2552&lt;br /&gt;
#3  0x406b1d7b in QApplication::exec (this=0xbffff6e8)&lt;br /&gt;
    at kernel/qapplication_x11.cpp:2217&lt;br /&gt;
#4  0x4002d500 in main (argc=1, argv=0xbffff854) at kedit.cpp:1662&lt;br /&gt;
#5  0x40bbba5e in __libc_start_main (main=0x8048568 &amp;lt;main&amp;gt;, argc=1,&lt;br /&gt;
    argv=0xbffff854, init=0x8048514 &amp;lt;_init&amp;gt;, fini=0x80486cc &amp;lt;_fini&amp;gt;,&lt;br /&gt;
    rtld_fini=0x4000aa20 &amp;lt;_dl_fini&amp;gt;, stack_end=0xbffff84c)&lt;br /&gt;
    at ../sysdeps/generic/libc-start.c:92&lt;br /&gt;
(gdb)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Getting core dumps =&lt;br /&gt;
&lt;br /&gt;
If you want to have a core dump after your application crashes you need to &lt;br /&gt;
do two things:&lt;br /&gt;
&lt;br /&gt;
# Disable the TDE crash handler. This can be done either by using the &amp;lt;code&amp;gt;--nocrashhandler&amp;lt;/code&amp;gt; command line option or by setting the &amp;lt;code&amp;gt;TDE_DEBUG&amp;lt;/code&amp;gt; environment variable to some value e.g. &amp;lt;code&amp;gt;TDE_DEBUG=true&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Enable core dump generation by changing the so called &amp;#039;ulimits&amp;#039; with the following command: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell-session&amp;quot;&amp;gt;&lt;br /&gt;
$ ulimit -c unlimited&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Developers]]&lt;/div&gt;</summary>
		<author><name>Blu256</name></author>
	</entry>
</feed>