<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>command line gdb debugging symbols/stack trace</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/2013/command-line-gdb-debugging-symbols-stack-trace</link><description>Using the pure-gcc makefiles, at present I only see this for a stack trace in the command line gdb client: 
 (gdb) bt
#0 0xfffffffe in ?? ()
#1 &amp;lt;signal handler called&amp;gt;
#2 0x00000000 in ?? ()
 
 This is weird because I do have symbols: 
 (gdb) info</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 08 Jul 2015 00:32:26 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/2013/command-line-gdb-debugging-symbols-stack-trace" /><item><title>RE: command line gdb debugging symbols/stack trace</title><link>https://devzone.nordicsemi.com/thread/8626?ContentTypeID=1</link><pubDate>Wed, 08 Jul 2015 00:32:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7cf155f4-a3db-4e8c-924b-72a40f554e74</guid><dc:creator>Clem Taylor</dc:creator><description>&lt;p&gt;Try:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;mon reset
load
mon reset
continue
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The macro I use:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;define rc
   # reset and halt CPU
   mon reset
   printf &amp;quot;Run...\n&amp;quot;
   continue
end 

define lc
   load
   rc   
end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;For me &amp;#39;lc&amp;#39; prints:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Loading section .text, size 0x151f8 lma 0x18000
Loading section .ARM.exidx, size 0x8 lma 0x2d1f8
Loading section .data, size 0xd8 lma 0x2d200
Loading section .fill, size 0xbd24 lma 0x2d2d8
Loading section .appCRC, size 0x4 lma 0x38ffc
Start address 0x6d0, load size 135168
Transfer rate: 13200 KB/sec, 3653 bytes/write.
Resetting target
Run...
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I used to use &amp;#39;load&amp;#39; then &amp;#39;run&amp;#39;, but that requires &amp;#39;gdb extended-remote&amp;#39; mode and some point in the recent past Segger broke breakpoint support in &amp;#39;extended-remote&amp;#39; mode.&lt;/p&gt;
&lt;p&gt;I really don&amp;#39;t trust the Segger stuff, I recently discovered if you load code onto a chip with the memory protection bits set, JLinkGDBServer will happily report:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Downloading 4096 bytes @ address 0x00018000 - Verified OK
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: command line gdb debugging symbols/stack trace</title><link>https://devzone.nordicsemi.com/thread/8625?ContentTypeID=1</link><pubDate>Tue, 07 Jul 2015 22:56:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4f28a6f0-27db-4658-bb0f-74a886e089c4</guid><dc:creator>asifhn</dc:creator><description>&lt;p&gt;I get the same problem as originally stated. And doing a &amp;quot;load&amp;quot; in gdb after &amp;quot;target remote ...&amp;quot; causes error:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(gdb) load
Loading section .text, size 0xa9d7 lma 0x16000
Loading section .ARM.exidx, size 0x8 lma 0x209d8
Loading section .data, size 0x6c lma 0x209e0
Error finishing flash operation
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;For whatever reason I cannot continue after I do the gdb &amp;quot;load&amp;quot;. I have to re-program the nordic flash to be able to do a gdb continue. Does gdb &amp;quot;load&amp;quot; corrupt the nordic flash? I wonder!&lt;/p&gt;
&lt;p&gt;By-the-way, I use openocd as my gdb server. I think this has something to do with sigint, but I am not sure.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: command line gdb debugging symbols/stack trace</title><link>https://devzone.nordicsemi.com/thread/8624?ContentTypeID=1</link><pubDate>Tue, 07 Jul 2015 22:53:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2ed80943-a046-436e-a2b2-965707ccc12f</guid><dc:creator>Eliot Stock</dc:creator><description>&lt;p&gt;This is not an answer. I&amp;#39;d post it as a new question and link back to this one if you want an answer to it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: command line gdb debugging symbols/stack trace</title><link>https://devzone.nordicsemi.com/thread/8623?ContentTypeID=1</link><pubDate>Tue, 07 Jul 2015 22:48:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:da808db8-d1f4-4146-a8c8-5258eb3b7ac9</guid><dc:creator>asifhn</dc:creator><description>&lt;p&gt;I get the same problem as originally stated. And doing a &amp;quot;load&amp;quot; in gdb after &amp;quot;target remote ...&amp;quot; causes error:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(gdb) load
Loading section .text, size 0xa9d7 lma 0x16000
Loading section .ARM.exidx, size 0x8 lma 0x209d8
Loading section .data, size 0x6c lma 0x209e0
Error finishing flash operation
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;For whatever reason I cannot continue after I do the gdb &amp;quot;load&amp;quot;. I have to re-program the nordic flash to be able to do a gdb continue. Does gdb &amp;quot;load&amp;quot; corrupt the nordic flash? I wonder!&lt;/p&gt;
&lt;p&gt;By-the-way, I use openocd as my gdb server. I think this has something to do with sigint, but I am not sure.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: command line gdb debugging symbols/stack trace</title><link>https://devzone.nordicsemi.com/thread/8622?ContentTypeID=1</link><pubDate>Fri, 28 Mar 2014 14:38:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0c850f3c-4a93-4f3d-934f-6064e16085ea</guid><dc:creator>Eliot Stock</dc:creator><description>&lt;p&gt;Much better, thank you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: command line gdb debugging symbols/stack trace</title><link>https://devzone.nordicsemi.com/thread/8621?ContentTypeID=1</link><pubDate>Fri, 28 Mar 2014 14:13:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:deb6fb7b-690b-4388-9ad9-75e399d9dc2e</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;The pure-gcc makefiles by default doesn&amp;#39;t currently automatically load the binary and reset the chip, and if the flash contents isn&amp;#39;t according to what GDB expects, you&amp;#39;ll often see this 0xFFFFFFFE address.&lt;/p&gt;
&lt;p&gt;If you always want to do such load before you start debug, you can add the command load and mon reset to the gdbinit like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
target remote localhost:2331
load
mon reset
break main

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I&amp;#39;ll consider changing this upstream as well, but the default behavior is useful if you want to connect to a running target... Thinking about it a second time however, the suggestion above is perhaps what&amp;#39;s best for the 90 % use case, so it might make sense to change it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>