<?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>gdb &#8211; Virtually Fun</title>
	<atom:link href="https://virtuallyfun.com/tag/gdb/feed/" rel="self" type="application/rss+xml" />
	<link>https://virtuallyfun.com</link>
	<description>Fun with Virtualization</description>
	<lastBuildDate>Sun, 04 Oct 2015 09:11:12 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0</generator>
	<item>
		<title>32bit / 64bit GDB collision</title>
		<link>https://virtuallyfun.com/2015/10/04/32bit-64bit-gdb-collision/</link>
					<comments>https://virtuallyfun.com/2015/10/04/32bit-64bit-gdb-collision/#comments</comments>
		
		<dc:creator><![CDATA[neozeed]]></dc:creator>
		<pubDate>Sun, 04 Oct 2015 09:07:41 +0000</pubDate>
				<category><![CDATA[mingw]]></category>
		<category><![CDATA[gdb]]></category>
		<guid isPermaLink="false">https://virtuallyfun.com/?p=5563</guid>

					<description><![CDATA[So I&#8217;m trying to force a break in a program to look at the call stack. Â Normally pretty easy stuff as far as adding breakpoints or the random i=j/0 type thing to force a div0 exception etc. But I&#8217;ve been &#8230; <a href="https://virtuallyfun.com/2015/10/04/32bit-64bit-gdb-collision/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>So I&#8217;m trying to force a break in a program to look at the call stack. Â Normally pretty easy stuff as far as adding breakpoints or the random i=j/0 type thing to force a div0 exception etc.</p>
<p>But I&#8217;ve been going crazy with this fun error:</p>
<p style="padding-left: 30px;">gdb: unknown target exception 0x4000001f at 0x453b1c</p>
<p>And I should have checked my path earlier, as even though I&#8217;m using the 32bit version of GCC, the <a href="http://tdm-gcc.tdragon.net/download">TDM-GCC</a> project bundles their 32bit GDB as gdb32.exe . Â Ouch. Â The other hint of course was in the banner:</p>
<p style="padding-left: 30px;">GNU gdb (GDB) 7.9.1<br />
Copyright (C) 2015 Free Software Foundation, Inc.<br />
License GPLv3+: GNU GPL version 3 or later &lt;http://gnu.org/licenses/gpl.html&gt;<br />
This is free software: you are free to change and redistribute it.<br />
There is NO WARRANTY, to the extent permitted by law. Type &#8220;show copying&#8221;<br />
and &#8220;show warranty&#8221; for details.<br />
This GDB was configured as &#8220;x86_64-w64-mingw32&#8221;.</p>
<p>Yeah, further oops, in actually paying attention to how it executes:</p>
<p style="padding-left: 30px;">(gdb) r<br />
Starting program: C:\temp\dynamips\dynamips.exe -P 1700 -s 0:0:gen_eth:&#8221;\Device\NPF_{2F7A0E3F-0908-4489-8117-475A6AD299A6}&#8221; C1700-Y-.BIN -j<br />
[New Thread 2696.0x22b0]<br />
warning: `C:\WINDOWS\SYSTEM32\ntdll.dll&#8217;: Shared library architecture i386:x86-64 is not compatible with target architecture i386.<br />
warning: `C:\WINDOWS\system32\wow64.dll&#8217;: Shared library architecture i386:x86-64 is not compatible with target architecture i386.<br />
warning: `C:\WINDOWS\system32\wow64win.dll&#8217;: Shared library architecture i386:x86-64 is not compatible with target architecture i386.<br />
warning: Could not load shared library symbols for WOW64_IMAGE_SECTION.<br />
Do you need &#8220;set solib-search-path&#8221; or &#8220;set sysroot&#8221;?<br />
warning: Could not load shared library symbols for WOW64_IMAGE_SECTION.<br />
Do you need &#8220;set solib-search-path&#8221; or &#8220;set sysroot&#8221;?<br />
warning: Could not load shared library symbols for NOT_AN_IMAGE.<br />
Do you need &#8220;set solib-search-path&#8221; or &#8220;set sysroot&#8221;?<br />
warning: Could not load shared library symbols for NOT_AN_IMAGE.<br />
Do you need &#8220;set solib-search-path&#8221; or &#8220;set sysroot&#8221;?<br />
warning: `C:\WINDOWS\system32\wow64cpu.dll&#8217;: Shared library architecture i386:x86-64 is not compatible with target architecture i386.<br />
[New Thread 2696.0xabc]</p>
<p>Great.</p>
<p>So it&#8217;s not some exciting bug, but rather the 64bit version of gdb can kick off a 32bit exe, but it&#8217;ll get lost inside. Â The proper 32bit GDB looks like this:</p>
<p style="padding-left: 30px;">C:\temp\dynamips&gt;gdb32.exe dynamips.exe<br />
GNU gdb (GDB) 7.9.1<br />
Copyright (C) 2015 Free Software Foundation, Inc.<br />
License GPLv3+: GNU GPL version 3 or later &lt;http://gnu.org/licenses/gpl.html&gt;<br />
This is free software: you are free to change and redistribute it.<br />
There is NO WARRANTY, to the extent permitted by law. Type &#8220;show copying&#8221;<br />
and &#8220;show warranty&#8221; for details.<br />
This GDB was configured as &#8220;mingw32&#8221;.</p>
<p>And sure enough the call stack works fine.</p>
<p style="padding-left: 30px;">Breakpoint 1, 0x00453b1c in mpc860_fec_set_nio ()<br />
(gdb) bt<br />
#0 0x00453b1c in mpc860_fec_set_nio ()<br />
#1 0x004827e2 in dev_c1700_mb_eth_set_nio ()<br />
#2 0x0044abdf in cisco_card_enable_all_nio ()<br />
#3 0x0044b9df in vm_slot_enable_all_nio ()<br />
#4 0x0044bb0e in vm_slot_init ()<br />
#5 0x0044bb36 in vm_slot_init_all ()<br />
#6 0x00481b5d in c1700_init_platform ()<br />
#7 0x00481dc3 in c1700_init_instance ()<br />
#8 0x004155b3 in vm_init_instance ()<br />
#9 0x004125dc in main ()<br />
(gdb)</p>
<p>Wasn&#8217;t that fun?!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://virtuallyfun.com/2015/10/04/32bit-64bit-gdb-collision/feed/</wfw:commentRss>
			<slash:comments>8</slash:comments>
		
		
			</item>
	</channel>
</rss>
