<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Apple&#8217;s GDB Bug ?</title>
	<atom:link href="http://reverse.put.as/2008/11/28/apples-gdb-bug/feed/" rel="self" type="application/rss+xml" />
	<link>http://reverse.put.as/2008/11/28/apples-gdb-bug/</link>
	<description>Reverse Engineering for fun and pleasure!</description>
	<lastBuildDate>Sat, 04 Feb 2012 02:28:35 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Singh</title>
		<link>http://reverse.put.as/2008/11/28/apples-gdb-bug/comment-page-1/#comment-6755</link>
		<dc:creator>Singh</dc:creator>
		<pubDate>Sun, 13 Jun 2010 08:24:05 +0000</pubDate>
		<guid isPermaLink="false">http://reverse.put.as/?p=119#comment-6755</guid>
		<description>This is quite annoying. Here is an expect script to allow you to type &quot;gdb file&quot; and allow global variables to work:

$ cat gdbx 
#!/usr/bin/expect
spawn gdb
expect &quot;(gdb) &quot;
send &quot;exec-file [lindex $argv 0]\n&quot;
interact


$ ./gdbx /bin/ls
spawn gdb
GNU gdb 6.3.50-20050815 (Apple version gdb-962) (Sat Jul 26 08:14:40 UTC 2008)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type &quot;show copying&quot; to see the conditions.
There is absolutely no warranty for GDB.  Type &quot;show warranty&quot; for details.
This GDB was configured as &quot;i386-apple-darwin&quot;.
(gdb) exec-file /bin/ls
Reading symbols for shared libraries .... done
(gdb) b *0x000023f0                
Breakpoint 1 at 0x23f0
(gdb) r
Starting program: /bin/ls 
Reading symbols for shared libraries ..... done

