<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Exceptions &#x2F;&#x2F; Call Trace]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich habe folgendes problem :<br />
es geht um exceptions und um das &quot;Weiterwerfen&quot; der selbigen</p>
<p>Ich schreibe gerade eine Speicherroutine für eine Datenstruktur<br />
aus meinem Programm, diese Struktur besteht wieder aus Strukturen.</p>
<p>Nun wollte ich das Speichern natürlich kapseln, und habe somit<br />
für jeder &quot;Unterklassen&quot; die operatoren &lt;&lt; und &gt;&gt; überschrieben,<br />
realisiert habe ich das über die methoden :</p>
<pre><code class="language-cpp">void printAt(std::ostream&amp; stream=std::cout);
</code></pre>
<p>und</p>
<pre><code class="language-cpp">void fromInstream(std::istream&amp; stream) // throws ParseErrorException
</code></pre>
<p>wenn nun beim parsen ein Fehler auftritt werfe ich oben genannte<br />
ParseErrorException, mit den Unterklassen sieht das dann so aus</p>
<pre><code class="language-cpp">void ObersteStruktur::fromInStream(stream)
{
try
{
 m_unterstruktur.fromInStream(stream);
}
catch(ParseErrorException&amp; e)
{
 throw e;
}
}
</code></pre>
<p>lässt sich so ein Call-Trace aufstellen? Um dann herrauszufinden,<br />
Bei wem und Wo das parsen fehlschlug?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/211522/exceptions-call-trace</link><generator>RSS for Node</generator><lastBuildDate>Wed, 14 Oct 2026 06:26:08 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/211522.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 24 Apr 2008 08:45:09 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Exceptions &#x2F;&#x2F; Call Trace on Thu, 24 Apr 2008 08:45:09 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich habe folgendes problem :<br />
es geht um exceptions und um das &quot;Weiterwerfen&quot; der selbigen</p>
<p>Ich schreibe gerade eine Speicherroutine für eine Datenstruktur<br />
aus meinem Programm, diese Struktur besteht wieder aus Strukturen.</p>
<p>Nun wollte ich das Speichern natürlich kapseln, und habe somit<br />
für jeder &quot;Unterklassen&quot; die operatoren &lt;&lt; und &gt;&gt; überschrieben,<br />
realisiert habe ich das über die methoden :</p>
<pre><code class="language-cpp">void printAt(std::ostream&amp; stream=std::cout);
</code></pre>
<p>und</p>
<pre><code class="language-cpp">void fromInstream(std::istream&amp; stream) // throws ParseErrorException
</code></pre>
<p>wenn nun beim parsen ein Fehler auftritt werfe ich oben genannte<br />
ParseErrorException, mit den Unterklassen sieht das dann so aus</p>
<pre><code class="language-cpp">void ObersteStruktur::fromInStream(stream)
{
try
{
 m_unterstruktur.fromInStream(stream);
}
catch(ParseErrorException&amp; e)
{
 throw e;
}
}
</code></pre>
<p>lässt sich so ein Call-Trace aufstellen? Um dann herrauszufinden,<br />
Bei wem und Wo das parsen fehlschlug?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1497283</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1497283</guid><dc:creator><![CDATA[Treb]]></dc:creator><pubDate>Thu, 24 Apr 2008 08:45:09 GMT</pubDate></item><item><title><![CDATA[Reply to Exceptions &#x2F;&#x2F; Call Trace on Thu, 24 Apr 2008 09:18:03 GMT]]></title><description><![CDATA[<p>Das kannst du schon so machen. Wenn du aber, wie in deinem Beispiel, im catch-Zweig nichts weiter machst, brauchst du die Exception dort eigentlich auch nicht zu fangen. Das macht nur Sinn wenn du da irgendwelche Aufräumaktionen starten oder weitere Informationen der Exception zufügen willst.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1497302</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1497302</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Thu, 24 Apr 2008 09:18:03 GMT</pubDate></item><item><title><![CDATA[Reply to Exceptions &#x2F;&#x2F; Call Trace on Thu, 24 Apr 2008 09:25:46 GMT]]></title><description><![CDATA[<p>sollte es nicht beim weiterwerfen so aussehen?</p>
<pre><code class="language-cpp">catch(exception &amp;e)
{
    throw;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1497305</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1497305</guid><dc:creator><![CDATA[i_like_it]]></dc:creator><pubDate>Thu, 24 Apr 2008 09:25:46 GMT</pubDate></item><item><title><![CDATA[Reply to Exceptions &#x2F;&#x2F; Call Trace on Thu, 24 Apr 2008 09:30:14 GMT]]></title><description><![CDATA[<p>Braunstein schrieb:</p>
<blockquote>
<p>Das kannst du schon so machen. Wenn du aber, wie in deinem Beispiel, im catch-Zweig nichts weiter machst, brauchst du die Exception dort eigentlich auch nicht zu fangen. Das macht nur Sinn wenn du da irgendwelche Aufräumaktionen starten oder weitere Informationen der Exception zufügen willst.</p>
</blockquote>
<p>naja das catchen würde dann wohl so aussehen</p>
<pre><code class="language-cpp">catch(ParseErrorException&amp; e)
{
 e.addCaller(this);
 throw;
}
</code></pre>
<p>wobei &quot;this&quot; natürlich exemplarisch zu sehen ist. Mal sehen welche Info ich da<br />
reinpacke.<br />
Auf jeden Fall werde ich das auf diese Art mal probieren.<br />
Mal sehen wie &quot;anwendbar&quot; und &quot;praktisch&quot; so ein vorgehen ist...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1497307</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1497307</guid><dc:creator><![CDATA[Treb]]></dc:creator><pubDate>Thu, 24 Apr 2008 09:30:14 GMT</pubDate></item><item><title><![CDATA[Reply to Exceptions &#x2F;&#x2F; Call Trace on Thu, 24 Apr 2008 09:39:55 GMT]]></title><description><![CDATA[<p>Je nach Betriebssystem stehen dir andere Mittel zur Verfügung, um den Calltrace zum Zeitpunkt des Werfens einer Exception herauszufinden.</p>
<p>Die glibc kennt zum Beispiel die folgende Funktion:</p>
<pre><code class="language-cpp">int backtrace (void **buffer, int size)
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1497313</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1497313</guid><dc:creator><![CDATA[Ponto]]></dc:creator><pubDate>Thu, 24 Apr 2008 09:39:55 GMT</pubDate></item></channel></rss>