<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>GnuDebugger picks wrong source file</title>
		<link>http://www.allegro.cc/forums/view/591321</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Sat, 12 May 2007 14:30:04 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Has anyone else ever had any problems with running their progams in GnuDebugger and then gdb picks the wrong source file?</p><p>It&#39;s really frustrating because I can&#39;t set any breakpoints and it&#39;s only useful if my program quits suddenly and then I can use a backtrace (bt full) to find out where it was. And why does that work anyway if it is picking the wrong source file?</p><p>I&#39;ve been developing the same program for a while now and gdb has been picking the correct source file for a while now until a few weeks ago it started picking wrong source files!</p><p>I think it was about the same time I added #include&lt;fstream&gt; and #include&lt;iostream&gt; <br />but I&#39;m not sure.  The last major change I made was to add saving settings to text and data files and reading them back in.</p><p>For a while gdb would pick allegro&#39;s inline - wait a minute, I remember it started happening as soon as I added my settings class.  That&#39;s when gdb started picking allegro&#39;s inline file as source.  I was using the settings from memory and then I added file save functions to my code.  Then gdb started picking fstream as it&#39;s source file.</p><p>Here are my compiler settings.<br /><u>Compile</u><br />-Wall -mwindows -ggdb<br /><u>Link</u><br />-mwindows -lalld -ggdb</p><p>I get the same results if I use -g instead of -ggdb.</p><p>I&#39;ve tried setting the default directory to search for source files (in gdb)<br />tried just about every command I could find in gdb&#39;s help and nothing works.<br />Here is the list of includes I am using.
</p><div class="source-code snippet"><div class="inner"><pre><span class="p">#include &lt;allegro.h&gt;</span>
<span class="p">#include &lt;string.h&gt;</span>
<span class="p">#include &lt;stdio.h&gt;</span>
<span class="p">#include &lt;math.h&gt;</span>
<span class="p">#include &lt;iostream&gt;</span>
<span class="p">#include &lt;fstream&gt;</span>

<span class="c">//using std::cout;</span>
<span class="k1">using</span> std::endl<span class="k2">;</span>
<span class="k1">using</span> std::ostream<span class="k2">;</span>
<span class="k1">using</span> std::fstream<span class="k2">;</span>
<span class="k1">using</span> std::ofstream<span class="k2">;</span>
<span class="k1">using</span> std::ios<span class="k2">;</span>
</pre></div></div><p>