Breakpoint 1, 0x000023f0 in ?? ()
$1 = &quot;test&quot;
$2 = 10
$3 = 20
(gdb)</description>
		<content:encoded><![CDATA[<p>This is quite annoying. Here is an expect script to allow you to type &#8220;gdb file&#8221; and allow global variables to work:</p>
<p>$ cat gdbx<br />
#!/usr/bin/expect<br />
spawn gdb<br />
expect &#8220;(gdb) &#8221;<br />
send &#8220;exec-file [lindex $argv 0]\n&#8221;<br />
interact</p>
<p>$ ./gdbx /bin/ls<br />
spawn gdb<br />
GNU gdb 6.3.50-20050815 (Apple version gdb-962) (Sat Jul 26 08:14:40 UTC 2008)<br />
Copyright 2004 Free Software Foundation, Inc.<br />
GDB is free software, covered by the GNU General Public License, and you are<br />
welcome to change it and/or distribute copies of it under certain conditions.<br />
Type &#8220;show copying&#8221; to see the conditions.<br />
There is absolutely no warranty for GDB.  Type &#8220;show warranty&#8221; for details.<br />
This GDB was configured as &#8220;i386-apple-darwin&#8221;.<br />
(gdb) exec-file /bin/ls<br />
Reading symbols for shared libraries &#8230;. done<br />
(gdb) b *0x000023f0<br />
Breakpoint 1 at 0x23f0<br />
(gdb) r<br />
Starting program: /bin/ls<br />
Reading symbols for shared libraries &#8230;.. done</p>
<p>Breakpoint 1, 0x000023f0 in ?? ()<br />
$1 = &#8220;test&#8221;<br />
$2 = 10<br />
$3 = 20<br />
(gdb)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: fG!</title>
		<link>http://reverse.put.as/2008/11/28/apples-gdb-bug/comment-page-1/#comment-1800</link>
		<dc:creator>fG!</dc:creator>
		<pubDate>Fri, 10 Apr 2009 00:06:10 +0000</pubDate>
		<guid isPermaLink="false">http://reverse.put.as/?p=119#comment-1800</guid>
		<description>Sorry for my delay... Problem must be with gdb.
Check the following:

$ gdb /bin/ls
GNU gdb 6.3.50-20050815 (Apple version gdb-768) (Sun Mar 22 01:47:54 UTC 2009)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type &quot;show copying&quot; to see the conditions.
There is absolutely no warranty for GDB.  Type &quot;show warranty&quot; for details.
This GDB was configured as &quot;i386-apple-darwin&quot;...Reading symbols for shared libraries .... done

(gdb) b *0x000023f0
Breakpoint 1 at 0x23f0
(gdb) r
Starting program: /bin/ls 
Reading symbols for shared libraries +++. done

Breakpoint 1, 0x000023f0 in ?? ()
$1 = &quot;test&quot;
$2 = 10
$3 = void
(gdb) q
The program is running.  Exit anyway? (y or n) y

$ gdb
GNU gdb 6.3.50-20050815 (Apple version gdb-768) (Sun Mar 22 01:47:54 UTC 2009)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type &quot;show copying&quot; to see the conditions.
There is absolutely no warranty for GDB.  Type &quot;show warranty&quot; for details.
This GDB was configured as &quot;i386-apple-darwin&quot;.
(gdb) exec-file /bin/ls
Reading symbols for shared libraries .... done
(gdb) b *0x000023f0
Breakpoint 1 at 0x23f0
(gdb) r
Starting program: /bin/ls 
Reading symbols for shared libraries .+++. done

Breakpoint 1, 0x000023f0 in ?? ()
$1 = &quot;test&quot;
$2 = 10
$3 = 20
(gdb) 

This is the .gdbinit I used to test:
$ cat .gdbinit
set $globalvariable = 20
define bugtest
set $bugtest = 10
print $bugtest
end

define hook-stop 
print &quot;test&quot;
bugtest
print $globalvariable
end

As you can see it doesn&#039;t support global variables if you use a gdb /bin/ls from the command line, only if you load gdb without parameters and then point to the target using exec-file.</description>
		<content:encoded><![CDATA[<p>Sorry for my delay&#8230; Problem must be with gdb.<br />
Check the following:</p>
<p>$ gdb /bin/ls<br />
GNU gdb 6.3.50-20050815 (Apple version gdb-768) (Sun Mar 22 01:47:54 UTC 2009)<br />
Copyright 2004 Free Software Foundation, Inc.<br />
GDB is free software, covered by the GNU General Public License, and you are<br />
welcome to change it and/or distribute copies of it under certain conditions.<br />
Type &#8220;show copying&#8221; to see the conditions.<br />
There is absolutely no warranty for GDB.  Type &#8220;show warranty&#8221; for details.<br />
This GDB was configured as &#8220;i386-apple-darwin&#8221;&#8230;Reading symbols for shared libraries &#8230;. done</p>
<p>(gdb) b *0x000023f0<br />
Breakpoint 1 at 0x23f0<br />
(gdb) r<br />
Starting program: /bin/ls<br />
Reading symbols for shared libraries +++. done</p>
<p>Breakpoint 1, 0x000023f0 in ?? ()<br />
$1 = &#8220;test&#8221;<br />
$2 = 10<br />
$3 = void<br />
(gdb) q<br />
The program is running.  Exit anyway? (y or n) y</p>
<p>$ gdb<br />
GNU gdb 6.3.50-20050815 (Apple version gdb-768) (Sun Mar 22 01:47:54 UTC 2009)<br />
Copyright 2004 Free Software Foundation, Inc.<br />
GDB is free software, covered by the GNU General Public License, and you are<br />
welcome to change it and/or distribute copies of it under certain conditions.<br />
Type &#8220;show copying&#8221; to see the conditions.<br />
There is absolutely no warranty for GDB.  Type &#8220;show warranty&#8221; for details.<br />
This GDB was configured as &#8220;i386-apple-darwin&#8221;.<br />
(gdb) exec-file /bin/ls<br />
Reading symbols for shared libraries &#8230;. done<br />
(gdb) b *0x000023f0<br />
Breakpoint 1 at 0x23f0<br />
(gdb) r<br />
Starting program: /bin/ls<br />
Reading symbols for shared libraries .+++. done</p>
<p>Breakpoint 1, 0x000023f0 in ?? ()<br />
$1 = &#8220;test&#8221;<br />
$2 = 10<br />
$3 = 20<br />
(gdb) </p>
<p>This is the .gdbinit I used to test:<br />
$ cat .gdbinit<br />
set $globalvariable = 20<br />
define bugtest<br />
set $bugtest = 10<br />
print $bugtest<br />
end</p>
<p>define hook-stop<br />
print &#8220;test&#8221;<br />
bugtest<br />
print $globalvariable<br />
end</p>
<p>As you can see it doesn&#8217;t support global variables if you use a gdb /bin/ls from the command line, only if you load gdb without parameters and then point to the target using exec-file.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: john doe</title>
		<link>http://reverse.put.as/2008/11/28/apples-gdb-bug/comment-page-1/#comment-1777</link>
		<dc:creator>john doe</dc:creator>
		<pubDate>Wed, 08 Apr 2009 20:28:39 +0000</pubDate>
		<guid isPermaLink="false">http://reverse.put.as/?p=119#comment-1777</guid>
		<description>I have mammon&#039;s gdbinit 6.1 working fine here
(10.5.6 intel, gdb 6.3.50-20050815 ) so i think
the problem lies somewhere else.

FYI the following works fine:

define bugtest
set $bugtest = 10
output $bugtest
end

no matter if i run gdb without args etc</description>
		<content:encoded><![CDATA[<p>I have mammon&#8217;s gdbinit 6.1 working fine here<br />
(10.5.6 intel, gdb 6.3.50-20050815 ) so i think<br />
the problem lies somewhere else.</p>
<p>FYI the following works fine:</p>
<p>define bugtest<br />
set $bugtest = 10<br />
output $bugtest<br />
end</p>
<p>no matter if i run gdb without args etc</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike Myers</title>
		<link>http://reverse.put.as/2008/11/28/apples-gdb-bug/comment-page-1/#comment-1465</link>
		<dc:creator>Mike Myers</dc:creator>
		<pubDate>Thu, 19 Mar 2009 20:16:35 +0000</pubDate>
		<guid isPermaLink="false">http://reverse.put.as/?p=119#comment-1465</guid>
		<description>I wish I had a list of ways in which the GDB on OS X doesn&#039;t do what GDB on other platforms does. So far I have run into two ways (it won&#039;t &quot;find&quot; things across a process&#039;s memory, and it won&#039;t &quot;catch&quot; the loading/unloading of libraries). And I&#039;ve only been using it for a few weeks so who knows how many other ways it is broken.</description>
		<content:encoded><![CDATA[<p>I wish I had a list of ways in which the GDB on OS X doesn&#8217;t do what GDB on other platforms does. So far I have run into two ways (it won&#8217;t &#8220;find&#8221; things across a process&#8217;s memory, and it won&#8217;t &#8220;catch&#8221; the loading/unloading of libraries). And I&#8217;ve only been using it for a few weeks so who knows how many other ways it is broken.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: firstsingle</title>
		<link>http://reverse.put.as/2008/11/28/apples-gdb-bug/comment-page-1/#comment-1322</link>
		<dc:creator>firstsingle</dc:creator>
		<pubDate>Mon, 02 Mar 2009 22:05:11 +0000</pubDate>
		<guid isPermaLink="false">http://reverse.put.as/?p=119#comment-1322</guid>
		<description>Thanks!
At least I have some clue why I&#039;m getting this error message.</description>
		<content:encoded><![CDATA[<p>Thanks!<br />
At least I have some clue why I&#8217;m getting this error message.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

