<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Hacking so Existing &#187; Debug</title>
	<atom:link href="http://dev.zhourenjian.com/blog/category/debug/feed" rel="self" type="application/rss+xml" />
	<link>http://dev.zhourenjian.com/blog</link>
	<description>Zhou Renjian&#039;s Development Blog</description>
	<lastBuildDate>Fri, 23 Apr 2010 01:54:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Compiling GDB Debugger in Windows</title>
		<link>http://dev.zhourenjian.com/blog/2009/03/11/compiling-gdb-debugger-in-windows.html</link>
		<comments>http://dev.zhourenjian.com/blog/2009/03/11/compiling-gdb-debugger-in-windows.html#comments</comments>
		<pubDate>Wed, 11 Mar 2009 03:29:17 +0000</pubDate>
		<dc:creator>Zhou Renjian</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Debug]]></category>
		<category><![CDATA[debugger]]></category>
		<category><![CDATA[gdb]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://dev.zhourenjian.com/blog/?p=57</guid>
		<description><![CDATA[Here are the steps: Download 7-zip, if you do not have one. Install MinGW, please read MinGW&#8217;s Getting Started wiki. I choose manual installation: Download at least the following (or newer) packages from the MinGW download page: binutils gcc-core mingw-runtime &#8230; <a href="http://dev.zhourenjian.com/blog/2009/03/11/compiling-gdb-debugger-in-windows.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Here are the steps:</p>
<ol>
<li>Download <a href="http://www.7-zip.org/">7-zip</a>, if you do not have one.</li>
<li>Install MinGW, please read <a href="http://www.mingw.org/wiki/Getting_Started">MinGW&#8217;s Getting Started</a> wiki. I choose manual installation:
<p>Download at least the following (or newer) packages from the MinGW download page:</p>
<ul>
<li>binutils</li>
<li>gcc-core</li>
<li>mingw-runtime</li>
<li>w32api</li>
<li>expat</li>
</ul>
<p>Unpack them directly to D:\mingw</p>
<blockquote><dl compact="compact">
<dt>Expat</dt>
<dd>
GDB can use the Expat XML parsing library.  This library may be included with your operating system distribution; if it is not, you can get the latest version from <a href="http://expat.sourceforge.net">http://expat.sourceforge.net</a>.<br />
The <tt>`configure'</tt> script will search for this library in several standard locations; if it is installed in an unusual path, you can use the <samp>`&#8211;with-libexpat-prefix&#8217;</samp> option to specify its location.</p>
<p>Expat is used for:</p>
<ul>
<li>
Remote protocol memory maps (see section <a href="http://sources.redhat.com/gdb/onlinedocs/gdb_33.html#SEC737">D.12 Memory Map Format</a>)
</li>
<li>
Target descriptions (see section <a href="http://sources.redhat.com/gdb/onlinedocs/gdb_35.html#SEC745">F. Target Descriptions</a>)
</li>
<li>
Remote shared library lists (see section <a href="http://sources.redhat.com/gdb/onlinedocs/gdb_33.html#SEC736">D.11 Library List Format</a>)
</li>
<li>
MS-Windows shared libraries (see  <a href="http://sources.redhat.com/gdb/onlinedocs/gdb_16.html#Shared%20Libraries">Shared Libraries</a>)
</li>
</ul>
</dd>
</dl>
</blockquote>
<p>To download expat for MinGW, please visit <a href="http://sourceforge.net/project/showfiles.php?group_id=204414&#038;package_id=263032&#038;release_id=648913">here</a>.</p>
<p>For more about expat, please visit <a href="http://sources.redhat.com/gdb/onlinedocs/gdb_31.html">http://sources.redhat.com/gdb/onlinedocs/gdb_31.html</a>.
</li>
<li>Install <a href="http://www.mingw.org/wiki/MSYS">MinGW&#8217;s MSYS</a>:
<ul>
<li>Install MSYS DTK 1.0 in D:\mingw\1.0</li>
<li>Install MSYS Core 1.0.11. It is an archive. Unpack it in D:\mingw\1.0</li>
</ul>
</li>
<li>Setting PATH and HOME environment, and run D:\mingw\1.0\msys.bat</li>
<li>Download <a href="http://sourceware.org/gdb/download/">GDB debugger sources</a>. I use the latest repository <a href="ftp://sourceware.org/pub/gdb/snapshots/current/">snapshot</a>. And upack them to D:\mingw\1.0\home</li>
<li>./configure &#038; make</li>
</ol>
<p>You should have gdb.exe in D:\mingw\1.0\home\gdb-#.#.#\gdb\ in about 30 minutes.</p>
<p>To port GDB debugger to a new architecture, you should not miss the detailed guide &#8221; <a href="http://www.embecosm.com/download/ean3.html">Howto: Porting the GNU Debugger &#8212; Practical Experience with the OpenRISC 1000 Architecture</a> &#8220;.</p>
<p>Update:</p>
<p>To compile GDB Insight 6.8 under MSYS environment, you should make a <a href="http://sourceware.org/ml/gdb-patches/2008-04/msg00214.html">patch</a> :</p>
<p>Index: gdb/ChangeLog<br />
===================================================================<br />
RCS file: /cvs/src/src/gdb/ChangeLog,v<br />
retrieving revision 1.9174.2.20<br />
diff -u -r1.9174.2.20 ChangeLog<br />
&#8212; ChangeLog   31 Mar 2008 03:40:42 -0000   1.9174.2.20<br />
+++ ChangeLog   11 Apr 2008 09:10:13 -0000<br />
@@ -1,3 +1,8 @@<br />
+2008-04-11  Hans Kester  <kester.hans@gmail.com><br />
+<br />
+   * configure.ac: Added configdir for MinGW.<br />
+   * configure:    Added configdir for MinGW.<br />
+<br />
 2008-03-30  Daniel Jacobowitz  <dan@codesourcery.com></p>
<p>    * ia64-tdep.c (examine_prologue): Correct array access.</p>
<p>Index: gdb/configure.ac<br />
===================================================================<br />
RCS file: /cvs/src/src/gdb/configure.ac,v<br />
retrieving revision 1.64<br />
diff -u -r1.64 configure.ac<br />
&#8212; configure.ac   13 Jan 2008 12:23:05 -0000   1.64<br />
+++ configure.ac   11 Apr 2008 09:02:13 -0000<br />
@@ -1445,7 +1445,7 @@<br />
 AC_SUBST(WIN32LDAPP)</p>
<p> case &#8220;${host}&#8221; in<br />
-*-*-cygwin*)<br />
+*-*-cygwin* | *-*-mingw*)<br />
     configdir=&#8221;win&#8221;<br />
     ;;<br />
 *)</p>
