<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Problem with GDB on Devcpp</title>
		<link>http://www.allegro.cc/forums/view/574504</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Tue, 28 Mar 2006 02:15:07 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hello,<br />I was wondering why GDB is running fine let&#39;s say for a simple program like this </p><div class="source-code snippet"><div class="inner"><pre><span class="k1">int</span> main<span class="k2">(</span><span class="k2">)</span>
<span class="k2">{</span>
   <span class="k1">int</span> i<span class="k2">;</span>
   <span class="c">// do some stuff</span>
   i <span class="k3">=</span> <span class="n">3</span><span class="k2">;</span>
   i<span class="k3">+</span><span class="k3">=</span> <span class="n">5</span><span class="k2">;</span>
   <span class="k1">return</span> <span class="n">0</span><span class="k2">;</span>
<span class="k2">}</span>
</pre></div></div><p>

but isn&#39;t working with my allegro program. I got a segmentation fault.
</p><div class="source-code"><div class="toolbar"></div><div class="inner"><table width="100%"><tbody><tr><td class="number">1</td><td><span class="p">#include &lt;allegro.h&gt;</span></td></tr><tr><td class="number">2</td><td>&#160;</td></tr><tr><td class="number">3</td><td><span class="k1">int</span> main<span class="k2">(</span><span class="k2">)</span> <span class="k2">{</span></td></tr><tr><td class="number">4</td><td>  <span class="k1">int</span> depth, res<span class="k2">;</span></td></tr><tr><td class="number">5</td><td>  <a href="http://www.allegro.cc/manual/allegro_init" target="_blank"><span class="a">allegro_init</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">6</td><td>  depth <span class="k3">=</span> <a href="http://www.allegro.cc/manual/desktop_color_depth" target="_blank"><span class="a">desktop_color_depth</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">7</td><td>  <span class="k1">if</span> <span class="k2">(</span>depth <span class="k3">=</span><span class="k3">=</span> <span class="n">0</span><span class="k2">)</span> depth <span class="k3">=</span> <span class="n">32</span><span class="k2">;</span></td></tr><tr><td class="number">8</td><td>  <a href="http://www.allegro.cc/manual/set_color_depth" target="_blank"><span class="a">set_color_depth</span></a><span class="k2">(</span>depth<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">9</td><td>  res <span class="k3">=</span> <a href="http://www.allegro.cc/manual/set_gfx_mode" target="_blank"><span class="a">set_gfx_mode</span></a><span class="k2">(</span>GFX_AUTODETECT_WINDOWED, <span class="n">640</span>, <span class="n">480</span>, <span class="n">0</span>, <span class="n">0</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">10</td><td>  <span class="k1">if</span> <span class="k2">(</span>res <span class="k3">!</span><span class="k3">=</span> <span class="n">0</span><span class="k2">)</span> <span class="k2">{</span></td></tr><tr><td class="number">11</td><td>    <a href="http://www.allegro.cc/manual/allegro_message" target="_blank"><span class="a">allegro_message</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/allegro_error" target="_blank"><span class="a">allegro_error</span></a><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">12</td><td>    <a href="http://www.delorie.com/djgpp/doc/libc/libc_298.html" target="_blank">exit</a><span class="k2">(</span><span class="k3">-</span><span class="n">1</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">13</td><td>  <span class="k2">}</span></td></tr><tr><td class="number">14</td><td>  <a href="http://www.allegro.cc/manual/install_keyboard" target="_blank"><span class="a">install_keyboard</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">15</td><td>&#160;</td></tr><tr><td class="number">16</td><td>  <span class="k1">while</span> <span class="k2">(</span><span class="k3">!</span><a href="http://www.allegro.cc/manual/key" target="_blank"><span class="a">key</span></a><span class="k2">[</span>KEY_ESC<span class="k2">]</span><span class="k2">)</span> <span class="k2">{</span></td></tr><tr><td class="number">17</td><td>    <span class="c">/* put your code here */</span></td></tr><tr><td class="number">18</td><td>  <span class="k2">}</span></td></tr><tr><td class="number">19</td><td>&#160;</td></tr><tr><td class="number">20</td><td>  <a href="http://www.allegro.cc/manual/allegro_exit" target="_blank"><span class="a">allegro_exit</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">21</td><td>  <span class="k1">return</span> <span class="n">0</span><span class="k2">;</span></td></tr><tr><td class="number">22</td><td><span class="k2">}</span></td></tr><tr><td class="number">23</td><td><a href="http://www.allegro.cc/manual/END_OF_MAIN" target="_blank"><span class="a">END_OF_MAIN</span></a><span class="k2">(</span><span class="k2">)</span></td></tr></tbody></table></div></div><p>

I have enable &quot;Generate debugging information&quot;<br />I am compiling with -Wall -g and I am linking to liballd.a</p><p>Help please.<br />Thanks in advance
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Sophat Pheng)</author>
		<pubDate>Thu, 23 Mar 2006 04:44:50 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Code looks fine. Are you debugging step by step and it throws the exception, or it throws when trying to run it with F5?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (ReyBrujo)</author>
		<pubDate>Thu, 23 Mar 2006 06:49:53 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>When i&#39;m not debugging, it runs fines but it throws the error when I&#39;m doing step-by-step (shift+F4) or simply debut (F8)</p><p>Im using Devcpp 4.9.9.2 (beta 5 release 9) could that be the problem ?</p><p>EDIT:<br />I&#39;ve just uninstall everything and I reinstalled Mingw32 3.1.0-1 and devcpp 4.9.9.2 without mingw. I switch from allegro 4.2 to allegro 4.03 and I compiled the profile, debug and release version of the library. GDB version is 5.2.1<br />It still doesn&#39;t work and I&#39;m running out of ideas... <img src="http://www.allegro.cc/forums/smileys/cry.gif" alt=":&#39;(" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Sophat Pheng)</author>
		<pubDate>Thu, 23 Mar 2006 08:14:15 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Well... showing us the full source and telling us what line it tells you the segfault is at would help.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (BAF)</author>
		<pubDate>Fri, 24 Mar 2006 04:58:22 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Well the code I posted is actually the full source. Also, wherever I put my breakpoint, a segmentation fault happens.</p><p>I&#39;m running on XP.</p><p>I fount out in other threads that I&#39;m not the only one having this problem and maybe GDB is at fault since it wasn&#39;t made to run on windows. Any advices are still appreciated.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Sophat Pheng)</author>
		<pubDate>Mon, 27 Mar 2006 09:10:19 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Yes, GDB in Windows isn&#39;t the most stable thing in the world. Seems to be a recurring problem for MinGW users.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Kitty Cat)</author>
		<pubDate>Mon, 27 Mar 2006 09:56:55 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;ve never had problem with it under windows ... But I think I got teh fluid ;-p
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (GullRaDriel)</author>
		<pubDate>Mon, 27 Mar 2006 18:04:30 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I see you&#39;re not setting GFX_TEXT before calling allegro_message if failing to set a graphic mode.  Also, I thought there was an issue about installing keyboard before as well?</p><p>Can the example programs set GFX_AUTODETECT_WINDOWED 640 480 @ 32bpp?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Arthur Kalliokoski)</author>
		<pubDate>Tue, 28 Mar 2006 02:15:07 +0000</pubDate>
	</item>
</rss>