Does anyone know how to fix this?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Wed, 09 May 2007 10:02:26 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I add -g3 -ggdb to all my commands as well as include all the same headers as you and have had no problems ever
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (ImLeftFooted)</author>
		<pubDate>Wed, 09 May 2007 10:23:22 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Dustin, that -ggdb will override the -g3. -g args do not &quot;stack&quot;. Just like -O.</p><p>Personally, I use -ggdb3, or -gstabs+ for c++ (though I&#39;m not sure thats necessary anymore)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Wed, 09 May 2007 10:30:10 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Sorry dudes no luck with -ggdb3 or -gstabs+ ,<br />  gdb still insists my source file is fstream.<br />[center]:&#39;([/center]</p><p>By the way I am using GDB 5.2.1
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Wed, 09 May 2007 10:55:37 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Did you do a total-recompile?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (ImLeftFooted)</author>
		<pubDate>Wed, 09 May 2007 23:10:26 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Why don&#39;t you post a gdb transcript? You know you can change the source file, right?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (CGamesPlay)</author>
		<pubDate>Wed, 09 May 2007 23:38:27 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You probably might want to use cmath instead of math.h, cstring instead of string.h, and cstdio instead of stdio.h, if you want everything to be nice and tidy in the std namespace.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (BAF)</author>
		<pubDate>Wed, 09 May 2007 23:53:39 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Dustin - deleted object and executable files and recompiled, no change.</p><p>CGamesPlay - Here&#39;s a copy of what happens in gdb.  I&#39;ve looked for how to change the source file but I don&#39;t know how to do that in gdb.  All I&#39;ve been able to find are commands that change the search path for source files and that doesn&#39;t help even after unloading the executable and changing the source path search directory by using <br />cmd-&gt;file<br />cmd-&gt;directory c:\\ctwoplus\\progcode\\allegro<br />cmd-&gt;path c:\\ctwoplus\\progcode\\allegro<br />cmd-&gt;file c:\\ctwoplus\\progcode\\allegro\\shadedshapes.exe<br />(Shown in transcript below)</p><div class="source-code"><div class="toolbar"></div><div class="inner"><table width="100%"><tbody><tr><td class="number">1</td><td>C:\CtwoPlus\progcode\allegro&gt;gdb shadedshapes.exe</td></tr><tr><td class="number">2</td><td>GNU gdb <span class="n">5</span>.<span class="n">2</span>.<span class="n">1</span></td></tr><tr><td class="number">3</td><td>Copyright <span class="n">2002</span> Free Software Foundation, Inc.</td></tr><tr><td class="number">4</td><td>GDB is <a href="http://www.delorie.com/djgpp/doc/libc/libc_350.html" target="_blank">free</a> software, covered by the GNU General Public License, <span class="k1">and</span> you are</td></tr><tr><td class="number">5</td><td>welcome to change it <span class="k1">and</span><span class="k3">/</span><span class="k1">or</span> distribute copies of it under certain conditions.</td></tr><tr><td class="number">6</td><td>Type <span class="s">"show copying"</span> to see the conditions.</td></tr><tr><td class="number">7</td><td>There is absolutely no warranty <span class="k1">for</span> GDB.  Type <span class="s">"show warranty"</span> <span class="k1">for</span> details.</td></tr><tr><td class="number">8</td><td>This GDB was configured as <span class="s">"i686-pc-mingw32"</span>...</td></tr><tr><td class="number">9</td><td><span class="k2">(</span>gdb<span class="k2">)</span> list</td></tr><tr><td class="number">10</td><td><span class="n">1</span>       <span class="c">// File based streams -*- C++ -*-</span></td></tr><tr><td class="number">11</td><td><span class="n">2</span></td></tr><tr><td class="number">12</td><td><span class="n">3</span>       <span class="c">// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003</span></td></tr><tr><td class="number">13</td><td><span class="n">4</span>       <span class="c">// Free Software Foundation, Inc.</span></td></tr><tr><td class="number">14</td><td><span class="n">5</span>       <span class="c">//</span></td></tr><tr><td class="number">15</td><td><span class="n">6</span>       <span class="c">// This file is part of the GNU ISO C++ Library.  This library is free</span></td></tr><tr><td class="number">16</td><td><span class="n">7</span>       <span class="c">// software; you can redistribute it and/or modify it under the</span></td></tr><tr><td class="number">17</td><td><span class="n">8</span>       <span class="c">// terms of the GNU General Public License as published by the</span></td></tr><tr><td class="number">18</td><td><span class="n">9</span>       <span class="c">// Free Software Foundation; either version 2, or (at your option)</span></td></tr><tr><td class="number">19</td><td><span class="n">10</span>      <span class="c">// any later version.</span></td></tr><tr><td class="number">20</td><td><span class="k2">(</span>gdb<span class="k2">)</span> help</td></tr><tr><td class="number">21</td><td>List of classes of commands:</td></tr><tr><td class="number">22</td><td>&#160;</td></tr><tr><td class="number">23</td><td>aliases <span class="k3">-</span><span class="k3">-</span> Aliases of other commands</td></tr><tr><td class="number">24</td><td>breakpoints <span class="k3">-</span><span class="k3">-</span> Making program stop at certain points</td></tr><tr><td class="number">25</td><td>data <span class="k3">-</span><span class="k3">-</span> Examining data</td></tr><tr><td class="number">26</td><td>files <span class="k3">-</span><span class="k3">-</span> Specifying <span class="k1">and</span> examining files</td></tr><tr><td class="number">27</td><td>internals <span class="k3">-</span><span class="k3">-</span> Maintenance commands</td></tr><tr><td class="number">28</td><td>obscure <span class="k3">-</span><span class="k3">-</span> Obscure features</td></tr><tr><td class="number">29</td><td>running <span class="k3">-</span><span class="k3">-</span> Running the program</td></tr><tr><td class="number">30</td><td>stack <span class="k3">-</span><span class="k3">-</span> Examining the stack</td></tr><tr><td class="number">31</td><td>status <span class="k3">-</span><span class="k3">-</span> Status inquiries</td></tr><tr><td class="number">32</td><td>support <span class="k3">-</span><span class="k3">-</span> Support facilities</td></tr><tr><td class="number">33</td><td>tracepoints <span class="k3">-</span><span class="k3">-</span> Tracing of program execution without stopping the program</td></tr><tr><td class="number">34</td><td>user-defined <span class="k3">-</span><span class="k3">-</span> User-defined commands</td></tr><tr><td class="number">35</td><td>&#160;</td></tr><tr><td class="number">36</td><td>Type <span class="s">"help"</span> followed by a <span class="k1">class</span> name <span class="k1">for</span> a list of commands in that class.</td></tr><tr><td class="number">37</td><td>Type <span class="s">"help"</span> followed by command name <span class="k1">for</span> full documentation.</td></tr><tr><td class="number">38</td><td>Command name abbreviations are allowed <span class="k1">if</span> unambiguous.</td></tr><tr><td class="number">39</td><td><span class="k2">(</span>gdb<span class="k2">)</span> help files</td></tr><tr><td class="number">40</td><td>Specifying <span class="k1">and</span> examining files.</td></tr><tr><td class="number">41</td><td>&#160;</td></tr><tr><td class="number">42</td><td>List of commands:</td></tr><tr><td class="number">43</td><td>&#160;</td></tr><tr><td class="number">44</td><td>add-shared-symbol-files <span class="k3">-</span><span class="k3">-</span> Load the symbols from shared objects in the dynamic linker<span class="s">'s link map</span></td></tr><tr><td class="number">45</td><td><span class="s">add-symbol-file -- Usage: add-symbol-file FILE ADDR [-s &lt;SECT&gt; &lt;SECT_ADDR&gt; -s &lt;SECT&gt; &lt;SECT_ADDR&gt;</span></td></tr><tr><td class="number">46</td><td><span class="s">cd -- Set working directory to DIR for debugger and program being debugged</span></td></tr><tr><td class="number">47</td><td><span class="s">core-file -- Use FILE as core dump for examining memory and registers</span></td></tr><tr><td class="number">48</td><td><span class="s">directory -- Add directory DIR to beginning of search path for source files</span></td></tr><tr><td class="number">49</td><td><span class="s">dll-symbols -- Load dll library symbols from FILE</span></td></tr><tr><td class="number">50</td><td><span class="s">exec-file -- Use FILE as program for getting contents of pure memory</span></td></tr><tr><td class="number">51</td><td><span class="s">file -- Use FILE as program to be debugged</span></td></tr><tr><td class="number">52</td><td><span class="s">forward-search -- Search for regular expression (see regex(3)) from last line listed</span></td></tr><tr><td class="number">53</td><td><span class="s">list -- List specified function or line</span></td></tr><tr><td class="number">54</td><td><span class="s">load -- Dynamically load FILE into the running program</span></td></tr><tr><td class="number">55</td><td><span class="s">path -- Add directory DIR(s) to beginning of search path for object files</span></td></tr><tr><td class="number">56</td><td><span class="s">pwd -- Print working directory</span></td></tr><tr><td class="number">57</td><td><span class="s">reverse-search -- Search backward for regular expression (see regex(3)) from last line listed</span></td></tr><tr><td class="number">58</td><td><span class="s">search -- Search for regular expression (see regex(3)) from last line listed</span></td></tr><tr><td class="number">59</td><td><span class="s">---Type &lt;return&gt; to continue, or q &lt;return&gt; to quit---</span></td></tr><tr><td class="number">60</td><td><span class="s">section -- Change the base address of section SECTION of the exec file to ADDR</span></td></tr><tr><td class="number">61</td><td><span class="s">set extension-language -- Set mapping between filename extension and source language</span></td></tr><tr><td class="number">62</td><td><span class="s">set gnutarget -- Set the current BFD target</span></td></tr><tr><td class="number">63</td><td><span class="s">show gnutarget -- Show the current BFD target</span></td></tr><tr><td class="number">64</td><td><span class="s">symbol-file -- Load symbol table from executable file FILE</span></td></tr><tr><td class="number">65</td><td><span class="s"></span></td></tr><tr><td class="number">66</td><td><span class="s">Type "help" followed by command name for full documentation.</span></td></tr><tr><td class="number">67</td><td><span class="s">Command name abbreviations are allowed if unambiguous.</span></td></tr><tr><td class="number">68</td><td><span class="s">(gdb) file</span></td></tr><tr><td class="number">69</td><td><span class="s">No executable file now.</span></td></tr><tr><td class="number">70</td><td><span class="s">Discard symbol table from `C:\CtwoPlus\progcode\allegro/shadedshapes.exe'</span>? <span class="k2">(</span>y <span class="k1">or</span> n<span class="k2">)</span> y</td></tr><tr><td class="number">71</td><td>No symbol file now.</td></tr><tr><td class="number">72</td><td><span class="k2">(</span>gdb<span class="k2">)</span> directory c:\\ctwoplus\\progcode\\allegro</td></tr><tr><td class="number">73</td><td>Source directories searched: c:\\ctwoplus\\progcode\\allegro<span class="k2">;</span>$cdir<span class="k2">;</span>$cwd</td></tr><tr><td class="number">74</td><td><span class="k2">(</span>gdb<span class="k2">)</span> path c:\\ctwoplus\\progcode\\allegro</td></tr><tr><td class="number">75</td><td>Executable <span class="k1">and</span> object file path: c:\\ctwoplus\\progcode\\allegro</td></tr><tr><td class="number">76</td><td><span class="k2">(</span>gdb<span class="k2">)</span> file c:\\ctwoplus\\progcode\\allegro\\shadedshapes.exe</td></tr><tr><td class="number">77</td><td>Reading symbols from c:\ctwoplus\progcode\allegro\shadedshapes.exe...done.</td></tr><tr><td class="number">78</td><td><span class="k2">(</span>gdb<span class="k2">)</span> list</td></tr><tr><td class="number">79</td><td><span class="n">1</span>       <span class="c">// File based streams -*- C++ -*-</span></td></tr><tr><td class="number">80</td><td><span class="n">2</span></td></tr><tr><td class="number">81</td><td><span class="n">3</span>       <span class="c">// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003</span></td></tr><tr><td class="number">82</td><td><span class="n">4</span>       <span class="c">// Free Software Foundation, Inc.</span></td></tr><tr><td class="number">83</td><td><span class="n">5</span>       <span class="c">//</span></td></tr><tr><td class="number">84</td><td><span class="n">6</span>       <span class="c">// This file is part of the GNU ISO C++ Library.  This library is free</span></td></tr><tr><td class="number">85</td><td><span class="n">7</span>       <span class="c">// software; you can redistribute it and/or modify it under the</span></td></tr><tr><td class="number">86</td><td><span class="n">8</span>       <span class="c">// terms of the GNU General Public License as published by the</span></td></tr><tr><td class="number">87</td><td><span class="n">9</span>       <span class="c">// Free Software Foundation; either version 2, or (at your option)</span></td></tr><tr><td class="number">88</td><td><span class="n">10</span>      <span class="c">// any later version.</span></td></tr><tr><td class="number">89</td><td><span class="k2">(</span>gdb<span class="k2">)</span></td></tr></tbody></table></div></div><p>

BAF - I touched up my include files , thanks for the tip.</p><p>Any suggestions?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Thu, 10 May 2007 08:52:25 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Try <tt>break main</tt>. Or <tt>break main.c:102</tt>. Or <tt>help break</tt>...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (CGamesPlay)</author>
		<pubDate>Thu, 10 May 2007 17:17:06 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>CGamesPlay -<br />  I tried<br />(gdb)-&gt;break myfile.cpp:line_number<br />and it worked to set a breakpoint.  Still outputs wrong file when using the list command though.</p><p>At least now I can set breakpoints again.  Thanks.</p><p>Edit 1<br />-Correction , when gdb is stopped at the now sucessfully set breakpoint when I use the list command it lists my source file, but still initially only lists fstream.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Fri, 11 May 2007 08:37:55 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Well, gdb isn&#39;t a source browser. I don&#39;t think there&#39;s any problem <img src="http://www.allegro.cc/forums/smileys/rolleyes.gif" alt="::)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (CGamesPlay)</author>
		<pubDate>Fri, 11 May 2007 15:48:49 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I would like so see the full output of one of these sessions where its giving the wrong info.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Fri, 11 May 2007 15:50:12 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p><a href="http://www.allegro.cc/forums/thread/591321/671120#target">Right here</a> <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (CGamesPlay)</author>
		<pubDate>Fri, 11 May 2007 15:57:46 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Har. So I missed it.</p><p>But yeah, I don&#39;t think thats the right way to be using gdb...</p><div class="source-code snippet"><div class="inner"><pre>cd <span class="k3">/</span>path<span class="k3">/</span>to<span class="k3">/</span>program
gdb .<span class="k3">/</span>program
gdb&gt; run <span class="k3">&lt;</span>arguments&gt;
... <span class="k2">(</span><a href="http://www.delorie.com/djgpp/doc/libc/libc_858.html" target="_blank">wait</a> <span class="k1">for</span> crash<span class="k2">)</span>
gdb&gt; bt
... <span class="k2">(</span>backtrace here<span class="k2">)</span>
</pre></div></div><p>

I&#39;d like to see that, instead of that odd mess that I saw above.</p><p>Or set proper breakpoints, and watches, and then &quot;run&quot;. None of that other stuff should be necessary.</p><p>how can you expect it to give a valid &quot;list&quot; if its not even started running?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Fri, 11 May 2007 16:12:48 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Well, I can see a good argument for having it show the main function as that is the next line about the be executed <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (CGamesPlay)</author>
		<pubDate>Fri, 11 May 2007 16:14:52 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Well, I can see a good argument for having it show the main function as that is the next line about the be executed <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div></div><p>Could be, but the actual first line is in crt0.o, some init code that eventually calls main().
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Fri, 11 May 2007 16:16:02 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Thomas - I included the output from the help commands within gdb in case I had missed something that would help me set the source file that was being read from.<br />My problem was that I couldn&#39;t set proper breakpoints because gdb was picking fstream for the source file.  (Which I can do now with {gdb-&gt;break myfile.cpp:line_number})</p><p>This excerpt should show you better what happens when I use gdb to debug my program. I put in a line with pound signs to highlight what happens.</p><div class="source-code"><div class="toolbar"></div><div class="inner"><table width="100%"><tbody><tr><td class="number">1</td><td>&#160;</td></tr><tr><td class="number">2</td><td>C:\CtwoPlus\progcode\allegro&gt;gdb .\shadedshapes.exe</td></tr><tr><td class="number">3</td><td>GNU gdb <span class="n">5</span>.<span class="n">2</span>.<span class="n">1</span></td></tr><tr><td class="number">4</td><td>Copyright <span class="n">2002</span> Free Software Foundation, Inc.</td></tr><tr><td class="number">5</td><td>GDB is <a href="http://www.delorie.com/djgpp/doc/libc/libc_350.html" target="_blank">free</a> software, covered by the GNU General Public License, <span class="k1">and</span> you are</td></tr><tr><td class="number">6</td><td>welcome to change it <span class="k1">and</span><span class="k3">/</span><span class="k1">or</span> distribute copies of it under certain conditions.</td></tr><tr><td class="number">7</td><td>Type <span class="s">"show copying"</span> to see the conditions.</td></tr><tr><td class="number">8</td><td>There is absolutely no warranty <span class="k1">for</span> GDB.  Type <span class="s">"show warranty"</span> <span class="k1">for</span> details.</td></tr><tr><td class="number">9</td><td>This GDB was configured as <span class="s">"i686-pc-mingw32"</span>...</td></tr><tr><td class="number">10</td><td><span class="k2">(</span>gdb<span class="k2">)</span> list <span class="n">1</span>,<span class="n">30</span></td></tr><tr><td class="number">11</td><td><span class="n">1</span>       <span class="c">// File based streams -*- C++ -*-</span></td></tr><tr><td class="number">12</td><td><span class="n">2</span></td></tr><tr><td class="number">13</td><td><span class="n">3</span>       <span class="c">// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003</span></td></tr><tr><td class="number">14</td><td><span class="n">4</span>       <span class="c">// Free Software Foundation, Inc.</span></td></tr><tr><td class="number">15</td><td><span class="n">5</span>       <span class="c">//</span></td></tr><tr><td class="number">16</td><td><span class="n">6</span>       <span class="c">// This file is part of the GNU ISO C++ Library.  This library is free</span></td></tr><tr><td class="number">17</td><td><span class="n">7</span>       <span class="c">// software; you can redistribute it and/or modify it under the</span></td></tr><tr><td class="number">18</td><td><span class="n">8</span>       <span class="c">// terms of the GNU General Public License as published by the</span></td></tr><tr><td class="number">19</td><td><span class="n">9</span>       <span class="c">// Free Software Foundation; either version 2, or (at your option)</span></td></tr><tr><td class="number">20</td><td><span class="n">10</span>      <span class="c">// any later version.</span></td></tr><tr><td class="number">21</td><td><span class="n">11</span></td></tr><tr><td class="number">22</td><td><span class="n">12</span>      <span class="c">// This library is distributed in the hope that it will be useful,</span></td></tr><tr><td class="number">23</td><td><span class="n">13</span>      <span class="c">// but WITHOUT ANY WARRANTY; without even the implied warranty of</span></td></tr><tr><td class="number">24</td><td><span class="n">14</span>      <span class="c">// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></td></tr><tr><td class="number">25</td><td><span class="n">15</span>      <span class="c">// GNU General Public License for more details.</span></td></tr><tr><td class="number">26</td><td><span class="n">16</span></td></tr><tr><td class="number">27</td><td><span class="n">17</span>      <span class="c">// You should have received a copy of the GNU General Public License along</span></td></tr><tr><td class="number">28</td><td><span class="n">18</span>      <span class="c">// with this library; see the file COPYING.  If not, write to the Free</span></td></tr><tr><td class="number">29</td><td><span class="n">19</span>      <span class="c">// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,</span></td></tr><tr><td class="number">30</td><td><span class="n">20</span>      <span class="c">// USA.</span></td></tr><tr><td class="number">31</td><td><span class="n">21</span></td></tr><tr><td class="number">32</td><td><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span>Type <span class="k3">&lt;</span>return&gt; to <span class="k1">continue</span>, <span class="k1">or</span> q <span class="k3">&lt;</span>return&gt; to quit---</td></tr><tr><td class="number">33</td><td><span class="n">22</span>      <span class="c">// As a special exception, you may use this file as part of a free software</span></td></tr><tr><td class="number">34</td><td><span class="n">23</span>      <span class="c">// library without restriction.  Specifically, if other files instantiate</span></td></tr><tr><td class="number">35</td><td><span class="n">24</span>      <span class="c">// templates or use macros or inline functions from this file, or you compile</span></td></tr><tr><td class="number">36</td><td><span class="n">25</span>      <span class="c">// this file and link it with other files to produce an executable, this</span></td></tr><tr><td class="number">37</td><td><span class="n">26</span>      <span class="c">// file does not by itself cause the resulting executable to be covered by</span></td></tr><tr><td class="number">38</td><td><span class="n">27</span>      <span class="c">// the GNU General Public License.  This exception does not however</span></td></tr><tr><td class="number">39</td><td><span class="n">28</span>      <span class="c">// invalidate any other reasons why the executable file might be covered by</span></td></tr><tr><td class="number">40</td><td><span class="n">29</span>      <span class="c">// the GNU General Public License.</span></td></tr><tr><td class="number">41</td><td><span class="n">30</span></td></tr><tr><td class="number">42</td><td><span class="k2">(</span>gdb<span class="k2">)</span></td></tr><tr><td class="number">43</td><td><span class="c">// ############ Look here ######################################################</span></td></tr><tr><td class="number">44</td><td><span class="k2">(</span>gdb<span class="k2">)</span> <span class="k1">break</span> <span class="n">1</span></td></tr><tr><td class="number">45</td><td>No <a href="http://www.allegro.cc/manual/line" target="_blank"><span class="a">line</span></a> <span class="n">1</span> in file <span class="s">"C:/MinGW/include/c++/3.2.3/bits/fstream.tcc"</span>.</td></tr><tr><td class="number">46</td><td><span class="k2">(</span>gdb<span class="k2">)</span> <span class="k1">break</span> shadedshapes.cpp:266</td></tr><tr><td class="number">47</td><td>Breakpoint <span class="n">1</span> at <span class="n">0x401978</span><span class="k2">:</span> file C:<span class="k3">/</span>CtwoPlus<span class="k3">/</span>progcode<span class="k3">/</span>allegro<span class="k3">/</span>ShadedShapes.cpp, <a href="http://www.allegro.cc/manual/line" target="_blank"><span class="a">line</span></a> <span class="n">266</span>.</td></tr><tr><td class="number">48</td><td><span class="k2">(</span>gdb<span class="k2">)</span> run</td></tr><tr><td class="number">49</td><td>Starting program: C:\CtwoPlus\progcode\allegro<span class="k3">/</span>.\shadedshapes.exe</td></tr><tr><td class="number">50</td><td>&#160;</td></tr><tr><td class="number">51</td><td>Breakpoint <span class="n">1</span>, _mangled_main<span class="k2">(</span><span class="k2">)</span> <span class="k2">(</span><span class="k2">)</span></td></tr><tr><td class="number">52</td><td>    at C:<span class="k3">/</span>CtwoPlus<span class="k3">/</span>progcode<span class="k3">/</span>allegro<span class="k3">/</span>ShadedShapes.cpp:266</td></tr><tr><td class="number">53</td><td>warning: Source file is more recent than executable.</td></tr><tr><td class="number">54</td><td>&#160;</td></tr><tr><td class="number">55</td><td><span class="n">266</span>     <span class="k1">int</span> main<span class="k2">(</span><span class="k2">)</span> <span class="k2">{</span></td></tr><tr><td class="number">56</td><td>Current language:  <span class="k1">auto</span><span class="k2">;</span> currently c<span class="k3">+</span><span class="k3">+</span></td></tr><tr><td class="number">57</td><td><span class="k2">(</span>gdb<span class="k2">)</span> list</td></tr><tr><td class="number">58</td><td><span class="n">261</span>     <span class="k2">}</span><span class="k2">;</span></td></tr><tr><td class="number">59</td><td><span class="n">262</span></td></tr><tr><td class="number">60</td><td><span class="n">263</span></td></tr><tr><td class="number">61</td><td><span class="n">264</span></td></tr><tr><td class="number">62</td><td><span class="n">265</span></td></tr><tr><td class="number">63</td><td><span class="n">266</span>     <span class="k1">int</span> main<span class="k2">(</span><span class="k2">)</span> <span class="k2">{</span></td></tr><tr><td class="number">64</td><td><span class="n">267</span></td></tr><tr><td class="number">65</td><td><span class="n">268</span>     <span class="k1">int</span> x <span class="k3">=</span> <span class="n">0</span><span class="k2">;</span></td></tr><tr><td class="number">66</td><td><span class="n">269</span>     <span class="k1">char</span> outputstring<span class="k2">[</span><span class="n">200</span><span class="k2">]</span><span class="k2">;</span></td></tr><tr><td class="number">67</td><td><span class="n">270</span>     <span class="k1">char</span> outputstring2<span class="k2">[</span><span class="n">200</span><span class="k2">]</span><span class="k2">;</span></td></tr><tr><td class="number">68</td><td><span class="k2">(</span>gdb<span class="k2">)</span> quit</td></tr><tr><td class="number">69</td><td>The program is running.  Exit anyway? <span class="k2">(</span>y <span class="k1">or</span> n<span class="k2">)</span> y</td></tr><tr><td class="number">70</td><td>&#160;</td></tr><tr><td class="number">71</td><td>C:\CtwoPlus\progcode\allegro&gt;</td></tr></tbody></table></div></div><p>

P.S. The progam has never had to be running for me to use list to view source code.  <br />The problem is that it picks the wrong file.</p><p>Edit 1 - If gdb is listing the wrong file , that&#39;s where the breakpoints get set (in the wrong file).  CGamesPlay gave me a workaround by using <br />gdb-&gt;break myfile.cpp:line_number<br />Then when my program reaches that breakpoint , it starts listing source from my file properly again.  This is what I want to understand.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Sat, 12 May 2007 04:50:22 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>What?  That looks fine to me. You do understand how #include works, right?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (BAF)</author>
		<pubDate>Sat, 12 May 2007 08:08:15 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>BAF - Not really , no.  At least not in the way the compiler puts everything together.</p><p>And I&#39;ve used plenty of #includes before and until recently they&#39;ve never made gdb read in the wrong source file. </p><p>Like I said , it started happening as soon as I added my settings class (basically just data storage and retrieval and an &lt;&lt; operator function so I can put it into a text file nicely.  That&#39;s when gdb started selecting some allegro inline file as my main source file.  Then I added #include&lt;fstream&gt; and #include&lt;iostream&gt; and that&#39;s when gdb started picking fstream.tcc as my source file.</p><p>Look at my last post - in the transcript window at these three lines
</p><div class="quote_container"><div class="title">Edgar Reynaldo said:</div><div class="quote"><p>

// ############ Look here ######################################################<br />(gdb) break 1<br />No line 1 in file &quot;C:/MinGW/include/c++/3.2.3/bits/fstream.tcc&quot;.
</p></div></div><p>

Until CGamesPlay showed me how to set a breakpoint by using the file name<br />I couldn&#39;t set any breakpoints to debug my program.<br />I&#39;ve never had to explicitly mention my program by name or path when setting breakpoints until recently when gdb started playing roulette with source files.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Sat, 12 May 2007 10:06:54 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>.tcc? Isn&#39;t that a precompiled header? Maybe that has something to do with the oddities?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Sat, 12 May 2007 11:35:26 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I haven&#39;t the slightest clue , so I&#39;m going to try updating gdb (6.6 is out now)<br />and look over the online manual.<br /><a href="http://www.gnu.org/software/gdb/">GDB: The GNU Project Debugger</a><br /><a href="http://www.gnu.org/software/gdb/documentation/">GDB Documentation</a>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Sat, 12 May 2007 13:03:54 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>If .tcc is a precompiled header I think its safe to just delete it.  Try renaming / deleting it and see if that fixes it.</p><p>Is there a settings.tcc as well?</p><p>On second thought, I think .pch is the precompiled header extension... hm...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (ImLeftFooted)</author>
		<pubDate>Sat, 12 May 2007 13:18:46 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>fstream.tcc is a bunch of templates which I don&#39;t understand yet anyway.  <br />But I won&#39;t be deleting anything.  Don&#39;t want to reinstall Mingw.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Sat, 12 May 2007 13:35:45 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
But I won&#39;t be deleting anything. Don&#39;t want to reinstall Mingw.
</p></div></div><p>
The trick is to rename it which is effectively the same yet can be easily undone.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (ImLeftFooted)</author>
		<pubDate>Sat, 12 May 2007 13:45:50 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I knew this would cause trouble but I didn&#39;t know how.  Did it for fun anyway.<br />renamed fstream.tcc to fstream.tcc.bak<br />and the compiler replied :<br />C:/MinGW/include/c++/3.2.3/fstream:576:29: bits/fstream.tcc: No such file or directory</p><p>fstream contains these lines
</p><div class="source-code snippet"><div class="inner"><pre><span class="p">#ifdef _GLIBCPP_NO_TEMPLATE_EXPORT</span>
<span class="p"># define export</span>
<span class="p">#endif</span>
<span class="p">#ifdef  _GLIBCPP_FULLY_COMPLIANT_HEADERS</span>
<span class="p"># include &lt;bits/fstream.tcc&gt;</span>
<span class="p">#endif</span>

<span class="p">#endif</span>
</pre></div></div><p>

And as such the program would never compile without it.<br />Well , I had my fun.</p><p>Dustin - no , there&#39;s no settings.tcc in my compiler directory.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Sat, 12 May 2007 14:30:04 +0000</pubDate>
	</item>
</rss>