<p>Index: gdb/configure<br />
===================================================================<br />
RCS file: /cvs/src/src/gdb/configure,v<br />
retrieving revision 1.242<br />
diff -u -r1.242 configure<br />
&#8212; configure   13 Jan 2008 12:23:04 -0000   1.242<br />
+++ configure   11 Apr 2008 09:05:54 -0000<br />
@@ -23080,7 +23080,7 @@</p>
<p> case &#8220;${host}&#8221; in<br />
-*-*-cygwin*)<br />
+*-*-cygwin* | *-*-mingw*)<br />
     configdir=&#8221;win&#8221;<br />
     ;;<br />
 *)</p>
]]></content:encoded>
			<wfw:commentRss>http://dev.zhourenjian.com/blog/2009/03/11/compiling-gdb-debugger-in-windows.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Debug into rt.jar</title>
		<link>http://dev.zhourenjian.com/blog/2007/08/04/debug-into-rtjar.html</link>
		<comments>http://dev.zhourenjian.com/blog/2007/08/04/debug-into-rtjar.html#comments</comments>
		<pubDate>Sat, 04 Aug 2007 09:15:24 +0000</pubDate>
		<dc:creator>Zhou Renjian</dc:creator>
				<category><![CDATA[Debug]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://dev.zhourenjian.com/blog/2007/08/04/debug-into-rtjar.html</guid>
		<description><![CDATA[If you ever use Eclipse trying to debug into Java&#8217;s system APIs, such as java.lang.String or java.math.BigInteger, you may find that even you can step over or step in, or have the correct source file open and the correct line &#8230; <a href="http://dev.zhourenjian.com/blog/2007/08/04/debug-into-rtjar.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you ever use Eclipse trying to debug into Java&#8217;s system APIs, such as java.lang.String or java.math.BigInteger, you may find that even you can step over or step in, or have the correct source file open and the correct line of codes highlighted, you still could not see the local variables&#8217; value and method&#8217;s parameters are shown in pattern of &#8220;arg0&#8243;, &#8220;arg1&#8243; and so on.</p>
<p>Yes, you are already using JDK instead of JRE. But you still have the above problem. What&#8217;s wrong? It&#8217;s not a bug of Eclipse. It is all about the rt.jar along with the JDK (1.5 or 1.6). In Sun&#8217;s official JDK release, debug symbols are already packed into the rt.jar. But local variables&#8217; debug information is not packed. Sun may consider that it is not OK to includes those local variables&#8217; debugging information. That is the source of problem.</p>
<p>To solve this problem, you may need to upgrade to JDK 1.6. Download DEBUG jar file from<br />
<a href="http://download.java.net/jdk6/binaries/">http://download.java.net/jdk6/binaries/</a><br />
Double click it to install a new JDK. And configure your Eclipse to use the new JDK.</p>
<p>For JDK 1.5, recompiling rt.jar by yourself, or other information, please visit<br />
<a href="http://forums.java.net/jive/thread.jspa?threadID=399&#038;tstart=0">http://forums.java.net/jive/thread.jspa?threadID=399&#038;tstart=0</a><br />
for a detailed discussion.</p>
]]></content:encoded>
			<wfw:commentRss>http://dev.zhourenjian.com/blog/2007/08/04/debug-into-rtjar.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
