<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://elinux.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://elinux.org/api.php?action=feedcontributions&amp;user=Tord&amp;feedformat=atom</id>
		<title>eLinux.org - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://elinux.org/api.php?action=feedcontributions&amp;user=Tord&amp;feedformat=atom"/>
		<link rel="alternate" type="text/html" href="http://elinux.org/Special:Contributions/Tord"/>
		<updated>2013-05-24T09:32:37Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.21alpha</generator>

	<entry>
		<id>http://elinux.org/R-Pi_Troubleshooting</id>
		<title>R-Pi Troubleshooting</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/R-Pi_Troubleshooting"/>
				<updated>2012-05-22T20:58:57Z</updated>
		
		<summary type="html">&lt;p&gt;Tord: /* Ethernet connection is lost when a USB device is plugged in */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to the [[R-Pi Hub|Hub]].&lt;br /&gt;
&lt;br /&gt;
[[Category:RaspberryPi]]&lt;br /&gt;
This page lists the most common problems and suggests some solutions.&lt;br /&gt;
&lt;br /&gt;
==Power / Start-up==&lt;br /&gt;
A good power supply that will supply 5V is vital. There is more information about [[RPi_Hardware#Power|power supplies and troubleshooting]].&lt;br /&gt;
===Red power LED does not light, nothing on display===&lt;br /&gt;
The power is not properly connected.&lt;br /&gt;
&lt;br /&gt;
===Red power LED is on, green LED does not flash, nothing on display===&lt;br /&gt;
*The Raspberry Pi cannot find a valid image on the SD card. Check that you have correctly written a Raspberry Pi image to the card. Some SD cards work when cold, but not when warm from use&amp;lt;ref&amp;gt;http://www.raspberrypi.org/phpBB3/viewtopic.php?f=6&amp;amp;t=5900&amp;amp;p=79008#p79008&amp;lt;/ref&amp;gt;. See also, [[RPi_VerifiedPeripherals#SD_cards|Known SD Cards]].&lt;br /&gt;
*The voltage is too low (not 5 V), try a different power supply. See also, [[#Troubleshooting_power_problems|Power Problems]].&lt;br /&gt;
*''(unlikely)'' hardware abuse, for example by connecting a 7 V supply to a 3v3 GPIO output pin&amp;lt;ref&amp;gt;http://www.raspberrypi.org/phpBB3/viewtopic.php?f=6&amp;amp;t=5096&amp;amp;p=76503#p76503&amp;lt;/ref&amp;gt; or powering up the board after a solder splash shorts some traces&amp;lt;ref&amp;gt;http://www.raspberrypi.org/phpBB3/viewtopic.php?f=6&amp;amp;t=5096&amp;amp;p=76654#p76654&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Raspberry Pi shuts down soon after booting up===&lt;br /&gt;
This is caused by a power supply with too low voltage or too high voltage. &lt;br /&gt;
Or it could be the cable. See: [[On_the_RPi_usb_power_cable]]&lt;br /&gt;
&lt;br /&gt;
===Pi boots sometimes but not always===&lt;br /&gt;
With a known good power supply and known good SD card, the R-Pi boots occasionally, but other times shows only a tiny green flicker from the &amp;quot;OK&amp;quot; LED and it fails to start, even with no USB devices and no Ethernet. This has been reported several times&amp;lt;ref&amp;gt;http://www.raspberrypi.org/forum/troubleshooting/will-not-boot-consistently-any-suggestions-before-i-send-my-pi-back&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref&amp;gt;http://www.raspberrypi.org/forum/troubleshooting/booted-once-wont-work-again&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref&amp;gt;http://www.raspberrypi.org/forum/troubleshooting/possible-fault-pi-boots-sometimes-but-not-always&amp;lt;/ref&amp;gt; and remains an open issue. Low voltage or an improper SD card can cause it. Some SD cards will work until they warm up slightly, and then fail&amp;lt;ref&amp;gt;http://www.raspberrypi.org/phpBB3/viewtopic.php?f=6&amp;amp;t=5900&amp;amp;p=79008#p79008&amp;lt;/ref&amp;gt;. When exposed to 21 C room temperature the warmest part of an uncased working R-Pi should be 41 C&amp;lt;ref&amp;gt;http://www.raspberrypi.org/phpBB3/viewtopic.php?f=6&amp;amp;t=5900&amp;amp;p=78973#p78973&amp;lt;/ref&amp;gt;. The wiki has a [[RPi_VerifiedPeripherals#SD_cards | list of working SD cards]]. Buy from a reliable vendor as it has been [http://www.petapixel.com/2011/05/20/one-third-of-the-sandisk-memory-cards-on-earth-are-counterfeit/ claimed] that 1/3 of all &amp;quot;Sandisk&amp;quot; labelled memory cards are counterfeit.&lt;br /&gt;
&lt;br /&gt;
==Keyboard / Mouse / Input Devices==&lt;br /&gt;
===Keyboard randomly repeats key presses===&lt;br /&gt;
This is caused by inadequate power. Use a good power supply and a good power cable. Some cheap cables that work with a cell phone, cannot fully power the R-Pi. Some USB devices require a lot of power: most will have a label showing the voltage and mA requirements. They should be 5v 100mA each max, any more than this they must be used with a powered USB hub. Try unplugging every USB device except the keyboard (you should also note that some keyboards have built in hubs and can try to draw 150mA (Pi can only handle 100mA per USB slot without a hub)).&lt;br /&gt;
Also, use the latest software. Forum user MrEngman [http://www.raspberrypi.org/forum/absolute-beginners/using-a-powered-usb-port-to-power-a-rpi#p76485 reported] some keyboard repeats and wireless hangs until [http://www.raspberrypi.org/downloads upgrading] to the debian6-19-04-2012 kernel, which he reports stable with no problems even with a low [[R-Pi_Troubleshooting#Troubleshooting_power_problems | TP1-TP2 voltage]] of 4.65 - 4.68 volts.&lt;br /&gt;
&lt;br /&gt;
===Keyboard / Mouse interferes with USB WiFi device===&lt;br /&gt;
Connecting a keyboard and/or mouse while a USB WiFi device is connected, may cause one or both devices to malfunction. On April 30 2012, there was a bugfix&amp;lt;ref&amp;gt;https://github.com/raspberrypi/linux/commit/e09244e60881148431ecd016ccc42f1fa0678556&amp;lt;/ref&amp;gt; relating to USB sharing between high-speed (eg. WiFi) and full/low-speed devices (eg. keyboard/mouse). User spennig&amp;lt;ref&amp;gt;http://www.raspberrypi.org/forum/troubleshooting/usb-power-hub-wifi/page-4#p74609&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://www.raspberrypi.org/forum/troubleshooting/success-with-kb-mouse-wifi?value=3761&amp;amp;type=8&amp;amp;include=1&amp;amp;search=1&amp;lt;/ref&amp;gt; reports this patch did not fix the Mouse/WiFi conflict. On 2012-05-12, user spennig was pleased to confirm that wifi was working with a USB keyboard and mouse, as long as the Raspberry Pi had a good PSU and a powered hub. Even so, some experimentation was needed, e.g. USB mouse connected to the device, and the keyboard and mouse connected to the powered hub. Some experimentation may be necessary to find a working combination; however a good power supply is essential.&lt;br /&gt;
&lt;br /&gt;
===Wireless Keyboard trouble===&lt;br /&gt;
Some wireless keyboards, for example the Microsoft Wireless Keyboard 800 are reported to fail&amp;lt;ref&amp;gt;http://www.raspberrypi.org/forum/troubleshooting/display-and-keyboard-issues-on-a-real-pi#p74816&amp;lt;/ref&amp;gt; even though the current drawn by the wireless adaptor is within the R-Pi USB spec limit of 100 mA. This may be a software driver problem.&lt;br /&gt;
&lt;br /&gt;
===Re-mapping the keyboard with Debian Squeeze===&lt;br /&gt;
If different letters appear on-screen from that which you typed, you need to reconfigure you keyboard settings. In Debian, from a command line type:&lt;br /&gt;
 sudo dpkg-reconfigure keyboard-configuration&lt;br /&gt;
Follow the prompts. Then restart your RasPi.&amp;lt;br /&amp;gt;'''Or:'''&amp;lt;br /&amp;gt; From the command line type:&lt;br /&gt;
 sudo nano /etc/default/keyboard&lt;br /&gt;
Then find where it says &amp;lt;blockquote&amp;gt;XKBLAYOUT=”gb”&amp;lt;/blockquote&amp;gt;and change the gb to the two letter code for your country. [http://www.raspberrypi.org/phpBB3/viewtopic.php?p=78325#p78325]&lt;br /&gt;
&lt;br /&gt;
===Slow keyboard mapping=== &lt;br /&gt;
If you have remapped your keyboard and get a very long delay during the keyboard mapping at startup, type the following once on the command line after you have logged in:&lt;br /&gt;
 sudo setupcon&lt;br /&gt;
&lt;br /&gt;
==Memory Cards==&lt;br /&gt;
===General / Formatting===&lt;br /&gt;
If you are having problems setting up your memory card you might want to try erasing it completely - especially if it has been used elsewhere and still contains data / partitions. &lt;br /&gt;
* Windows and Mac users can download a formatting tool from the SD Association: https://www.sdcard.org/downloads/formatter_3/&lt;br /&gt;
&lt;br /&gt;
* If you are preparing your SD card on a Linux-based system using the ''dd'' command, this operation will completely erase any existing data and partitions. Make sure you put the source image on the whole card, e.g. /dev/sdd, NOT /dev/sdd1.&lt;br /&gt;
&lt;br /&gt;
===SD Card Does Not Boot===&lt;br /&gt;
Some memory cards do not work on the R-Pi, so check the [[RPi_VerifiedPeripherals#SD_cards|list of known SD cards]].&lt;br /&gt;
&lt;br /&gt;
==Networking==&lt;br /&gt;
&lt;br /&gt;
===Ethernet connection is lost when a USB device is plugged in===&lt;br /&gt;
This is caused by inadequate power. Use a good power supply and a good power cable. Some cheap cables that work with a cell phone, cannot fully power the R-Pi. Some USB devices require a lot of power (&amp;gt;100 mA), so they must be used with a powered USB hub. Some cheap USB hubs suck power from the Raspberry Pi even if a USB power supply is connected.&lt;br /&gt;
&lt;br /&gt;
===Ethernet connects at 10M instead of 100M===&lt;br /&gt;
The LED in the corner of the board labelled &amp;quot;10M&amp;quot; is mislabeled. When that LED is on, the R-Pi is actually connected at 100 Mbps. You can confirm the true transfer rate using a network benchmark such as iperf. You can also read the current network speed with&lt;br /&gt;
  cat /sys/class/net/eth0/speed&lt;br /&gt;
&lt;br /&gt;
==Passwords==&lt;br /&gt;
===I do not know the password to login===&lt;br /&gt;
Please check the page [http://www.raspberrypi.org/downloads http://www.raspberrypi.org/downloads] for the correct username and password for each  image.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Debian from later dates - pi/raspberry&lt;br /&gt;
Debian Feb 17 - pi/suse&lt;br /&gt;
Arch - root/root&lt;br /&gt;
&lt;br /&gt;
===Some programs refuse to accept my password===&lt;br /&gt;
While using Debian, some programs may ask for your password but refuse to accept a valid password.&lt;br /&gt;
&lt;br /&gt;
This is a fault in some Debian images and will be fixed soon. If you are using an image with this fault, enter the following command on the command line.&lt;br /&gt;
 gconftool-2  -\-type bool  -\-set  /apps/gksu/sudo-mode  true&lt;br /&gt;
Please enter this command carefully, the spaces are important. The command should be accepted without any response or errors.&lt;br /&gt;
&lt;br /&gt;
==Sound==&lt;br /&gt;
===Sound does not work with a HDMI monitor===&lt;br /&gt;
This is caused by some computer monitors which select DVI mode even if a HDMI cable is connected.&lt;br /&gt;
&lt;br /&gt;
Edit the configuration file, see the instructions at [[R-Pi_ConfigurationFile]].&lt;br /&gt;
&lt;br /&gt;
Add the following line to the configuration file&lt;br /&gt;
 hdmi_drive=2&lt;br /&gt;
&lt;br /&gt;
===Sound does not work at all, or in some applications===&lt;br /&gt;
The ALSA sound driver is &amp;quot;alpha&amp;quot; and has issues, but some applications do work.  If you are running Debian, try&lt;br /&gt;
&lt;br /&gt;
  cd /opt/vc/src/hello_pi/hello_audio&lt;br /&gt;
  make&lt;br /&gt;
  ./hello_audio.bin&lt;br /&gt;
&lt;br /&gt;
to test analogue output. And&lt;br /&gt;
&lt;br /&gt;
  ./hello_audio.bin 1&lt;br /&gt;
&lt;br /&gt;
to test HDMI.&lt;br /&gt;
&lt;br /&gt;
To test other applications, '''before''' &amp;quot;startx&amp;quot; type&lt;br /&gt;
&lt;br /&gt;
  sudo modprobe snd_bcm2835&lt;br /&gt;
  sudo aplay &amp;lt;name of wav file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By default output will be automatic (hdmi if hdmi supports audio, otherwise analogue). You can force it with:&lt;br /&gt;
&lt;br /&gt;
  sudo amixer cset numid=3 &amp;lt;n&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where n is 0=auto, 1=headphones, 2=hdmi.&lt;br /&gt;
&lt;br /&gt;
==Display==&lt;br /&gt;
===Startx fails to start===&lt;br /&gt;
If you just get errors instead of a desktop when typing&lt;br /&gt;
  startx&lt;br /&gt;
you may be out of storage space on the SD card. By default there are only a few hundred MB free in the 2 GB main partition, which can quickly fill up if you download files. Make sure there is some space free (gparted can expand a partition, if the SD card is &amp;gt; 2GB). Also, installing some software may incorrectly create or modify a .Xauthority file in your home directory, causing startx to fail, according to [http://www.raspberrypi.org/forum/troubleshooting/startx-fails-worked-yesterday this thread]. Temporarily renaming, moving, or deleting that file may fix the problem.&lt;br /&gt;
&lt;br /&gt;
===Video does not play or plays very slowly===&lt;br /&gt;
The only hardware-accelerated video player is the [http://www.raspberrypi.org/forum/general-discussion/openelec-meets-raspberry-pi-part-1-xbmc XMBC distribution] and its command line variant omxplayer. H264 is the only hardware-accelerated codec, for playback. No hardware encoding is supported. Additional codecs were not purchased as licensing fees would have increased the R-Pi's price.&lt;br /&gt;
&lt;br /&gt;
===Can only get 800x480 resolution in LXDE (Arch linux)===&lt;br /&gt;
Known issue with distro package as of 17-Apri-2012 - there's some missing boot config info. Creating a suitable cmdline.txt fixes it - type the following at the Raspberry Pi command line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  sudo echo &amp;quot;dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 root=/dev/mmcblk0p2 rootfstype=ext3 rootwait&amp;quot; &amp;gt;/boot/cmdline.txt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Big black borders around small image on HD monitors===&lt;br /&gt;
&lt;br /&gt;
Out of the box, R-Pi graphics don't necessarily fill the 1080p (ie Full HD) screen. This is due to something called &amp;quot;Underscan&amp;quot;, and it can be fixed easily.&lt;br /&gt;
&lt;br /&gt;
Edit the configuration file, see the instructions at [[R-Pi_ConfigurationFile]].&lt;br /&gt;
&lt;br /&gt;
Add the following lines to the configuration file...&lt;br /&gt;
&lt;br /&gt;
If your display has no overscan:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
disable_overscan=1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or if your display has some overscan:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
overscan_left=-20&lt;br /&gt;
&lt;br /&gt;
overscan_right=-20&lt;br /&gt;
&lt;br /&gt;
overscan_top=-20&lt;br /&gt;
&lt;br /&gt;
overscan_bottom=-20&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Making the R-Pi graphics fill the screen is a matter of experimenting with the numbers you put in the config.txt file. Change the numbers – try jumps of 5 or 10 at a time. Bigger negative numbers reduce the black borders (so -40 means less black border than -20). The numbers do not all have to be the same; you can use this feature to centre the display on the screen.&lt;br /&gt;
&lt;br /&gt;
===Writing spills off the screen on HD monitors===&lt;br /&gt;
&lt;br /&gt;
Out of the box, R-Pi graphics may be larger than the 1080p (ie Full HD) screen. This is due to something called &amp;quot;Overscan&amp;quot;, and it can be fixed easily by creating a simple text file on the R-Pi SD card by using Notepad on your PC.&lt;br /&gt;
&lt;br /&gt;
Follow the instructions in the section &amp;quot;Big black borders around small image on HD monitors&amp;quot;, but use positive numbers for the overscan settings, for example&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
overscan_left=20&lt;br /&gt;
&lt;br /&gt;
overscan_right=20&lt;br /&gt;
&lt;br /&gt;
overscan_top=20&lt;br /&gt;
&lt;br /&gt;
overscan_bottom=20&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Interference visible on a HDMI or DVI monitor===&lt;br /&gt;
This may be caused by loss of signal on long video cables. The signal level may be increased by changing a configuration parameter.&lt;br /&gt;
[[File:RPi_HDMI_interference.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Edit the configuration file, see the instructions at [[R-Pi_ConfigurationFile]].&lt;br /&gt;
&lt;br /&gt;
Add the following line to the configuration file&lt;br /&gt;
 config_hdmi_boost=4&lt;br /&gt;
&lt;br /&gt;
You may experiment with different values of config_hdmi_boost. Value 1 is used for very short cables, value 7 is used for very long cables.&lt;br /&gt;
&lt;br /&gt;
==GPIO==&lt;br /&gt;
Remember that the GPIO pins are 3.3V logic level only, and are &amp;lt;strong&amp;gt;NOT&amp;lt;/strong&amp;gt; 5V tolerant.&lt;br /&gt;
&lt;br /&gt;
If you momentarily shorted the two end GPIO pins together (+3.3V and +5V), or a supply pin to ground, and the Pi appears to be dead, don't panic. The input polyfuse may have tripped. It is self-resetting after it cools down. Disconnect power and wait for 30 minutes, then try to restart.&lt;br /&gt;
&lt;br /&gt;
==General==&lt;br /&gt;
===The time is incorrect===&lt;br /&gt;
If the clock is off by a series of hours, in the command line type:&lt;br /&gt;
 sudo dpkg-reconfigure tzdata&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting power problems==&lt;br /&gt;
If you think you have a problem with your power supply, it is a good idea to check the actual voltage&lt;br /&gt;
on the Raspberry Pi circuit board. Two test points labelled TP1 and TP2 are provided on the circuit board&lt;br /&gt;
to facilitate voltage measurements.&lt;br /&gt;
&lt;br /&gt;
Use a multimeter which is set to the range 20 volts DC (or 20v =). You should see a voltage between 4.75 and 5.25 volts. Anything outside this range indicates that you have a problem with your power supply or your power cable.&lt;br /&gt;
&lt;br /&gt;
If you have not used a multimeter before, see these  [[http://www.sparkfun.com/tutorials/202 basic instructions]]&lt;br /&gt;
&lt;br /&gt;
Note: Even if the multimeter shows the correct voltage, you may have some power supply problems. A multimeter only displays the average voltage. If there are very short-lived dips or spikes in the voltage, these will not be shown by the multimeter. &lt;br /&gt;
&lt;br /&gt;
[[File:RPI_Test_Points.JPG|400px]] [[File:Voltmeter.JPG|250px]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tord</name></author>	</entry>

	<entry>
		<id>http://elinux.org/R-Pi_Troubleshooting</id>
		<title>R-Pi Troubleshooting</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/R-Pi_Troubleshooting"/>
				<updated>2012-05-22T20:54:29Z</updated>
		
		<summary type="html">&lt;p&gt;Tord: /* Slow keyboard mapping */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to the [[R-Pi Hub|Hub]].&lt;br /&gt;
&lt;br /&gt;
[[Category:RaspberryPi]]&lt;br /&gt;
This page lists the most common problems and suggests some solutions.&lt;br /&gt;
&lt;br /&gt;
==Power / Start-up==&lt;br /&gt;
A good power supply that will supply 5V is vital. There is more information about [[RPi_Hardware#Power|power supplies and troubleshooting]].&lt;br /&gt;
===Red power LED does not light, nothing on display===&lt;br /&gt;
The power is not properly connected.&lt;br /&gt;
&lt;br /&gt;
===Red power LED is on, green LED does not flash, nothing on display===&lt;br /&gt;
*The Raspberry Pi cannot find a valid image on the SD card. Check that you have correctly written a Raspberry Pi image to the card. Some SD cards work when cold, but not when warm from use&amp;lt;ref&amp;gt;http://www.raspberrypi.org/phpBB3/viewtopic.php?f=6&amp;amp;t=5900&amp;amp;p=79008#p79008&amp;lt;/ref&amp;gt;. See also, [[RPi_VerifiedPeripherals#SD_cards|Known SD Cards]].&lt;br /&gt;
*The voltage is too low (not 5 V), try a different power supply. See also, [[#Troubleshooting_power_problems|Power Problems]].&lt;br /&gt;
*''(unlikely)'' hardware abuse, for example by connecting a 7 V supply to a 3v3 GPIO output pin&amp;lt;ref&amp;gt;http://www.raspberrypi.org/phpBB3/viewtopic.php?f=6&amp;amp;t=5096&amp;amp;p=76503#p76503&amp;lt;/ref&amp;gt; or powering up the board after a solder splash shorts some traces&amp;lt;ref&amp;gt;http://www.raspberrypi.org/phpBB3/viewtopic.php?f=6&amp;amp;t=5096&amp;amp;p=76654#p76654&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Raspberry Pi shuts down soon after booting up===&lt;br /&gt;
This is caused by a power supply with too low voltage or too high voltage. &lt;br /&gt;
Or it could be the cable. See: [[On_the_RPi_usb_power_cable]]&lt;br /&gt;
&lt;br /&gt;
===Pi boots sometimes but not always===&lt;br /&gt;
With a known good power supply and known good SD card, the R-Pi boots occasionally, but other times shows only a tiny green flicker from the &amp;quot;OK&amp;quot; LED and it fails to start, even with no USB devices and no Ethernet. This has been reported several times&amp;lt;ref&amp;gt;http://www.raspberrypi.org/forum/troubleshooting/will-not-boot-consistently-any-suggestions-before-i-send-my-pi-back&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref&amp;gt;http://www.raspberrypi.org/forum/troubleshooting/booted-once-wont-work-again&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref&amp;gt;http://www.raspberrypi.org/forum/troubleshooting/possible-fault-pi-boots-sometimes-but-not-always&amp;lt;/ref&amp;gt; and remains an open issue. Low voltage or an improper SD card can cause it. Some SD cards will work until they warm up slightly, and then fail&amp;lt;ref&amp;gt;http://www.raspberrypi.org/phpBB3/viewtopic.php?f=6&amp;amp;t=5900&amp;amp;p=79008#p79008&amp;lt;/ref&amp;gt;. When exposed to 21 C room temperature the warmest part of an uncased working R-Pi should be 41 C&amp;lt;ref&amp;gt;http://www.raspberrypi.org/phpBB3/viewtopic.php?f=6&amp;amp;t=5900&amp;amp;p=78973#p78973&amp;lt;/ref&amp;gt;. The wiki has a [[RPi_VerifiedPeripherals#SD_cards | list of working SD cards]]. Buy from a reliable vendor as it has been [http://www.petapixel.com/2011/05/20/one-third-of-the-sandisk-memory-cards-on-earth-are-counterfeit/ claimed] that 1/3 of all &amp;quot;Sandisk&amp;quot; labelled memory cards are counterfeit.&lt;br /&gt;
&lt;br /&gt;
==Keyboard / Mouse / Input Devices==&lt;br /&gt;
===Keyboard randomly repeats key presses===&lt;br /&gt;
This is caused by inadequate power. Use a good power supply and a good power cable. Some cheap cables that work with a cell phone, cannot fully power the R-Pi. Some USB devices require a lot of power: most will have a label showing the voltage and mA requirements. They should be 5v 100mA each max, any more than this they must be used with a powered USB hub. Try unplugging every USB device except the keyboard (you should also note that some keyboards have built in hubs and can try to draw 150mA (Pi can only handle 100mA per USB slot without a hub)).&lt;br /&gt;
Also, use the latest software. Forum user MrEngman [http://www.raspberrypi.org/forum/absolute-beginners/using-a-powered-usb-port-to-power-a-rpi#p76485 reported] some keyboard repeats and wireless hangs until [http://www.raspberrypi.org/downloads upgrading] to the debian6-19-04-2012 kernel, which he reports stable with no problems even with a low [[R-Pi_Troubleshooting#Troubleshooting_power_problems | TP1-TP2 voltage]] of 4.65 - 4.68 volts.&lt;br /&gt;
&lt;br /&gt;
===Keyboard / Mouse interferes with USB WiFi device===&lt;br /&gt;
Connecting a keyboard and/or mouse while a USB WiFi device is connected, may cause one or both devices to malfunction. On April 30 2012, there was a bugfix&amp;lt;ref&amp;gt;https://github.com/raspberrypi/linux/commit/e09244e60881148431ecd016ccc42f1fa0678556&amp;lt;/ref&amp;gt; relating to USB sharing between high-speed (eg. WiFi) and full/low-speed devices (eg. keyboard/mouse). User spennig&amp;lt;ref&amp;gt;http://www.raspberrypi.org/forum/troubleshooting/usb-power-hub-wifi/page-4#p74609&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://www.raspberrypi.org/forum/troubleshooting/success-with-kb-mouse-wifi?value=3761&amp;amp;type=8&amp;amp;include=1&amp;amp;search=1&amp;lt;/ref&amp;gt; reports this patch did not fix the Mouse/WiFi conflict. On 2012-05-12, user spennig was pleased to confirm that wifi was working with a USB keyboard and mouse, as long as the Raspberry Pi had a good PSU and a powered hub. Even so, some experimentation was needed, e.g. USB mouse connected to the device, and the keyboard and mouse connected to the powered hub. Some experimentation may be necessary to find a working combination; however a good power supply is essential.&lt;br /&gt;
&lt;br /&gt;
===Wireless Keyboard trouble===&lt;br /&gt;
Some wireless keyboards, for example the Microsoft Wireless Keyboard 800 are reported to fail&amp;lt;ref&amp;gt;http://www.raspberrypi.org/forum/troubleshooting/display-and-keyboard-issues-on-a-real-pi#p74816&amp;lt;/ref&amp;gt; even though the current drawn by the wireless adaptor is within the R-Pi USB spec limit of 100 mA. This may be a software driver problem.&lt;br /&gt;
&lt;br /&gt;
===Re-mapping the keyboard with Debian Squeeze===&lt;br /&gt;
If different letters appear on-screen from that which you typed, you need to reconfigure you keyboard settings. In Debian, from a command line type:&lt;br /&gt;
 sudo dpkg-reconfigure keyboard-configuration&lt;br /&gt;
Follow the prompts. Then restart your RasPi.&amp;lt;br /&amp;gt;'''Or:'''&amp;lt;br /&amp;gt; From the command line type:&lt;br /&gt;
 sudo nano /etc/default/keyboard&lt;br /&gt;
Then find where it says &amp;lt;blockquote&amp;gt;XKBLAYOUT=”gb”&amp;lt;/blockquote&amp;gt;and change the gb to the two letter code for your country. [http://www.raspberrypi.org/phpBB3/viewtopic.php?p=78325#p78325]&lt;br /&gt;
&lt;br /&gt;
===Slow keyboard mapping=== &lt;br /&gt;
If you have remapped your keyboard and get a very long delay during the keyboard mapping at startup, type the following once on the command line after you have logged in:&lt;br /&gt;
 sudo setupcon&lt;br /&gt;
&lt;br /&gt;
==Memory Cards==&lt;br /&gt;
===General / Formatting===&lt;br /&gt;
If you are having problems setting up your memory card you might want to try erasing it completely - especially if it has been used elsewhere and still contains data / partitions. &lt;br /&gt;
* Windows and Mac users can download a formatting tool from the SD Association: https://www.sdcard.org/downloads/formatter_3/&lt;br /&gt;
&lt;br /&gt;
* If you are preparing your SD card on a Linux-based system using the ''dd'' command, this operation will completely erase any existing data and partitions. Make sure you put the source image on the whole card, e.g. /dev/sdd, NOT /dev/sdd1.&lt;br /&gt;
&lt;br /&gt;
===SD Card Does Not Boot===&lt;br /&gt;
Some memory cards do not work on the R-Pi, so check the [[RPi_VerifiedPeripherals#SD_cards|list of known SD cards]].&lt;br /&gt;
&lt;br /&gt;
==Networking==&lt;br /&gt;
&lt;br /&gt;
===Ethernet connection is lost when a USB device is plugged in===&lt;br /&gt;
This is caused by inadequate power. Use a good power supply and a good power cable. Some cheap cables that work with a cell phone, cannot fully power the R-Pi. Some USB devices require a lot of power, so they must be used with a powered USB hub. Some cheap USB hubs suck power from the Raspberry Pi even if a USB power supply is connected.&lt;br /&gt;
&lt;br /&gt;
===Ethernet connects at 10M instead of 100M===&lt;br /&gt;
The LED in the corner of the board labelled &amp;quot;10M&amp;quot; is mislabeled. When that LED is on, the R-Pi is actually connected at 100 Mbps. You can confirm the true transfer rate using a network benchmark such as iperf. You can also read the current network speed with&lt;br /&gt;
  cat /sys/class/net/eth0/speed&lt;br /&gt;
&lt;br /&gt;
==Passwords==&lt;br /&gt;
===I do not know the password to login===&lt;br /&gt;
Please check the page [http://www.raspberrypi.org/downloads http://www.raspberrypi.org/downloads] for the correct username and password for each  image.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Debian from later dates - pi/raspberry&lt;br /&gt;
Debian Feb 17 - pi/suse&lt;br /&gt;
Arch - root/root&lt;br /&gt;
&lt;br /&gt;
===Some programs refuse to accept my password===&lt;br /&gt;
While using Debian, some programs may ask for your password but refuse to accept a valid password.&lt;br /&gt;
&lt;br /&gt;
This is a fault in some Debian images and will be fixed soon. If you are using an image with this fault, enter the following command on the command line.&lt;br /&gt;
 gconftool-2  -\-type bool  -\-set  /apps/gksu/sudo-mode  true&lt;br /&gt;
Please enter this command carefully, the spaces are important. The command should be accepted without any response or errors.&lt;br /&gt;
&lt;br /&gt;
==Sound==&lt;br /&gt;
===Sound does not work with a HDMI monitor===&lt;br /&gt;
This is caused by some computer monitors which select DVI mode even if a HDMI cable is connected.&lt;br /&gt;
&lt;br /&gt;
Edit the configuration file, see the instructions at [[R-Pi_ConfigurationFile]].&lt;br /&gt;
&lt;br /&gt;
Add the following line to the configuration file&lt;br /&gt;
 hdmi_drive=2&lt;br /&gt;
&lt;br /&gt;
===Sound does not work at all, or in some applications===&lt;br /&gt;
The ALSA sound driver is &amp;quot;alpha&amp;quot; and has issues, but some applications do work.  If you are running Debian, try&lt;br /&gt;
&lt;br /&gt;
  cd /opt/vc/src/hello_pi/hello_audio&lt;br /&gt;
  make&lt;br /&gt;
  ./hello_audio.bin&lt;br /&gt;
&lt;br /&gt;
to test analogue output. And&lt;br /&gt;
&lt;br /&gt;
  ./hello_audio.bin 1&lt;br /&gt;
&lt;br /&gt;
to test HDMI.&lt;br /&gt;
&lt;br /&gt;
To test other applications, '''before''' &amp;quot;startx&amp;quot; type&lt;br /&gt;
&lt;br /&gt;
  sudo modprobe snd_bcm2835&lt;br /&gt;
  sudo aplay &amp;lt;name of wav file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By default output will be automatic (hdmi if hdmi supports audio, otherwise analogue). You can force it with:&lt;br /&gt;
&lt;br /&gt;
  sudo amixer cset numid=3 &amp;lt;n&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where n is 0=auto, 1=headphones, 2=hdmi.&lt;br /&gt;
&lt;br /&gt;
==Display==&lt;br /&gt;
===Startx fails to start===&lt;br /&gt;
If you just get errors instead of a desktop when typing&lt;br /&gt;
  startx&lt;br /&gt;
you may be out of storage space on the SD card. By default there are only a few hundred MB free in the 2 GB main partition, which can quickly fill up if you download files. Make sure there is some space free (gparted can expand a partition, if the SD card is &amp;gt; 2GB). Also, installing some software may incorrectly create or modify a .Xauthority file in your home directory, causing startx to fail, according to [http://www.raspberrypi.org/forum/troubleshooting/startx-fails-worked-yesterday this thread]. Temporarily renaming, moving, or deleting that file may fix the problem.&lt;br /&gt;
&lt;br /&gt;
===Video does not play or plays very slowly===&lt;br /&gt;
The only hardware-accelerated video player is the [http://www.raspberrypi.org/forum/general-discussion/openelec-meets-raspberry-pi-part-1-xbmc XMBC distribution] and its command line variant omxplayer. H264 is the only hardware-accelerated codec, for playback. No hardware encoding is supported. Additional codecs were not purchased as licensing fees would have increased the R-Pi's price.&lt;br /&gt;
&lt;br /&gt;
===Can only get 800x480 resolution in LXDE (Arch linux)===&lt;br /&gt;
Known issue with distro package as of 17-Apri-2012 - there's some missing boot config info. Creating a suitable cmdline.txt fixes it - type the following at the Raspberry Pi command line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  sudo echo &amp;quot;dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 root=/dev/mmcblk0p2 rootfstype=ext3 rootwait&amp;quot; &amp;gt;/boot/cmdline.txt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Big black borders around small image on HD monitors===&lt;br /&gt;
&lt;br /&gt;
Out of the box, R-Pi graphics don't necessarily fill the 1080p (ie Full HD) screen. This is due to something called &amp;quot;Underscan&amp;quot;, and it can be fixed easily.&lt;br /&gt;
&lt;br /&gt;
Edit the configuration file, see the instructions at [[R-Pi_ConfigurationFile]].&lt;br /&gt;
&lt;br /&gt;
Add the following lines to the configuration file...&lt;br /&gt;
&lt;br /&gt;
If your display has no overscan:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
disable_overscan=1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or if your display has some overscan:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
overscan_left=-20&lt;br /&gt;
&lt;br /&gt;
overscan_right=-20&lt;br /&gt;
&lt;br /&gt;
overscan_top=-20&lt;br /&gt;
&lt;br /&gt;
overscan_bottom=-20&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Making the R-Pi graphics fill the screen is a matter of experimenting with the numbers you put in the config.txt file. Change the numbers – try jumps of 5 or 10 at a time. Bigger negative numbers reduce the black borders (so -40 means less black border than -20). The numbers do not all have to be the same; you can use this feature to centre the display on the screen.&lt;br /&gt;
&lt;br /&gt;
===Writing spills off the screen on HD monitors===&lt;br /&gt;
&lt;br /&gt;
Out of the box, R-Pi graphics may be larger than the 1080p (ie Full HD) screen. This is due to something called &amp;quot;Overscan&amp;quot;, and it can be fixed easily by creating a simple text file on the R-Pi SD card by using Notepad on your PC.&lt;br /&gt;
&lt;br /&gt;
Follow the instructions in the section &amp;quot;Big black borders around small image on HD monitors&amp;quot;, but use positive numbers for the overscan settings, for example&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
overscan_left=20&lt;br /&gt;
&lt;br /&gt;
overscan_right=20&lt;br /&gt;
&lt;br /&gt;
overscan_top=20&lt;br /&gt;
&lt;br /&gt;
overscan_bottom=20&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Interference visible on a HDMI or DVI monitor===&lt;br /&gt;
This may be caused by loss of signal on long video cables. The signal level may be increased by changing a configuration parameter.&lt;br /&gt;
[[File:RPi_HDMI_interference.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Edit the configuration file, see the instructions at [[R-Pi_ConfigurationFile]].&lt;br /&gt;
&lt;br /&gt;
Add the following line to the configuration file&lt;br /&gt;
 config_hdmi_boost=4&lt;br /&gt;
&lt;br /&gt;
You may experiment with different values of config_hdmi_boost. Value 1 is used for very short cables, value 7 is used for very long cables.&lt;br /&gt;
&lt;br /&gt;
==GPIO==&lt;br /&gt;
Remember that the GPIO pins are 3.3V logic level only, and are &amp;lt;strong&amp;gt;NOT&amp;lt;/strong&amp;gt; 5V tolerant.&lt;br /&gt;
&lt;br /&gt;
If you momentarily shorted the two end GPIO pins together (+3.3V and +5V), or a supply pin to ground, and the Pi appears to be dead, don't panic. The input polyfuse may have tripped. It is self-resetting after it cools down. Disconnect power and wait for 30 minutes, then try to restart.&lt;br /&gt;
&lt;br /&gt;
==General==&lt;br /&gt;
===The time is incorrect===&lt;br /&gt;
If the clock is off by a series of hours, in the command line type:&lt;br /&gt;
 sudo dpkg-reconfigure tzdata&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting power problems==&lt;br /&gt;
If you think you have a problem with your power supply, it is a good idea to check the actual voltage&lt;br /&gt;
on the Raspberry Pi circuit board. Two test points labelled TP1 and TP2 are provided on the circuit board&lt;br /&gt;
to facilitate voltage measurements.&lt;br /&gt;
&lt;br /&gt;
Use a multimeter which is set to the range 20 volts DC (or 20v =). You should see a voltage between 4.75 and 5.25 volts. Anything outside this range indicates that you have a problem with your power supply or your power cable.&lt;br /&gt;
&lt;br /&gt;
If you have not used a multimeter before, see these  [[http://www.sparkfun.com/tutorials/202 basic instructions]]&lt;br /&gt;
&lt;br /&gt;
Note: Even if the multimeter shows the correct voltage, you may have some power supply problems. A multimeter only displays the average voltage. If there are very short-lived dips or spikes in the voltage, these will not be shown by the multimeter. &lt;br /&gt;
&lt;br /&gt;
[[File:RPI_Test_Points.JPG|400px]] [[File:Voltmeter.JPG|250px]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tord</name></author>	</entry>

	<entry>
		<id>http://elinux.org/R-Pi_Troubleshooting</id>
		<title>R-Pi Troubleshooting</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/R-Pi_Troubleshooting"/>
				<updated>2012-05-22T20:52:24Z</updated>
		
		<summary type="html">&lt;p&gt;Tord: /* Keyboard / Mouse / Input Devices */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to the [[R-Pi Hub|Hub]].&lt;br /&gt;
&lt;br /&gt;
[[Category:RaspberryPi]]&lt;br /&gt;
This page lists the most common problems and suggests some solutions.&lt;br /&gt;
&lt;br /&gt;
==Power / Start-up==&lt;br /&gt;
A good power supply that will supply 5V is vital. There is more information about [[RPi_Hardware#Power|power supplies and troubleshooting]].&lt;br /&gt;
===Red power LED does not light, nothing on display===&lt;br /&gt;
The power is not properly connected.&lt;br /&gt;
&lt;br /&gt;
===Red power LED is on, green LED does not flash, nothing on display===&lt;br /&gt;
*The Raspberry Pi cannot find a valid image on the SD card. Check that you have correctly written a Raspberry Pi image to the card. Some SD cards work when cold, but not when warm from use&amp;lt;ref&amp;gt;http://www.raspberrypi.org/phpBB3/viewtopic.php?f=6&amp;amp;t=5900&amp;amp;p=79008#p79008&amp;lt;/ref&amp;gt;. See also, [[RPi_VerifiedPeripherals#SD_cards|Known SD Cards]].&lt;br /&gt;
*The voltage is too low (not 5 V), try a different power supply. See also, [[#Troubleshooting_power_problems|Power Problems]].&lt;br /&gt;
*''(unlikely)'' hardware abuse, for example by connecting a 7 V supply to a 3v3 GPIO output pin&amp;lt;ref&amp;gt;http://www.raspberrypi.org/phpBB3/viewtopic.php?f=6&amp;amp;t=5096&amp;amp;p=76503#p76503&amp;lt;/ref&amp;gt; or powering up the board after a solder splash shorts some traces&amp;lt;ref&amp;gt;http://www.raspberrypi.org/phpBB3/viewtopic.php?f=6&amp;amp;t=5096&amp;amp;p=76654#p76654&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Raspberry Pi shuts down soon after booting up===&lt;br /&gt;
This is caused by a power supply with too low voltage or too high voltage. &lt;br /&gt;
Or it could be the cable. See: [[On_the_RPi_usb_power_cable]]&lt;br /&gt;
&lt;br /&gt;
===Pi boots sometimes but not always===&lt;br /&gt;
With a known good power supply and known good SD card, the R-Pi boots occasionally, but other times shows only a tiny green flicker from the &amp;quot;OK&amp;quot; LED and it fails to start, even with no USB devices and no Ethernet. This has been reported several times&amp;lt;ref&amp;gt;http://www.raspberrypi.org/forum/troubleshooting/will-not-boot-consistently-any-suggestions-before-i-send-my-pi-back&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref&amp;gt;http://www.raspberrypi.org/forum/troubleshooting/booted-once-wont-work-again&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref&amp;gt;http://www.raspberrypi.org/forum/troubleshooting/possible-fault-pi-boots-sometimes-but-not-always&amp;lt;/ref&amp;gt; and remains an open issue. Low voltage or an improper SD card can cause it. Some SD cards will work until they warm up slightly, and then fail&amp;lt;ref&amp;gt;http://www.raspberrypi.org/phpBB3/viewtopic.php?f=6&amp;amp;t=5900&amp;amp;p=79008#p79008&amp;lt;/ref&amp;gt;. When exposed to 21 C room temperature the warmest part of an uncased working R-Pi should be 41 C&amp;lt;ref&amp;gt;http://www.raspberrypi.org/phpBB3/viewtopic.php?f=6&amp;amp;t=5900&amp;amp;p=78973#p78973&amp;lt;/ref&amp;gt;. The wiki has a [[RPi_VerifiedPeripherals#SD_cards | list of working SD cards]]. Buy from a reliable vendor as it has been [http://www.petapixel.com/2011/05/20/one-third-of-the-sandisk-memory-cards-on-earth-are-counterfeit/ claimed] that 1/3 of all &amp;quot;Sandisk&amp;quot; labelled memory cards are counterfeit.&lt;br /&gt;
&lt;br /&gt;
==Keyboard / Mouse / Input Devices==&lt;br /&gt;
===Keyboard randomly repeats key presses===&lt;br /&gt;
This is caused by inadequate power. Use a good power supply and a good power cable. Some cheap cables that work with a cell phone, cannot fully power the R-Pi. Some USB devices require a lot of power: most will have a label showing the voltage and mA requirements. They should be 5v 100mA each max, any more than this they must be used with a powered USB hub. Try unplugging every USB device except the keyboard (you should also note that some keyboards have built in hubs and can try to draw 150mA (Pi can only handle 100mA per USB slot without a hub)).&lt;br /&gt;
Also, use the latest software. Forum user MrEngman [http://www.raspberrypi.org/forum/absolute-beginners/using-a-powered-usb-port-to-power-a-rpi#p76485 reported] some keyboard repeats and wireless hangs until [http://www.raspberrypi.org/downloads upgrading] to the debian6-19-04-2012 kernel, which he reports stable with no problems even with a low [[R-Pi_Troubleshooting#Troubleshooting_power_problems | TP1-TP2 voltage]] of 4.65 - 4.68 volts.&lt;br /&gt;
&lt;br /&gt;
===Keyboard / Mouse interferes with USB WiFi device===&lt;br /&gt;
Connecting a keyboard and/or mouse while a USB WiFi device is connected, may cause one or both devices to malfunction. On April 30 2012, there was a bugfix&amp;lt;ref&amp;gt;https://github.com/raspberrypi/linux/commit/e09244e60881148431ecd016ccc42f1fa0678556&amp;lt;/ref&amp;gt; relating to USB sharing between high-speed (eg. WiFi) and full/low-speed devices (eg. keyboard/mouse). User spennig&amp;lt;ref&amp;gt;http://www.raspberrypi.org/forum/troubleshooting/usb-power-hub-wifi/page-4#p74609&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://www.raspberrypi.org/forum/troubleshooting/success-with-kb-mouse-wifi?value=3761&amp;amp;type=8&amp;amp;include=1&amp;amp;search=1&amp;lt;/ref&amp;gt; reports this patch did not fix the Mouse/WiFi conflict. On 2012-05-12, user spennig was pleased to confirm that wifi was working with a USB keyboard and mouse, as long as the Raspberry Pi had a good PSU and a powered hub. Even so, some experimentation was needed, e.g. USB mouse connected to the device, and the keyboard and mouse connected to the powered hub. Some experimentation may be necessary to find a working combination; however a good power supply is essential.&lt;br /&gt;
&lt;br /&gt;
===Wireless Keyboard trouble===&lt;br /&gt;
Some wireless keyboards, for example the Microsoft Wireless Keyboard 800 are reported to fail&amp;lt;ref&amp;gt;http://www.raspberrypi.org/forum/troubleshooting/display-and-keyboard-issues-on-a-real-pi#p74816&amp;lt;/ref&amp;gt; even though the current drawn by the wireless adaptor is within the R-Pi USB spec limit of 100 mA. This may be a software driver problem.&lt;br /&gt;
&lt;br /&gt;
===Re-mapping the keyboard with Debian Squeeze===&lt;br /&gt;
If different letters appear on-screen from that which you typed, you need to reconfigure you keyboard settings. In Debian, from a command line type:&lt;br /&gt;
 sudo dpkg-reconfigure keyboard-configuration&lt;br /&gt;
Follow the prompts. Then restart your RasPi.&amp;lt;br /&amp;gt;'''Or:'''&amp;lt;br /&amp;gt; From the command line type:&lt;br /&gt;
 sudo nano /etc/default/keyboard&lt;br /&gt;
Then find where it says &amp;lt;blockquote&amp;gt;XKBLAYOUT=”gb”&amp;lt;/blockquote&amp;gt;and change the gb to the two letter code for your country. [http://www.raspberrypi.org/phpBB3/viewtopic.php?p=78325#p78325]&lt;br /&gt;
&lt;br /&gt;
===Slow keyboard mapping=== &lt;br /&gt;
If you get a very long delay during the keyboard mapping at startup, type the following once on the command line after you have logged in:&lt;br /&gt;
 sudo setupcon&lt;br /&gt;
&lt;br /&gt;
==Memory Cards==&lt;br /&gt;
===General / Formatting===&lt;br /&gt;
If you are having problems setting up your memory card you might want to try erasing it completely - especially if it has been used elsewhere and still contains data / partitions. &lt;br /&gt;
* Windows and Mac users can download a formatting tool from the SD Association: https://www.sdcard.org/downloads/formatter_3/&lt;br /&gt;
&lt;br /&gt;
* If you are preparing your SD card on a Linux-based system using the ''dd'' command, this operation will completely erase any existing data and partitions. Make sure you put the source image on the whole card, e.g. /dev/sdd, NOT /dev/sdd1.&lt;br /&gt;
&lt;br /&gt;
===SD Card Does Not Boot===&lt;br /&gt;
Some memory cards do not work on the R-Pi, so check the [[RPi_VerifiedPeripherals#SD_cards|list of known SD cards]].&lt;br /&gt;
&lt;br /&gt;
==Networking==&lt;br /&gt;
&lt;br /&gt;
===Ethernet connection is lost when a USB device is plugged in===&lt;br /&gt;
This is caused by inadequate power. Use a good power supply and a good power cable. Some cheap cables that work with a cell phone, cannot fully power the R-Pi. Some USB devices require a lot of power, so they must be used with a powered USB hub. Some cheap USB hubs suck power from the Raspberry Pi even if a USB power supply is connected.&lt;br /&gt;
&lt;br /&gt;
===Ethernet connects at 10M instead of 100M===&lt;br /&gt;
The LED in the corner of the board labelled &amp;quot;10M&amp;quot; is mislabeled. When that LED is on, the R-Pi is actually connected at 100 Mbps. You can confirm the true transfer rate using a network benchmark such as iperf. You can also read the current network speed with&lt;br /&gt;
  cat /sys/class/net/eth0/speed&lt;br /&gt;
&lt;br /&gt;
==Passwords==&lt;br /&gt;
===I do not know the password to login===&lt;br /&gt;
Please check the page [http://www.raspberrypi.org/downloads http://www.raspberrypi.org/downloads] for the correct username and password for each  image.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Debian from later dates - pi/raspberry&lt;br /&gt;
Debian Feb 17 - pi/suse&lt;br /&gt;
Arch - root/root&lt;br /&gt;
&lt;br /&gt;
===Some programs refuse to accept my password===&lt;br /&gt;
While using Debian, some programs may ask for your password but refuse to accept a valid password.&lt;br /&gt;
&lt;br /&gt;
This is a fault in some Debian images and will be fixed soon. If you are using an image with this fault, enter the following command on the command line.&lt;br /&gt;
 gconftool-2  -\-type bool  -\-set  /apps/gksu/sudo-mode  true&lt;br /&gt;
Please enter this command carefully, the spaces are important. The command should be accepted without any response or errors.&lt;br /&gt;
&lt;br /&gt;
==Sound==&lt;br /&gt;
===Sound does not work with a HDMI monitor===&lt;br /&gt;
This is caused by some computer monitors which select DVI mode even if a HDMI cable is connected.&lt;br /&gt;
&lt;br /&gt;
Edit the configuration file, see the instructions at [[R-Pi_ConfigurationFile]].&lt;br /&gt;
&lt;br /&gt;
Add the following line to the configuration file&lt;br /&gt;
 hdmi_drive=2&lt;br /&gt;
&lt;br /&gt;
===Sound does not work at all, or in some applications===&lt;br /&gt;
The ALSA sound driver is &amp;quot;alpha&amp;quot; and has issues, but some applications do work.  If you are running Debian, try&lt;br /&gt;
&lt;br /&gt;
  cd /opt/vc/src/hello_pi/hello_audio&lt;br /&gt;
  make&lt;br /&gt;
  ./hello_audio.bin&lt;br /&gt;
&lt;br /&gt;
to test analogue output. And&lt;br /&gt;
&lt;br /&gt;
  ./hello_audio.bin 1&lt;br /&gt;
&lt;br /&gt;
to test HDMI.&lt;br /&gt;
&lt;br /&gt;
To test other applications, '''before''' &amp;quot;startx&amp;quot; type&lt;br /&gt;
&lt;br /&gt;
  sudo modprobe snd_bcm2835&lt;br /&gt;
  sudo aplay &amp;lt;name of wav file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By default output will be automatic (hdmi if hdmi supports audio, otherwise analogue). You can force it with:&lt;br /&gt;
&lt;br /&gt;
  sudo amixer cset numid=3 &amp;lt;n&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where n is 0=auto, 1=headphones, 2=hdmi.&lt;br /&gt;
&lt;br /&gt;
==Display==&lt;br /&gt;
===Startx fails to start===&lt;br /&gt;
If you just get errors instead of a desktop when typing&lt;br /&gt;
  startx&lt;br /&gt;
you may be out of storage space on the SD card. By default there are only a few hundred MB free in the 2 GB main partition, which can quickly fill up if you download files. Make sure there is some space free (gparted can expand a partition, if the SD card is &amp;gt; 2GB). Also, installing some software may incorrectly create or modify a .Xauthority file in your home directory, causing startx to fail, according to [http://www.raspberrypi.org/forum/troubleshooting/startx-fails-worked-yesterday this thread]. Temporarily renaming, moving, or deleting that file may fix the problem.&lt;br /&gt;
&lt;br /&gt;
===Video does not play or plays very slowly===&lt;br /&gt;
The only hardware-accelerated video player is the [http://www.raspberrypi.org/forum/general-discussion/openelec-meets-raspberry-pi-part-1-xbmc XMBC distribution] and its command line variant omxplayer. H264 is the only hardware-accelerated codec, for playback. No hardware encoding is supported. Additional codecs were not purchased as licensing fees would have increased the R-Pi's price.&lt;br /&gt;
&lt;br /&gt;
===Can only get 800x480 resolution in LXDE (Arch linux)===&lt;br /&gt;
Known issue with distro package as of 17-Apri-2012 - there's some missing boot config info. Creating a suitable cmdline.txt fixes it - type the following at the Raspberry Pi command line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  sudo echo &amp;quot;dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 root=/dev/mmcblk0p2 rootfstype=ext3 rootwait&amp;quot; &amp;gt;/boot/cmdline.txt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Big black borders around small image on HD monitors===&lt;br /&gt;
&lt;br /&gt;
Out of the box, R-Pi graphics don't necessarily fill the 1080p (ie Full HD) screen. This is due to something called &amp;quot;Underscan&amp;quot;, and it can be fixed easily.&lt;br /&gt;
&lt;br /&gt;
Edit the configuration file, see the instructions at [[R-Pi_ConfigurationFile]].&lt;br /&gt;
&lt;br /&gt;
Add the following lines to the configuration file...&lt;br /&gt;
&lt;br /&gt;
If your display has no overscan:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
disable_overscan=1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or if your display has some overscan:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
overscan_left=-20&lt;br /&gt;
&lt;br /&gt;
overscan_right=-20&lt;br /&gt;
&lt;br /&gt;
overscan_top=-20&lt;br /&gt;
&lt;br /&gt;
overscan_bottom=-20&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Making the R-Pi graphics fill the screen is a matter of experimenting with the numbers you put in the config.txt file. Change the numbers – try jumps of 5 or 10 at a time. Bigger negative numbers reduce the black borders (so -40 means less black border than -20). The numbers do not all have to be the same; you can use this feature to centre the display on the screen.&lt;br /&gt;
&lt;br /&gt;
===Writing spills off the screen on HD monitors===&lt;br /&gt;
&lt;br /&gt;
Out of the box, R-Pi graphics may be larger than the 1080p (ie Full HD) screen. This is due to something called &amp;quot;Overscan&amp;quot;, and it can be fixed easily by creating a simple text file on the R-Pi SD card by using Notepad on your PC.&lt;br /&gt;
&lt;br /&gt;
Follow the instructions in the section &amp;quot;Big black borders around small image on HD monitors&amp;quot;, but use positive numbers for the overscan settings, for example&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
overscan_left=20&lt;br /&gt;
&lt;br /&gt;
overscan_right=20&lt;br /&gt;
&lt;br /&gt;
overscan_top=20&lt;br /&gt;
&lt;br /&gt;
overscan_bottom=20&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Interference visible on a HDMI or DVI monitor===&lt;br /&gt;
This may be caused by loss of signal on long video cables. The signal level may be increased by changing a configuration parameter.&lt;br /&gt;
[[File:RPi_HDMI_interference.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Edit the configuration file, see the instructions at [[R-Pi_ConfigurationFile]].&lt;br /&gt;
&lt;br /&gt;
Add the following line to the configuration file&lt;br /&gt;
 config_hdmi_boost=4&lt;br /&gt;
&lt;br /&gt;
You may experiment with different values of config_hdmi_boost. Value 1 is used for very short cables, value 7 is used for very long cables.&lt;br /&gt;
&lt;br /&gt;
==GPIO==&lt;br /&gt;
Remember that the GPIO pins are 3.3V logic level only, and are &amp;lt;strong&amp;gt;NOT&amp;lt;/strong&amp;gt; 5V tolerant.&lt;br /&gt;
&lt;br /&gt;
If you momentarily shorted the two end GPIO pins together (+3.3V and +5V), or a supply pin to ground, and the Pi appears to be dead, don't panic. The input polyfuse may have tripped. It is self-resetting after it cools down. Disconnect power and wait for 30 minutes, then try to restart.&lt;br /&gt;
&lt;br /&gt;
==General==&lt;br /&gt;
===The time is incorrect===&lt;br /&gt;
If the clock is off by a series of hours, in the command line type:&lt;br /&gt;
 sudo dpkg-reconfigure tzdata&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting power problems==&lt;br /&gt;
If you think you have a problem with your power supply, it is a good idea to check the actual voltage&lt;br /&gt;
on the Raspberry Pi circuit board. Two test points labelled TP1 and TP2 are provided on the circuit board&lt;br /&gt;
to facilitate voltage measurements.&lt;br /&gt;
&lt;br /&gt;
Use a multimeter which is set to the range 20 volts DC (or 20v =). You should see a voltage between 4.75 and 5.25 volts. Anything outside this range indicates that you have a problem with your power supply or your power cable.&lt;br /&gt;
&lt;br /&gt;
If you have not used a multimeter before, see these  [[http://www.sparkfun.com/tutorials/202 basic instructions]]&lt;br /&gt;
&lt;br /&gt;
Note: Even if the multimeter shows the correct voltage, you may have some power supply problems. A multimeter only displays the average voltage. If there are very short-lived dips or spikes in the voltage, these will not be shown by the multimeter. &lt;br /&gt;
&lt;br /&gt;
[[File:RPI_Test_Points.JPG|400px]] [[File:Voltmeter.JPG|250px]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tord</name></author>	</entry>

	<entry>
		<id>http://elinux.org/RPi_Serial_Connection</id>
		<title>RPi Serial Connection</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/RPi_Serial_Connection"/>
				<updated>2012-05-19T19:34:07Z</updated>
		
		<summary type="html">&lt;p&gt;Tord: /* Serial Parameters */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[RPi Advanced Setup]].&lt;br /&gt;
&lt;br /&gt;
The Serial Port is a low-level way  to connect to the Raspberry Pi.&lt;br /&gt;
The communication depends on byte wise data transmission and is generally available even before boot time.&lt;br /&gt;
&lt;br /&gt;
==First interaction with the board==&lt;br /&gt;
&lt;br /&gt;
'''Note that the Raspberry has no PREBUILT COM port.  Soldering/protoyping and technical knowledge is required ! ''' &lt;br /&gt;
&lt;br /&gt;
(It's on the [[RPi_Low-level_peripherals|GPIOs]] but you need a board or cable to convert 3.3V UART signals to RS-232 or USB).&lt;br /&gt;
&lt;br /&gt;
Connect the serial cable to your COM circuitry , and connect the other end to the COM port or USB Serial Adapter in the computer.&lt;br /&gt;
&lt;br /&gt;
(Place link to HowTo here)&lt;br /&gt;
&lt;br /&gt;
You may also use a USB to Serial Adaptor as second option.&lt;br /&gt;
&lt;br /&gt;
What about USB debugging (KBD) ?&lt;br /&gt;
&lt;br /&gt;
==Serial Parameters==&lt;br /&gt;
The following parameters are needed to connect to the Raspberry. All parameters except '''Port_Name''' and '''Speed''' are default values and may not need to be set.&lt;br /&gt;
* '''Port_Name''': Linux automatically assigns different names for different types of serial connectors. Choose your option:&lt;br /&gt;
** Standard Serial Port: ttyS0 ... ttySn&lt;br /&gt;
** USB Serial Port Adapter: ttyUSB0 ... ttyUSBn&lt;br /&gt;
* '''Speed''': 115200&lt;br /&gt;
* Bits: 8&lt;br /&gt;
* Parity: None&lt;br /&gt;
* Stop Bits: 1&lt;br /&gt;
* Flow Control: None&lt;br /&gt;
&lt;br /&gt;
The Serial Port is generally usable by the users in the group '''dialout'''. To add oneself to the group '''dialout''' the the following command needs to be executed with '''root''' privileges:&lt;br /&gt;
  $useradd -G {dialout} your_name &lt;br /&gt;
&lt;br /&gt;
* '''Super Easy Way Using GNU Screen'''&lt;br /&gt;
&lt;br /&gt;
Enter the command below into a terminal window&lt;br /&gt;
  screen Port_Name 115200&lt;br /&gt;
&lt;br /&gt;
* '''Super Easy Way Using Minicom'''&lt;br /&gt;
&lt;br /&gt;
Run minicom with the following parameters:&lt;br /&gt;
&lt;br /&gt;
 minicom -b 115200 -o -D Port_Name&lt;br /&gt;
&lt;br /&gt;
* '''Tedious Old-Fashioned Way Using Minicom'''&lt;br /&gt;
&lt;br /&gt;
Another method to setup ''minicom'' is described in the [http://www.tincantools.com/wiki/Minicom Tincantools Minicom Tutorial]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''GUI method with GtkTerm'''&lt;br /&gt;
&lt;br /&gt;
Start ''GtkTerm'', select Configuration-&amp;gt;Port and enter the values above in the labeled fields.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Windows Users'''&lt;br /&gt;
&lt;br /&gt;
Windows Users above Windows XP must download [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html putty], [http://en.wikipedia.org/wiki/Tera_Term TeraTerm] or a comparable terminal program.&lt;br /&gt;
Users of XP and below can choose between using ''putty'' and ''Hyperterminal.''&lt;br /&gt;
&lt;br /&gt;
==First Dialog==&lt;br /&gt;
If you get the prompt below, you are connected to the Raspberry Pi shell!&lt;br /&gt;
  prompt&amp;gt; #&lt;br /&gt;
&lt;br /&gt;
First command you might want try is &amp;quot;help&amp;quot;:&lt;br /&gt;
  prompt&amp;gt; # help&lt;br /&gt;
&lt;br /&gt;
If you get some output, you are correctly connected to the Raspberry Pi! Congratulations!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Template:Raspberry Pi}}&lt;/div&gt;</summary>
		<author><name>Tord</name></author>	</entry>

	<entry>
		<id>http://elinux.org/RPi_Beginners</id>
		<title>RPi Beginners</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/RPi_Beginners"/>
				<updated>2012-05-19T19:23:38Z</updated>
		
		<summary type="html">&lt;p&gt;Tord: /* Keyboard Mapping */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:RaspberryPi]]&lt;br /&gt;
{{Template:RPi_Startup}}&lt;br /&gt;
&lt;br /&gt;
''' INFO : If you are looking for any information related to SD Cards and setup look &lt;br /&gt;
[[RPi Easy SD Card Setup | here]]  There is some restructuring going on , we are sorry for the inconvenience. '''&lt;br /&gt;
&lt;br /&gt;
=About This Page - For Contributors=&lt;br /&gt;
The intention of this page is to provide a '''starting point''' for beginners and to '''direct them to''' the kind of information a person would need in order to start doing something useful or interesting with a Raspberry Pi.&lt;br /&gt;
&lt;br /&gt;
It is not intended to contain or replicate much of the information already available on-line or elsewhere in the wiki, however please create new wiki pages and link them here if there is information beginners will find useful (similarly any section which grows too much here, should be separated into new pages as and when needed)!&lt;br /&gt;
&lt;br /&gt;
 At the moment building up ideas of content of typical things beginners will want to know and the kind of things they will want to do first.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Where to start?=&lt;br /&gt;
Any easy question to ask, but a very difficult one to answer!&lt;br /&gt;
# If you need to get a RPi, the see the [[RPi Buying Guide|Buying Guide]].&lt;br /&gt;
# If you need to know what equipment you will need and how to set it up, see the [[RPi Hardware Basic Setup|Basic Hardware Setup]] page.&lt;br /&gt;
# If you need to install/setup an SD card see the [[RPi Easy SD Card Setup|Preload your Card]] section.&lt;br /&gt;
# If something is not working, check the [[R-Pi_Troubleshooting|Troubleshooting]] section.&lt;br /&gt;
# If you need help with Debian, try the [http://wiki.debian.org/FrontPage Debian Wiki].&lt;br /&gt;
# If you've done all that, and you are wondering what next...'''welcome and read on!'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 References needed (idea for new section Living Without RPi, which can guide users or link to info to users who haven't got RPis)&lt;br /&gt;
      Link to emulation builds or live linux cds setup for beginners (RacyPy2 for example)&lt;br /&gt;
If you don't have a Raspberry Pi yet, you can still try things out, see xxxx for details.&lt;br /&gt;
&lt;br /&gt;
=What is Linux and why not use Windows?=&lt;br /&gt;
Linux is an operating system just like Windows, however, unlike Windows (which needs a set hardware requirement to run i.e. One Size fits or get different hardware), Linux comes in many varieties and configurations which means you can usually find a flavour (or Distribution) which fits your hardware big or small / fast or slow.&lt;br /&gt;
&lt;br /&gt;
The Raspberry Pi is not suited to running Windows due to its hardware, but there are plenty of Linux Distributions which fit nicely.  In addition to this, most Distributions of Linux are free, however Windows can cost many times the price of the Raspberry Pi itself.&lt;br /&gt;
&lt;br /&gt;
Chances are you already have Linux running in your home without you even knowing it, since it is commonly used in modern TVs, Freeview and cable boxes to run things and ensure your recording of '''Inbetweeners''' or '''Prison Break''' gets done!&lt;br /&gt;
&lt;br /&gt;
For more information about Linux see &lt;br /&gt;
[http://en.wikipedia.org/wiki/Linux Wikipedia]&lt;br /&gt;
&lt;br /&gt;
Also see [http://elinux.org/RPi_End-user_FAQ End-User FAQ]&lt;br /&gt;
And [http://elinux.org/Will_RPi_Run Running XXX on the RPi]&lt;br /&gt;
&lt;br /&gt;
=Basic Debian RPi Setup=&lt;br /&gt;
When you first turn on your Raspberry Pi with it's fresh Debian image on the SD card, you may have to make some minor adjustments to the OS configuration files to suit your location. The default location setting (locale) is the UK. &lt;br /&gt;
&lt;br /&gt;
You can alter this with &lt;br /&gt;
    &lt;br /&gt;
    sudo dpkg-reconfigure locales&lt;br /&gt;
&lt;br /&gt;
There are quite a lot of options - many people will want to use the UTF-8 variant for their locale. This will also allow you to set anomalous cases&lt;br /&gt;
like English keyboard but Danish locale.&lt;br /&gt;
&lt;br /&gt;
Selecting All locales will generate all possible locales, take a very long time and use a great deal of space. Generate only those you wish to use.&lt;br /&gt;
&lt;br /&gt;
The command above will open a list which begins&lt;br /&gt;
&lt;br /&gt;
aa_DJ [Ambala, for Djibouti] ISO-8059-1 and goes down to zu_._UTF8 UTF-81 [Zulu for S. Africa]&lt;br /&gt;
&lt;br /&gt;
You have various options for each language - UTF-8 is probably the most useful worldwide - Unicode characters.&lt;br /&gt;
&lt;br /&gt;
Scroll down using a down arrow key, toggle with a space bar to select.&lt;br /&gt;
&lt;br /&gt;
==Keyboard Mapping==&lt;br /&gt;
&lt;br /&gt;
If different letters appear on-screen from that which you typed, you need to reconfigure you keyboard settings. In Debian, from a command line type:&lt;br /&gt;
 sudo dpkg-reconfigure keyboard-configuration&lt;br /&gt;
Follow the prompts. Then restart your RasPi.&amp;lt;br /&amp;gt;'''Or:'''&amp;lt;br /&amp;gt; From the command line type:&lt;br /&gt;
 sudo nano /etc/default/keyboard&lt;br /&gt;
Then find where it says &amp;lt;blockquote&amp;gt;XKBLAYOUT=”gb”&amp;lt;/blockquote&amp;gt;and change the gb to the two letter code for your country. [http://www.raspberrypi.org/phpBB3/viewtopic.php?p=78325#p78325]&lt;br /&gt;
&lt;br /&gt;
Also, see the [[R-Pi_Troubleshooting#Re-mapping_the_keyboard_with_Debian_Squeeze|Troubleshooting Guide]] for more information about remapping the keyboard.&lt;br /&gt;
&lt;br /&gt;
Changes will certainly be picked up at the next restart.&lt;br /&gt;
&lt;br /&gt;
If you get a very long delay during the keyboard mapping at startup, type the following once on the command line after you have logged in:&lt;br /&gt;
 sudo setupcon&lt;br /&gt;
&lt;br /&gt;
==Change the root Password==&lt;br /&gt;
&lt;br /&gt;
Type in following command in the Terminal to change the root Password:&lt;br /&gt;
 sudo passwd root&lt;br /&gt;
Then follow the Steps.&lt;br /&gt;
&lt;br /&gt;
==Create a new User and add it to the sudoers list==&lt;br /&gt;
&lt;br /&gt;
Type in following command in the Terminal to create a new user:&lt;br /&gt;
 adduser username&lt;br /&gt;
Follow the Steps. After creating the new User you must get root Access with the following Command:&lt;br /&gt;
 su&lt;br /&gt;
Now you can add your user to the sudoers list:&lt;br /&gt;
 visudo&lt;br /&gt;
Add following Line under the &amp;quot;root ALL=(ALL) ALL&amp;quot; Line:&lt;br /&gt;
 yourUsername ALL=(ALL) ALL&lt;br /&gt;
Now press CTRL+X&lt;br /&gt;
&lt;br /&gt;
==Change the Timezone==&lt;br /&gt;
Unless you live in Great Britain, you'll have to change the default timezone. Use &amp;quot;sudo&amp;quot; to obtain temporary execute permissions.&lt;br /&gt;
    sudo dpkg-reconfigure tzdata&lt;br /&gt;
&lt;br /&gt;
Select geographic area - Europe, America or whatever. Etc gives UNIX compatible time zones including CUT, GMT, UTC&lt;br /&gt;
&lt;br /&gt;
Select city&lt;br /&gt;
&lt;br /&gt;
Follow the prompts to finish the config. The change should be immediate.&lt;br /&gt;
&lt;br /&gt;
=Intro to the CLI (Command Line Interface)=&lt;br /&gt;
You will need to use the Command Line Interface at some point in your management of the RPi. The command line interface is a powerful way to interact with the Raspberry Pi and is well worth learning some basic commands to get started with.&lt;br /&gt;
&lt;br /&gt;
For an introductory guide to some basic commands please see: [http://elinux.org/CLI_Spells Command Line Interface &amp;quot;Must Have&amp;quot; Commands]&lt;br /&gt;
&lt;br /&gt;
=Adding more software to your Raspberry Pi=&lt;br /&gt;
You will probably want to add software to your Raspberry Pi. Here you can find out how to do it.&lt;br /&gt;
[http://elinux.org/Add_software Adding Software]&lt;br /&gt;
&lt;br /&gt;
=Adding USB Storage to Your Raspberry Pi=&lt;br /&gt;
Sooner or later, you're going to run out of room on the SD card used to boot up your Raspberry Pi.  For a tutorial on how to connect USB flash drives and hard drives to your Pi to expand storage, see: [http://elinux.org/Adding_USB_Drives_to_a_Raspberry_Pi Adding USB Drives to a Raspberry Pi]&lt;br /&gt;
&lt;br /&gt;
=Beginner Projects=&lt;br /&gt;
Here are a few things you can try out with your Raspberry Pi, in most cases all you'll need is your SD Card loaded with a particular preconfigured OS Distribution.&lt;br /&gt;
&lt;br /&gt;
It will be worth getting a few spare SD Cards if you think you will switch between setups regularly or become familiar with how to '''back up and restore''' your card.&lt;br /&gt;
 Reference needed - a good guide on how to backup and restore cards or software to do this easily&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Media Player==&lt;br /&gt;
With this configuration you will typically have the Raspberry Pi connected to a TV or large monitor and a source of videos/music/photos etc you wish to play (i.e. Internet/hard-drive/local network etc).&lt;br /&gt;
&lt;br /&gt;
DesignSpark have done a article on this, which is worth a look, [http://www.designspark.com/content/raspberry-pi-goes-movies DesignSpark - Raspberry Pi goes to the movies]&lt;br /&gt;
&lt;br /&gt;
 Reference needed - links to a specific wiki page covering this in detail or links to projects like&lt;br /&gt;
                     OpenElec, CrystalBuntu, Raspbmc etc&lt;br /&gt;
&lt;br /&gt;
==Play Games==&lt;br /&gt;
While there are not any commercial games for the Raspberry Pi (yet) there are plenty ways to play games on it.&lt;br /&gt;
&lt;br /&gt;
Many distributions will have games built into them, and some may well support emulation of other platforms so you can run those games.&lt;br /&gt;
&lt;br /&gt;
Also, a lot of Raspberry Pi users will be writing simple games which will be available for others to enjoy (and if desired added to or modified).&lt;br /&gt;
&lt;br /&gt;
 Reference needed - game section is empty at the moment!&lt;br /&gt;
''See the [[RPi Games|Games Section]] for more details''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introducing Young Children To Computers==&lt;br /&gt;
 Reference needed - some kid friendly and fun stuff!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Teaching==&lt;br /&gt;
There is a huge number of groups, links and resources available within the [[RPi Education|Education]] section.&lt;br /&gt;
 Reference needed - links to the learning pages, education links and school/university groups&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Learn To Program==&lt;br /&gt;
There is a huge selection of [[RPi Programming|programming languages]] which you can use to write interesting programs, games, applications and utilities.  There are also more great links within the [[RPi Education#Programming languages|Education]] section.&lt;br /&gt;
&lt;br /&gt;
There is a huge selection to choose from (not just Python...) which should suit any ability and a range of purposes.&lt;br /&gt;
&lt;br /&gt;
If you are new to programming, there are plenty of tutorials for getting started in the [[RPi Tutorials|Tutorials]] Section.&lt;br /&gt;
 &lt;br /&gt;
Books about programming can be found in the [[RPi Programming Books|Books]] Section.&lt;br /&gt;
&lt;br /&gt;
In the latest Debian, Python (+Pygame) and MIT Scratch are pre-installed.&lt;br /&gt;
&lt;br /&gt;
 Reference needed - links to the learning pages, recommended books?&lt;br /&gt;
&lt;br /&gt;
==Interface With Hardware==&lt;br /&gt;
# [[RPi Interfacing with hardware|Interfacing with Arduino]]&lt;br /&gt;
 &lt;br /&gt;
 Reference needed - links to basic circuits tutorials and expansion boards&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Word Processing/Internet Browsing etc==&lt;br /&gt;
Yes, the Raspberry Pi can do the majority of the dull stuff too which other computers do.&lt;br /&gt;
&lt;br /&gt;
'''Debian''' currently comes with Midori installed for web browsing and word processing programs be installed rather easily.&lt;br /&gt;
&lt;br /&gt;
*Entering &amp;quot;sudo apt-get install openoffice.org&amp;quot; into a terminal will install OpenOffice.org, a free Microsoft Office-like application suite&lt;br /&gt;
*Entering &amp;quot;sudo apt-get install abiword-common&amp;quot; into a terminal will install AbiWord, a lighter weight but still fully functional word processor&lt;br /&gt;
&lt;br /&gt;
  More information needed&lt;br /&gt;
&lt;br /&gt;
==Your Own Pet Project!==&lt;br /&gt;
The sky is the limit really, with some time and effort any number of projects can be achieved.&lt;br /&gt;
&lt;br /&gt;
Even if you don't have the skill to do it yourself, you can join like minded people by getting involved with one of the numerous groups in the [[RPi Community|Community Section]], also within the [[RPi Education|Education]] pages or learn what you need in from the [[RPi Guides |Guides]] &amp;amp; [[RPi Tutorials |Tutorials]] sections.&lt;br /&gt;
&lt;br /&gt;
Of course, if you do anything interesting then please let us know in the [[RPi Projects |Projects]] section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Living Without RPi=&lt;br /&gt;
Even if you do not have any Raspberry Pi hardware there are a number things you can do to learn about linux, programming or even controlling hardware.&lt;br /&gt;
&lt;br /&gt;
==Using Linux==&lt;br /&gt;
You can install a version of Linux on most computers, and many you will be able to &amp;quot;try out&amp;quot; Linux by using a &amp;quot;Live CD&amp;quot; - this will start your computer up running from a CD or DVD and run Linux (without installing anything to the computer itself).&lt;br /&gt;
&lt;br /&gt;
RacyPy - This is a simple LiveCD of Puppy Linux which includes some basic programming languages and a light-weight graphical user interface (GUI).&lt;br /&gt;
&lt;br /&gt;
You can get it from here:&lt;br /&gt;
&lt;br /&gt;
[http://teampython.wordpress.com/2012/03/03/while-you-wait-for-your-raspberry-pi-why-not-use-racypy2/ teampython RacyPy]&lt;br /&gt;
&lt;br /&gt;
==Trying Programming==&lt;br /&gt;
Many of the programming languages you can use on the Raspberry Pi can be installed on a Windows or Mac machine.  Just visit the websites of the languages you are interested in and see if they have an installer for your operating system.&lt;br /&gt;
&lt;br /&gt;
==Controlling Hardware==&lt;br /&gt;
As discussed in the [[RPi Tutorial Easy GPIO Hardware &amp;amp; Software | Easy GPIO Hardware &amp;amp; Software]] tutorials, there are lots of alternative hardware you can use to experiment with (some as little as $5).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
{{Template:Raspberry Pi}}&lt;/div&gt;</summary>
		<author><name>Tord</name></author>	</entry>

	<entry>
		<id>http://elinux.org/GDB</id>
		<title>GDB</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/GDB"/>
				<updated>2011-10-27T23:44:22Z</updated>
		
		<summary type="html">&lt;p&gt;Tord: /* Starting application debug from host */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The GNU Debugger GDB is the most common debug tool for Linux. It features most used features one can think of, including server-client debug architecture (so you run the heavy debug part on your host/pc machine), but lack some bits as checkpoint-restart during execution.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
&lt;br /&gt;
GDB ships with extensive documentation at http://www.gnu.org/software/gdb/documentation/, but there are some good [http://refcards.com/docs/peschr/gdb/gdb-refcard-a4.pdf quick reference cards] as well.&lt;br /&gt;
&lt;br /&gt;
== Basic Usage ==&lt;br /&gt;
&lt;br /&gt;
Documentation is so large that sometimes its hard to get started, so most simple tasks can be done with the following commands, but please read GDB docs as soon as possible!&lt;br /&gt;
&lt;br /&gt;
=== Debug version ===&lt;br /&gt;
==== Debug packages ====&lt;br /&gt;
First note that in order to use GDB in an efficient way,you need the debug packages,that is to say the -dbg version of your package.&lt;br /&gt;
Under the opkg package management if you installed a binary like that:&lt;br /&gt;
 opkg install binary&lt;br /&gt;
you need to install the debug part of it:&lt;br /&gt;
 opkg install binary-dbg&lt;br /&gt;
&lt;br /&gt;
Without debug packages you will be limited to assembly debugging(no source level debugging)&lt;br /&gt;
&lt;br /&gt;
Here are some example of how usefull is debug symbols:&lt;br /&gt;
&lt;br /&gt;
Without debug symbols:&lt;br /&gt;
 DISPLAY=:0.0 gdbserver 10.10.10.10:8090 matchbox-desktop #target&lt;br /&gt;
 &lt;br /&gt;
 gnutoo@gnutoo-desktop:~/embedded/arm-2010q1/bin$ ./arm-none-linux-gnueabi-gdb&lt;br /&gt;
 GNU gdb (Sourcery G++ Lite 2010q1-202) 7.0.50.20100218-cvs&lt;br /&gt;
 Copyright (C) 2010 Free Software Foundation, Inc.&lt;br /&gt;
 License GPLv3+: GNU GPL version 3 or later &amp;lt;http://gnu.org/licenses/gpl.html&amp;gt;&lt;br /&gt;
 This is free software: you are free to change and redistribute it.&lt;br /&gt;
 There is NO WARRANTY, to the extent permitted by law.  Type &amp;quot;show copying&amp;quot;&lt;br /&gt;
 and &amp;quot;show warranty&amp;quot; for details.&lt;br /&gt;
 This GDB was configured as &amp;quot;--host=i686-pc-linux-gnu --target=arm-none-linux-gnueabi&amp;quot;.&lt;br /&gt;
 For bug reporting instructions, please see:&lt;br /&gt;
 &amp;lt;https://support.codesourcery.com/GNUToolchain/&amp;gt;.&lt;br /&gt;
 (gdb) target remote 10.10.10.10:8090&lt;br /&gt;
 Remote debugging using 10.10.10.10:8090&lt;br /&gt;
 0x400007e0 in ?? ()&lt;br /&gt;
 (gdb) c&lt;br /&gt;
 Continuing.&lt;br /&gt;
 Cannot access memory at address 0x0&lt;br /&gt;
 Program received signal SIGSEGV, Segmentation fault.&lt;br /&gt;
 0x403e1254 in ?? ()&lt;br /&gt;
 (gdb) bt&lt;br /&gt;
 #0  0x403e1254 in ?? ()&lt;br /&gt;
 Cannot access memory at address 0x302e3032&lt;br /&gt;
With debugggin symbols:&lt;br /&gt;
 opkg install matchbox-desktop-dbg&lt;br /&gt;
                 ...&lt;br /&gt;
 DISPLAY=:0.0 gdbserver 10.10.10.10:8090 matchbox-desktop #target&lt;br /&gt;
 root@gnutoo-desktop:/home/gnutoo/embedded/arm-2010q1/bin# ./arm-none-linux-gnueabi-gdb&lt;br /&gt;
 GNU gdb (Sourcery G++ Lite 2010q1-202) 7.0.50.20100218-cvs&lt;br /&gt;
 Copyright (C) 2010 Free Software Foundation, Inc.&lt;br /&gt;
 License GPLv3+: GNU GPL version 3 or later &amp;lt;http://gnu.org/licenses/gpl.html&amp;gt;&lt;br /&gt;
 This is free software: you are free to change and redistribute it.&lt;br /&gt;
 There is NO WARRANTY, to the extent permitted by law.  Type &amp;quot;show copying&amp;quot;&lt;br /&gt;
 and &amp;quot;show warranty&amp;quot; for details.&lt;br /&gt;
 This GDB was configured as &amp;quot;--host=i686-pc-linux-gnu --target=arm-none-linux-gnueabi&amp;quot;.&lt;br /&gt;
 For bug reporting instructions, please see:&lt;br /&gt;
 &amp;lt;https://support.codesourcery.com/GNUToolchain/&amp;gt;.&lt;br /&gt;
 (gdb) set sysroot /mnt/target/&lt;br /&gt;
 (gdb) file /mnt/target/usr/bin/matchbox-desktop&lt;br /&gt;
 Reading symbols from /mnt/target/usr/bin/matchbox-desktop...Reading symbols from /mnt/target/usr/bin/.debug/matchbox-desktop...done.&lt;br /&gt;
 done.&lt;br /&gt;
 (gdb) target remote 10.10.10.10:8090&lt;br /&gt;
 Remote debugging using 10.10.10.10:8090&lt;br /&gt;
 Reading symbols from /mnt/target/lib/ld-linux.so.3...Reading symbols from /mnt/target/lib/.debug/ld-2.9.so...done.&lt;br /&gt;
 done.&lt;br /&gt;
 Loaded symbols for /mnt/target/lib/ld-linux.so.3 &lt;br /&gt;
 0x400007e0 in _start () from /mnt/target/lib/ld-linux.so.3&lt;br /&gt;
 (gdb) c&lt;br /&gt;
 Continuing. &lt;br /&gt;
 Program received signal SIGSEGV, Segmentation fault.&lt;br /&gt;
 0x403e1254 in strlen () from /mnt/target/lib/libc.so.6&lt;br /&gt;
 (gdb) bt&lt;br /&gt;
 #0  0x403e1254 in strlen () from /mnt/target/lib/libc.so.6&lt;br /&gt;
 #1  0x4003350c in mb_pixbuf_img_new_from_file (pb=0x1fd58, filename=0x0) at mbpixbuf.c:1352&lt;br /&gt;
 #2  0x0000c8fc in mbdesktop_set_scroll_buttons (mb=0x1b008) at mbdesktop.c:689&lt;br /&gt;
 #3  0x0000d334 in mbdesktop_init (argc=&amp;lt;value optimized out&amp;gt;, argv=&amp;lt;value optimized out&amp;gt;) at mbdesktop.c:1022&lt;br /&gt;
 #4  0x0000e024 in main (argc=0, argv=0x0) at mbdesktop.c:1793&lt;br /&gt;
&lt;br /&gt;
Note that we have lines that looks like:&lt;br /&gt;
 #3  0x0000d334 in mbdesktop_init (argc=&amp;lt;value optimized out&amp;gt;, argv=&amp;lt;value optimized out&amp;gt;) at mbdesktop.c:1022&lt;br /&gt;
When we have the debug symbols.&lt;br /&gt;
The lack of some debug libs could result in a mix of lines like the one just shown above, and lines like that:&lt;br /&gt;
 #1  0x405ce03c in g_object_ref () from /home/gnutoo/embedded/sshfs/usr/lib/libgobject-2.0.so.0&lt;br /&gt;
Which means that the later lines don't have debug symbols(something went wrong).&lt;br /&gt;
&lt;br /&gt;
Also Note that if you have restricted space on the target,you could use NFS root if you have an ethernet connection.&lt;br /&gt;
&lt;br /&gt;
==== No packages ====&lt;br /&gt;
As I don't have packages which segfault at hand,I'll create a binary which segfault&lt;br /&gt;
First start exporting the path of the toolchain if it's not done yet:&lt;br /&gt;
 $ cd arm-2010q1/bin #codesourcey&lt;br /&gt;
 $ export PATH=$(pwd):$PATH&lt;br /&gt;
Then create a main.c file with the following content:&lt;br /&gt;
 #include &amp;lt;stdlib.h&amp;gt; &lt;br /&gt;
 struct test{ &lt;br /&gt;
 	struct test *crash;&lt;br /&gt;
 };&lt;br /&gt;
 int main(){&lt;br /&gt;
   struct test *test = NULL;&lt;br /&gt;
   test = test-&amp;gt;crash;&lt;br /&gt;
 }&lt;br /&gt;
Then compile it: &lt;br /&gt;
 $ arm-none-linux-gnueabi-gcc -ggdb3 -static -o binary main.c &lt;br /&gt;
*ggdb3 is for including as much debug informations as possible&lt;br /&gt;
*-static is only for our test,it's for avoiding runtime issues in case the libc is different or incompatible between codesourcey and our target(in case of ucilbc for instance)&lt;br /&gt;
&lt;br /&gt;
=== Cross or not crosss ===&lt;br /&gt;
A common error while using gdb,is using the wrong gdb. In order to debug a program that runs on a target from your host you need a cross gdb,that is to say a GDB that runs on your computer but can debug the target architecture.&lt;br /&gt;
Such version is normally included in your toolchain/SDK or buildable if you use a build system&lt;br /&gt;
&lt;br /&gt;
If you want to debug use GDB on target you can too,it's easier but has a huge drawback(amongs other) : ram usage (you can easily use too much memory and have an OOM(out of memory) )&lt;br /&gt;
==== Cross GDB ====&lt;br /&gt;
===== CodeSourcery Sourcery G++ Lite =====&lt;br /&gt;
Let's say that you downloaded arm-2010q1-202-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2&lt;br /&gt;
&lt;br /&gt;
You will need to unpack it,and to run the following command on your host computer (instead of just running gdb):&lt;br /&gt;
 cd arm-2010q1/bin&lt;br /&gt;
 ./arm-none-linux-gnueabi-gdb&lt;br /&gt;
&lt;br /&gt;
===== Openembedded =====&lt;br /&gt;
If your build system is also your debug workstation do:&lt;br /&gt;
 bitbake gdb-cross gdbserver&lt;br /&gt;
And it will build a cross gdb for your host and gdbserver for your target&lt;br /&gt;
The resulting binaries will be found in your TMPDIR here:&lt;br /&gt;
 /home/embedded/tmpdir/cross/armv6/bin/&lt;br /&gt;
replace &amp;quot;/home/embedded/tmpdir&amp;quot; by your tmpdir and armv6 by your target architecture&lt;br /&gt;
The binary name changes according to your distro settings,for me it was:&lt;br /&gt;
 arm-angstrom-linux-gnueabi-gdb&lt;br /&gt;
So in order to run it do:&lt;br /&gt;
./arm-angstrom-linux-gnueabi-gdb&lt;br /&gt;
===== Note on sources =====&lt;br /&gt;
If your workstation is not your build system,in order to view sources in gdb(else you will only have the path of the source file and the line number) look [http://sourceware.org/gdb/current/onlinedocs/gdb/Source-Path.html#set%20substitute-path here]&lt;br /&gt;
&lt;br /&gt;
Without the sources path:&lt;br /&gt;
 (gdb) bt&lt;br /&gt;
 #0  0x403e1254 in strlen () from /mnt/target/lib/libc.so.6&lt;br /&gt;
 #1  0x4003350c in mb_pixbuf_img_new_from_file (pb=0x1fd58, filename=0x0) at mbpixbuf.c:1352&lt;br /&gt;
 #2  0x0000c8fc in mbdesktop_set_scroll_buttons (mb=0x1b008) at mbdesktop.c:689&lt;br /&gt;
 #3  0x0000d334 in mbdesktop_init (argc=&amp;lt;value optimized out&amp;gt;, argv=&amp;lt;value optimized out&amp;gt;) at mbdesktop.c:1022&lt;br /&gt;
 #4  0x0000e024 in main (argc=0, argv=0x0) at mbdesktop.c:1793&lt;br /&gt;
 (gdb) f 0&lt;br /&gt;
 #0  0x403e1254 in strlen () from /mnt/target/lib/libc.so.6&lt;br /&gt;
 (gdb) l&lt;br /&gt;
 1784	mbdesktop.c: No such file or directory. &lt;br /&gt;
 	in mbdesktop.c&lt;br /&gt;
 (gdb)&lt;br /&gt;
With the sources path set:&lt;br /&gt;
 (gdb) set substitute-path / /media/port4&lt;br /&gt;
 (gdb) bt&lt;br /&gt;
 #0  0x403e1254 in strlen () from /mnt/target/lib/libc.so.6&lt;br /&gt;
 #1  0x4003350c in mb_pixbuf_img_new_from_file (pb=0x1fd58, filename=0x0) at mbpixbuf.c:1352&lt;br /&gt;
 #2  0x0000c8fc in mbdesktop_set_scroll_buttons (mb=0x1b008) at mbdesktop.c:689&lt;br /&gt;
 #3  0x0000d334 in mbdesktop_init (argc=&amp;lt;value optimized out&amp;gt;, argv=&amp;lt;value optimized out&amp;gt;) at mbdesktop.c:1022&lt;br /&gt;
 #4  0x0000e024 in main (argc=0, argv=0x0) at mbdesktop.c:1793&lt;br /&gt;
 (gdb) f 0&lt;br /&gt;
 #0  0x403e1254 in strlen () from /mnt/target/lib/libc.so.6&lt;br /&gt;
 (gdb) l&lt;br /&gt;
 1784	      fprintf(stderr, &amp;quot;matchbox-desktop: failed to load any item modules.\n&amp;quot;);&lt;br /&gt;
 1785	    }&lt;br /&gt;
 1786	}&lt;br /&gt;
 1787	 &lt;br /&gt;
 1788	int &lt;br /&gt;
 1789	main(int argc, char **argv)&lt;br /&gt;
 1790	{&lt;br /&gt;
 1791	  MBDesktop *mb;&lt;br /&gt;
 1792	&lt;br /&gt;
 1793	  mb = mbdesktop_init(argc, argv);&lt;br /&gt;
/media/port4 beeing where the root filesystem of the build system is mounted(could be sshfs,NSF etc...)&lt;br /&gt;
&lt;br /&gt;
===== Howto =====&lt;br /&gt;
If you have networking,it's advised to choose it because it will be faster than serial,but if you only have serial choose serial&lt;br /&gt;
====== Core dump ======&lt;br /&gt;
Sometimes you can get a coredump.&lt;br /&gt;
A man page describing the core dump,and in which condition it can occur can be found [http://www.kernel.org/doc/man-pages/online/pages/man5/core.5.html here]&lt;br /&gt;
In order to make possible core dumps(that unlimit the size limit on coredumps)&lt;br /&gt;
 target/device$ ulimit -c unlimited&lt;br /&gt;
Then run your binary:&lt;br /&gt;
 target/device$ ./binary&lt;br /&gt;
Then reproduce the conditions under which the coredump happen.The core file will appear in your current working directory and will be named core&lt;br /&gt;
&lt;br /&gt;
Then copy the coredump to your workstation,and run gdb on your workstation(core is assumed to be in the current directory)&lt;br /&gt;
 ./arm-angstrom-linux-gnueabi-gdb &lt;br /&gt;
 (gdb) set sysroot /mnt/target&lt;br /&gt;
 (gdb) file /mnt/moko/usr/bin/binary&lt;br /&gt;
 (gdb) target core core&lt;br /&gt;
&lt;br /&gt;
====== Networking ======&lt;br /&gt;
Fist start gdbserver on the target:&lt;br /&gt;
 target/device$ gdbserver :2345 ./binary arg1 arg2&lt;br /&gt;
Note that will expose a gdb session to all networking interfaces,for instance if you have wifi on,someone could connect to it.&lt;br /&gt;
So if you don't want that,make it listen only on your the ip of the target interface you want to use for debugging:&lt;br /&gt;
 target/device$ gdbserver 192.168.0.202:2345 ./binary arg1 arg2&lt;br /&gt;
Then start GDB on your workstation,but do not connect to the target yet(else you'll have some undefined symbols):&lt;br /&gt;
 host/pc$ ./arm-angstrom-linux-gnueabi-gdb&lt;br /&gt;
 GNU gdb (Sourcery G++ Lite 2010q1-202) 7.0.50.20100218-cvs&lt;br /&gt;
 Copyright (C) 2010 Free Software Foundation, Inc.&lt;br /&gt;
 License GPLv3+: GNU GPL version 3 or later &amp;lt;http://gnu.org/licenses/gpl.html&amp;gt;&lt;br /&gt;
 This is free software: you are free to change and redistribute it.&lt;br /&gt;
 There is NO WARRANTY, to the extent permitted by law.  Type &amp;quot;show copying&amp;quot;&lt;br /&gt;
 and &amp;quot;show warranty&amp;quot; for details.&lt;br /&gt;
 This GDB was configured as &amp;quot;--host=i686-pc-linux-gnu --target=arm-none-linux-gnueabi&amp;quot;.&lt;br /&gt;
 For bug reporting instructions, please see:&lt;br /&gt;
 &amp;lt;https://support.codesourcery.com/GNUToolchain/&amp;gt;.&lt;br /&gt;
 (gdb) &lt;br /&gt;
&lt;br /&gt;
Then you need access to the target filesystem,knowing that we have networking we could use the following options:&lt;br /&gt;
*sshfs:&lt;br /&gt;
In order to use sshfs you need sftp-server installed on the target,and sshfs installed on the host computer.&lt;br /&gt;
To mount the filesystem do:&lt;br /&gt;
 mkdir /mnt/target/&lt;br /&gt;
 sudo sshfs root@192.168.0.202:/ /mnt/target/ -o allow_other&lt;br /&gt;
*NFS(maybe you already had nfsroot on the target)&lt;br /&gt;
*any other system that export the filesystem,and that is mountable&lt;br /&gt;
&lt;br /&gt;
Then you need to set a variable called sysroot in order to make the cross gdb find the libraries to load&lt;br /&gt;
 (gdb) set sysroot /mnt/target&lt;br /&gt;
Then load the binary:&lt;br /&gt;
 (gdb) file /mnt/target/usr/bin/binary&lt;br /&gt;
 Reading symbols from /mnt/target/usr/bin/binary...Reading symbols from /mnt/moko/usr/bin/.debug/binary...done. &lt;br /&gt;
And finally connect to the target:&lt;br /&gt;
 (gdb) target remote 192.168.0.202:2345&lt;br /&gt;
&lt;br /&gt;
====== Serial ======&lt;br /&gt;
First set the serial port speed on the target(before you issue the gdbserver command):&lt;br /&gt;
  stty speed 115200 &amp;lt; /dev/ttyS1&lt;br /&gt;
Then start gdbserver on the target:&lt;br /&gt;
 target/device$ gdbserver /dev/ttyS1 ./binary arg1 arg2&lt;br /&gt;
That will freeze the program until you connect with the cross gdb version and that you type &amp;quot;c&amp;quot; for continuing the execution of the program.&lt;br /&gt;
Note that GDB will slow the program a lot. if you have a program that uses a lot of resources,it's advised to attach to it just before the crash instead like that:&lt;br /&gt;
 target/device$ gdbserver /dev/ttyS1 --attach PID&lt;br /&gt;
Then do that on your workstation&lt;br /&gt;
 host/pc$ ./arm-angstrom-linux-gnueabi-gdb&lt;br /&gt;
 (gdb) target remote /dev/ttyS1&lt;br /&gt;
If you are using the serial method you need to make sure you have setup the serial speed correctly,&lt;br /&gt;
On the host:&lt;br /&gt;
  (gdb) set remotebaud 115200&lt;br /&gt;
&lt;br /&gt;
==== Non-cross(native) GDB ====&lt;br /&gt;
===== Howto =====&lt;br /&gt;
To start a new application for debug, use:&lt;br /&gt;
&lt;br /&gt;
  $ gdb ./binary&lt;br /&gt;
  $ gdb ./binary core.dump&lt;br /&gt;
  $ gdb --args ./binary arg1 arg2&lt;br /&gt;
  $ gdb --command=my-gdb-commands.txt --args ./binary arg1 arg2&lt;br /&gt;
&lt;br /&gt;
and then run it with (args just required if no --args were used):&lt;br /&gt;
&lt;br /&gt;
  (gdb) run arg1 arg2&lt;br /&gt;
&lt;br /&gt;
If application is already running, find out its pid (ps, top, pidof, ...) and:&lt;br /&gt;
&lt;br /&gt;
 $ gdb --pid $PID&lt;br /&gt;
&lt;br /&gt;
=== Tips ===&lt;br /&gt;
if you need to execute a series of commands every time, consider writing them on a file and use &amp;lt;code&amp;gt;--command=file&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;-x file&amp;lt;/code&amp;gt;).&lt;br /&gt;
=== Breakpoints ===&lt;br /&gt;
&lt;br /&gt;
If you control-C (^C), it will break at that point, but you can also schedule a breakpoint with:&lt;br /&gt;
&lt;br /&gt;
 (gdb) break function&lt;br /&gt;
 (gdb) break line&lt;br /&gt;
 (gdb) break file:function&lt;br /&gt;
 (gdb) break file:line&lt;br /&gt;
&lt;br /&gt;
conditional breaks are in the form:&lt;br /&gt;
&lt;br /&gt;
 (gdb) break where if condition&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;condition&amp;lt;/code&amp;gt; is some C expression that evaluates to 1 or 0, like &amp;lt;code&amp;gt;*ptr == NULL&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
One can disable or remove breakpoints with:&lt;br /&gt;
 (gdb) enable breakpoint-number&lt;br /&gt;
 (gdb) disable breakpoint-number&lt;br /&gt;
 (gdb) delete breakpoint-number&lt;br /&gt;
 (gdb) clear       # removes all breakpoints&lt;br /&gt;
&lt;br /&gt;
=== Examining ===&lt;br /&gt;
&lt;br /&gt;
To list source code nearby position or specific places:&lt;br /&gt;
 (gdb) list&lt;br /&gt;
 (gdb) list line&lt;br /&gt;
 (gdb) list function&lt;br /&gt;
 (gdb) list file:line&lt;br /&gt;
 (gdb) list file:function&lt;br /&gt;
 (gdb) list *address&lt;br /&gt;
&lt;br /&gt;
To list execution backtrace (or &amp;lt;code&amp;gt;bt&amp;lt;/code&amp;gt; for short):&lt;br /&gt;
 (gdb) backtrace&lt;br /&gt;
&lt;br /&gt;
To change frame to operate on:&lt;br /&gt;
 (gdb) frame frame-number&lt;br /&gt;
&lt;br /&gt;
To change thread to operate on:&lt;br /&gt;
 (gdb) thread thread-number&lt;br /&gt;
&lt;br /&gt;
To print some value or expression:&lt;br /&gt;
 (gdb) print $register&lt;br /&gt;
 (gdb) print variable&lt;br /&gt;
 (gdb) print *address&lt;br /&gt;
 (gdb) print *(int *)address&lt;br /&gt;
 (gdb) print *(char **)address&lt;br /&gt;
 (gdb) print myfunc(p1, p2) # will actually execute it and return result!&lt;br /&gt;
 (gdb) print *a = 123 # will actually change *a value and return 123!&lt;br /&gt;
 (gdb) print file::variable&lt;br /&gt;
 (gdb) print function::variable&lt;br /&gt;
&lt;br /&gt;
To disassembly:&lt;br /&gt;
 (gdb) disassembly&lt;br /&gt;
 (gdb) disassembly file:line&lt;br /&gt;
&lt;br /&gt;
Print function arguments:&lt;br /&gt;
 (gdb) info args&lt;br /&gt;
&lt;br /&gt;
Print locals:&lt;br /&gt;
 (gdb) info locals&lt;br /&gt;
&lt;br /&gt;
Print breakpoints:&lt;br /&gt;
 (gdb) info breakpoints&lt;br /&gt;
&lt;br /&gt;
Print threads:&lt;br /&gt;
 (gdb) info threads&lt;br /&gt;
&lt;br /&gt;
=== Stepping ===&lt;br /&gt;
&lt;br /&gt;
To go to next instruction, possible entering a function (or &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt; for short):&lt;br /&gt;
 (gdb) step&lt;br /&gt;
&lt;br /&gt;
To go to next instruction, but avoid entering new functions (or &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; for short):&lt;br /&gt;
 (gdb) next&lt;br /&gt;
&lt;br /&gt;
To continue until the function returns:&lt;br /&gt;
 (gdb) finish&lt;br /&gt;
&lt;br /&gt;
To continue execution (or &amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt; for short):&lt;br /&gt;
 (gdb) continue&lt;br /&gt;
&lt;br /&gt;
=== Manipulating Program ===&lt;br /&gt;
&lt;br /&gt;
To set variable to some value:&lt;br /&gt;
 (gdb) set var name=value&lt;br /&gt;
&lt;br /&gt;
To force function to return:&lt;br /&gt;
 (gdb) return value&lt;br /&gt;
 (gdb) return expression&lt;br /&gt;
&lt;br /&gt;
=== Changing Signal Handlers ===&lt;br /&gt;
&lt;br /&gt;
 (gdb) handle signal action&lt;br /&gt;
&lt;br /&gt;
debugging applications with old libC, those pre-nptl, can be really annoying due SIG32 and SIG33, one can ignore those with:&lt;br /&gt;
 (gdb) handle SIG32 nostop&lt;br /&gt;
 (gdb) handle SIG32 noprint&lt;br /&gt;
 (gdb) handle SIG33 nostop&lt;br /&gt;
 (gdb) handle SIG33 noprint&lt;br /&gt;
&lt;br /&gt;
=== Shared Object Paths ===&lt;br /&gt;
&lt;br /&gt;
Often your cross compile root is not &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt;, so you might have to add new paths to the search list.&lt;br /&gt;
&lt;br /&gt;
Unset absolute prefix:&lt;br /&gt;
  (gdb) set solib-absolute-prefix null&lt;br /&gt;
&lt;br /&gt;
Add paths to search paths:&lt;br /&gt;
  (gdb) set solib-search-path /path1:/path2&lt;br /&gt;
&lt;br /&gt;
Alternatively you can choose to set the prefix to the root of your target file system. Specially if you are doing&lt;br /&gt;
embedded development and already exporting your root file system from you host machine to your target machine it can &lt;br /&gt;
be very rewarding so simply use that as root:&lt;br /&gt;
  (gdb) set solib-absolute-prefix /rootfs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Starting application debug from host ===&lt;br /&gt;
Gdbserver could be run in multi-process mode where applications are started or processes connected to remotely, on the fly.&lt;br /&gt;
 gdbserver --multi :2345&lt;br /&gt;
&lt;br /&gt;
Run crosscompiled gdb on host (&amp;lt;gcc_toolchain_path&amp;gt;/bin/arm-none-linux-gnueabi-gdb&lt;br /&gt;
Issue the following commands (multiprocess example):&lt;br /&gt;
 file &amp;lt;application&amp;gt;&lt;br /&gt;
 target extended remote &amp;lt;target_ip&amp;gt;:2345&lt;br /&gt;
 set remote exec-file &amp;lt;path/application&amp;gt;&lt;br /&gt;
 set solib-absolute-prefix  &amp;lt;rootfs_path&amp;gt;&lt;br /&gt;
 set solib-search-path  &amp;lt;targetlib_path&amp;gt;/lib: &amp;lt;targetlib_path&amp;gt;/usr/lib&lt;br /&gt;
 break main&lt;br /&gt;
 continue&lt;br /&gt;
&lt;br /&gt;
[[Category:Tools]]&lt;/div&gt;</summary>
		<author><name>Tord</name></author>	</entry>

	<entry>
		<id>http://elinux.org/GDB</id>
		<title>GDB</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/GDB"/>
				<updated>2011-10-27T23:42:26Z</updated>
		
		<summary type="html">&lt;p&gt;Tord: /* Appendix: Starting application debug from host on the fly */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The GNU Debugger GDB is the most common debug tool for Linux. It features most used features one can think of, including server-client debug architecture (so you run the heavy debug part on your host/pc machine), but lack some bits as checkpoint-restart during execution.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
&lt;br /&gt;
GDB ships with extensive documentation at http://www.gnu.org/software/gdb/documentation/, but there are some good [http://refcards.com/docs/peschr/gdb/gdb-refcard-a4.pdf quick reference cards] as well.&lt;br /&gt;
&lt;br /&gt;
== Basic Usage ==&lt;br /&gt;
&lt;br /&gt;
Documentation is so large that sometimes its hard to get started, so most simple tasks can be done with the following commands, but please read GDB docs as soon as possible!&lt;br /&gt;
&lt;br /&gt;
=== Debug version ===&lt;br /&gt;
==== Debug packages ====&lt;br /&gt;
First note that in order to use GDB in an efficient way,you need the debug packages,that is to say the -dbg version of your package.&lt;br /&gt;
Under the opkg package management if you installed a binary like that:&lt;br /&gt;
 opkg install binary&lt;br /&gt;
you need to install the debug part of it:&lt;br /&gt;
 opkg install binary-dbg&lt;br /&gt;
&lt;br /&gt;
Without debug packages you will be limited to assembly debugging(no source level debugging)&lt;br /&gt;
&lt;br /&gt;
Here are some example of how usefull is debug symbols:&lt;br /&gt;
&lt;br /&gt;
Without debug symbols:&lt;br /&gt;
 DISPLAY=:0.0 gdbserver 10.10.10.10:8090 matchbox-desktop #target&lt;br /&gt;
 &lt;br /&gt;
 gnutoo@gnutoo-desktop:~/embedded/arm-2010q1/bin$ ./arm-none-linux-gnueabi-gdb&lt;br /&gt;
 GNU gdb (Sourcery G++ Lite 2010q1-202) 7.0.50.20100218-cvs&lt;br /&gt;
 Copyright (C) 2010 Free Software Foundation, Inc.&lt;br /&gt;
 License GPLv3+: GNU GPL version 3 or later &amp;lt;http://gnu.org/licenses/gpl.html&amp;gt;&lt;br /&gt;
 This is free software: you are free to change and redistribute it.&lt;br /&gt;
 There is NO WARRANTY, to the extent permitted by law.  Type &amp;quot;show copying&amp;quot;&lt;br /&gt;
 and &amp;quot;show warranty&amp;quot; for details.&lt;br /&gt;
 This GDB was configured as &amp;quot;--host=i686-pc-linux-gnu --target=arm-none-linux-gnueabi&amp;quot;.&lt;br /&gt;
 For bug reporting instructions, please see:&lt;br /&gt;
 &amp;lt;https://support.codesourcery.com/GNUToolchain/&amp;gt;.&lt;br /&gt;
 (gdb) target remote 10.10.10.10:8090&lt;br /&gt;
 Remote debugging using 10.10.10.10:8090&lt;br /&gt;
 0x400007e0 in ?? ()&lt;br /&gt;
 (gdb) c&lt;br /&gt;
 Continuing.&lt;br /&gt;
 Cannot access memory at address 0x0&lt;br /&gt;
 Program received signal SIGSEGV, Segmentation fault.&lt;br /&gt;
 0x403e1254 in ?? ()&lt;br /&gt;
 (gdb) bt&lt;br /&gt;
 #0  0x403e1254 in ?? ()&lt;br /&gt;
 Cannot access memory at address 0x302e3032&lt;br /&gt;
With debugggin symbols:&lt;br /&gt;
 opkg install matchbox-desktop-dbg&lt;br /&gt;
                 ...&lt;br /&gt;
 DISPLAY=:0.0 gdbserver 10.10.10.10:8090 matchbox-desktop #target&lt;br /&gt;
 root@gnutoo-desktop:/home/gnutoo/embedded/arm-2010q1/bin# ./arm-none-linux-gnueabi-gdb&lt;br /&gt;
 GNU gdb (Sourcery G++ Lite 2010q1-202) 7.0.50.20100218-cvs&lt;br /&gt;
 Copyright (C) 2010 Free Software Foundation, Inc.&lt;br /&gt;
 License GPLv3+: GNU GPL version 3 or later &amp;lt;http://gnu.org/licenses/gpl.html&amp;gt;&lt;br /&gt;
 This is free software: you are free to change and redistribute it.&lt;br /&gt;
 There is NO WARRANTY, to the extent permitted by law.  Type &amp;quot;show copying&amp;quot;&lt;br /&gt;
 and &amp;quot;show warranty&amp;quot; for details.&lt;br /&gt;
 This GDB was configured as &amp;quot;--host=i686-pc-linux-gnu --target=arm-none-linux-gnueabi&amp;quot;.&lt;br /&gt;
 For bug reporting instructions, please see:&lt;br /&gt;
 &amp;lt;https://support.codesourcery.com/GNUToolchain/&amp;gt;.&lt;br /&gt;
 (gdb) set sysroot /mnt/target/&lt;br /&gt;
 (gdb) file /mnt/target/usr/bin/matchbox-desktop&lt;br /&gt;
 Reading symbols from /mnt/target/usr/bin/matchbox-desktop...Reading symbols from /mnt/target/usr/bin/.debug/matchbox-desktop...done.&lt;br /&gt;
 done.&lt;br /&gt;
 (gdb) target remote 10.10.10.10:8090&lt;br /&gt;
 Remote debugging using 10.10.10.10:8090&lt;br /&gt;
 Reading symbols from /mnt/target/lib/ld-linux.so.3...Reading symbols from /mnt/target/lib/.debug/ld-2.9.so...done.&lt;br /&gt;
 done.&lt;br /&gt;
 Loaded symbols for /mnt/target/lib/ld-linux.so.3 &lt;br /&gt;
 0x400007e0 in _start () from /mnt/target/lib/ld-linux.so.3&lt;br /&gt;
 (gdb) c&lt;br /&gt;
 Continuing. &lt;br /&gt;
 Program received signal SIGSEGV, Segmentation fault.&lt;br /&gt;
 0x403e1254 in strlen () from /mnt/target/lib/libc.so.6&lt;br /&gt;
 (gdb) bt&lt;br /&gt;
 #0  0x403e1254 in strlen () from /mnt/target/lib/libc.so.6&lt;br /&gt;
 #1  0x4003350c in mb_pixbuf_img_new_from_file (pb=0x1fd58, filename=0x0) at mbpixbuf.c:1352&lt;br /&gt;
 #2  0x0000c8fc in mbdesktop_set_scroll_buttons (mb=0x1b008) at mbdesktop.c:689&lt;br /&gt;
 #3  0x0000d334 in mbdesktop_init (argc=&amp;lt;value optimized out&amp;gt;, argv=&amp;lt;value optimized out&amp;gt;) at mbdesktop.c:1022&lt;br /&gt;
 #4  0x0000e024 in main (argc=0, argv=0x0) at mbdesktop.c:1793&lt;br /&gt;
&lt;br /&gt;
Note that we have lines that looks like:&lt;br /&gt;
 #3  0x0000d334 in mbdesktop_init (argc=&amp;lt;value optimized out&amp;gt;, argv=&amp;lt;value optimized out&amp;gt;) at mbdesktop.c:1022&lt;br /&gt;
When we have the debug symbols.&lt;br /&gt;
The lack of some debug libs could result in a mix of lines like the one just shown above, and lines like that:&lt;br /&gt;
 #1  0x405ce03c in g_object_ref () from /home/gnutoo/embedded/sshfs/usr/lib/libgobject-2.0.so.0&lt;br /&gt;
Which means that the later lines don't have debug symbols(something went wrong).&lt;br /&gt;
&lt;br /&gt;
Also Note that if you have restricted space on the target,you could use NFS root if you have an ethernet connection.&lt;br /&gt;
&lt;br /&gt;
==== No packages ====&lt;br /&gt;
As I don't have packages which segfault at hand,I'll create a binary which segfault&lt;br /&gt;
First start exporting the path of the toolchain if it's not done yet:&lt;br /&gt;
 $ cd arm-2010q1/bin #codesourcey&lt;br /&gt;
 $ export PATH=$(pwd):$PATH&lt;br /&gt;
Then create a main.c file with the following content:&lt;br /&gt;
 #include &amp;lt;stdlib.h&amp;gt; &lt;br /&gt;
 struct test{ &lt;br /&gt;
 	struct test *crash;&lt;br /&gt;
 };&lt;br /&gt;
 int main(){&lt;br /&gt;
   struct test *test = NULL;&lt;br /&gt;
   test = test-&amp;gt;crash;&lt;br /&gt;
 }&lt;br /&gt;
Then compile it: &lt;br /&gt;
 $ arm-none-linux-gnueabi-gcc -ggdb3 -static -o binary main.c &lt;br /&gt;
*ggdb3 is for including as much debug informations as possible&lt;br /&gt;
*-static is only for our test,it's for avoiding runtime issues in case the libc is different or incompatible between codesourcey and our target(in case of ucilbc for instance)&lt;br /&gt;
&lt;br /&gt;
=== Cross or not crosss ===&lt;br /&gt;
A common error while using gdb,is using the wrong gdb. In order to debug a program that runs on a target from your host you need a cross gdb,that is to say a GDB that runs on your computer but can debug the target architecture.&lt;br /&gt;
Such version is normally included in your toolchain/SDK or buildable if you use a build system&lt;br /&gt;
&lt;br /&gt;
If you want to debug use GDB on target you can too,it's easier but has a huge drawback(amongs other) : ram usage (you can easily use too much memory and have an OOM(out of memory) )&lt;br /&gt;
==== Cross GDB ====&lt;br /&gt;
===== CodeSourcery Sourcery G++ Lite =====&lt;br /&gt;
Let's say that you downloaded arm-2010q1-202-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2&lt;br /&gt;
&lt;br /&gt;
You will need to unpack it,and to run the following command on your host computer (instead of just running gdb):&lt;br /&gt;
 cd arm-2010q1/bin&lt;br /&gt;
 ./arm-none-linux-gnueabi-gdb&lt;br /&gt;
&lt;br /&gt;
===== Openembedded =====&lt;br /&gt;
If your build system is also your debug workstation do:&lt;br /&gt;
 bitbake gdb-cross gdbserver&lt;br /&gt;
And it will build a cross gdb for your host and gdbserver for your target&lt;br /&gt;
The resulting binaries will be found in your TMPDIR here:&lt;br /&gt;
 /home/embedded/tmpdir/cross/armv6/bin/&lt;br /&gt;
replace &amp;quot;/home/embedded/tmpdir&amp;quot; by your tmpdir and armv6 by your target architecture&lt;br /&gt;
The binary name changes according to your distro settings,for me it was:&lt;br /&gt;
 arm-angstrom-linux-gnueabi-gdb&lt;br /&gt;
So in order to run it do:&lt;br /&gt;
./arm-angstrom-linux-gnueabi-gdb&lt;br /&gt;
===== Note on sources =====&lt;br /&gt;
If your workstation is not your build system,in order to view sources in gdb(else you will only have the path of the source file and the line number) look [http://sourceware.org/gdb/current/onlinedocs/gdb/Source-Path.html#set%20substitute-path here]&lt;br /&gt;
&lt;br /&gt;
Without the sources path:&lt;br /&gt;
 (gdb) bt&lt;br /&gt;
 #0  0x403e1254 in strlen () from /mnt/target/lib/libc.so.6&lt;br /&gt;
 #1  0x4003350c in mb_pixbuf_img_new_from_file (pb=0x1fd58, filename=0x0) at mbpixbuf.c:1352&lt;br /&gt;
 #2  0x0000c8fc in mbdesktop_set_scroll_buttons (mb=0x1b008) at mbdesktop.c:689&lt;br /&gt;
 #3  0x0000d334 in mbdesktop_init (argc=&amp;lt;value optimized out&amp;gt;, argv=&amp;lt;value optimized out&amp;gt;) at mbdesktop.c:1022&lt;br /&gt;
 #4  0x0000e024 in main (argc=0, argv=0x0) at mbdesktop.c:1793&lt;br /&gt;
 (gdb) f 0&lt;br /&gt;
 #0  0x403e1254 in strlen () from /mnt/target/lib/libc.so.6&lt;br /&gt;
 (gdb) l&lt;br /&gt;
 1784	mbdesktop.c: No such file or directory. &lt;br /&gt;
 	in mbdesktop.c&lt;br /&gt;
 (gdb)&lt;br /&gt;
With the sources path set:&lt;br /&gt;
 (gdb) set substitute-path / /media/port4&lt;br /&gt;
 (gdb) bt&lt;br /&gt;
 #0  0x403e1254 in strlen () from /mnt/target/lib/libc.so.6&lt;br /&gt;
 #1  0x4003350c in mb_pixbuf_img_new_from_file (pb=0x1fd58, filename=0x0) at mbpixbuf.c:1352&lt;br /&gt;
 #2  0x0000c8fc in mbdesktop_set_scroll_buttons (mb=0x1b008) at mbdesktop.c:689&lt;br /&gt;
 #3  0x0000d334 in mbdesktop_init (argc=&amp;lt;value optimized out&amp;gt;, argv=&amp;lt;value optimized out&amp;gt;) at mbdesktop.c:1022&lt;br /&gt;
 #4  0x0000e024 in main (argc=0, argv=0x0) at mbdesktop.c:1793&lt;br /&gt;
 (gdb) f 0&lt;br /&gt;
 #0  0x403e1254 in strlen () from /mnt/target/lib/libc.so.6&lt;br /&gt;
 (gdb) l&lt;br /&gt;
 1784	      fprintf(stderr, &amp;quot;matchbox-desktop: failed to load any item modules.\n&amp;quot;);&lt;br /&gt;
 1785	    }&lt;br /&gt;
 1786	}&lt;br /&gt;
 1787	 &lt;br /&gt;
 1788	int &lt;br /&gt;
 1789	main(int argc, char **argv)&lt;br /&gt;
 1790	{&lt;br /&gt;
 1791	  MBDesktop *mb;&lt;br /&gt;
 1792	&lt;br /&gt;
 1793	  mb = mbdesktop_init(argc, argv);&lt;br /&gt;
/media/port4 beeing where the root filesystem of the build system is mounted(could be sshfs,NSF etc...)&lt;br /&gt;
&lt;br /&gt;
===== Howto =====&lt;br /&gt;
If you have networking,it's advised to choose it because it will be faster than serial,but if you only have serial choose serial&lt;br /&gt;
====== Core dump ======&lt;br /&gt;
Sometimes you can get a coredump.&lt;br /&gt;
A man page describing the core dump,and in which condition it can occur can be found [http://www.kernel.org/doc/man-pages/online/pages/man5/core.5.html here]&lt;br /&gt;
In order to make possible core dumps(that unlimit the size limit on coredumps)&lt;br /&gt;
 target/device$ ulimit -c unlimited&lt;br /&gt;
Then run your binary:&lt;br /&gt;
 target/device$ ./binary&lt;br /&gt;
Then reproduce the conditions under which the coredump happen.The core file will appear in your current working directory and will be named core&lt;br /&gt;
&lt;br /&gt;
Then copy the coredump to your workstation,and run gdb on your workstation(core is assumed to be in the current directory)&lt;br /&gt;
 ./arm-angstrom-linux-gnueabi-gdb &lt;br /&gt;
 (gdb) set sysroot /mnt/target&lt;br /&gt;
 (gdb) file /mnt/moko/usr/bin/binary&lt;br /&gt;
 (gdb) target core core&lt;br /&gt;
&lt;br /&gt;
====== Networking ======&lt;br /&gt;
Fist start gdbserver on the target:&lt;br /&gt;
 target/device$ gdbserver :2345 ./binary arg1 arg2&lt;br /&gt;
Note that will expose a gdb session to all networking interfaces,for instance if you have wifi on,someone could connect to it.&lt;br /&gt;
So if you don't want that,make it listen only on your the ip of the target interface you want to use for debugging:&lt;br /&gt;
 target/device$ gdbserver 192.168.0.202:2345 ./binary arg1 arg2&lt;br /&gt;
Then start GDB on your workstation,but do not connect to the target yet(else you'll have some undefined symbols):&lt;br /&gt;
 host/pc$ ./arm-angstrom-linux-gnueabi-gdb&lt;br /&gt;
 GNU gdb (Sourcery G++ Lite 2010q1-202) 7.0.50.20100218-cvs&lt;br /&gt;
 Copyright (C) 2010 Free Software Foundation, Inc.&lt;br /&gt;
 License GPLv3+: GNU GPL version 3 or later &amp;lt;http://gnu.org/licenses/gpl.html&amp;gt;&lt;br /&gt;
 This is free software: you are free to change and redistribute it.&lt;br /&gt;
 There is NO WARRANTY, to the extent permitted by law.  Type &amp;quot;show copying&amp;quot;&lt;br /&gt;
 and &amp;quot;show warranty&amp;quot; for details.&lt;br /&gt;
 This GDB was configured as &amp;quot;--host=i686-pc-linux-gnu --target=arm-none-linux-gnueabi&amp;quot;.&lt;br /&gt;
 For bug reporting instructions, please see:&lt;br /&gt;
 &amp;lt;https://support.codesourcery.com/GNUToolchain/&amp;gt;.&lt;br /&gt;
 (gdb) &lt;br /&gt;
&lt;br /&gt;
Then you need access to the target filesystem,knowing that we have networking we could use the following options:&lt;br /&gt;
*sshfs:&lt;br /&gt;
In order to use sshfs you need sftp-server installed on the target,and sshfs installed on the host computer.&lt;br /&gt;
To mount the filesystem do:&lt;br /&gt;
 mkdir /mnt/target/&lt;br /&gt;
 sudo sshfs root@192.168.0.202:/ /mnt/target/ -o allow_other&lt;br /&gt;
*NFS(maybe you already had nfsroot on the target)&lt;br /&gt;
*any other system that export the filesystem,and that is mountable&lt;br /&gt;
&lt;br /&gt;
Then you need to set a variable called sysroot in order to make the cross gdb find the libraries to load&lt;br /&gt;
 (gdb) set sysroot /mnt/target&lt;br /&gt;
Then load the binary:&lt;br /&gt;
 (gdb) file /mnt/target/usr/bin/binary&lt;br /&gt;
 Reading symbols from /mnt/target/usr/bin/binary...Reading symbols from /mnt/moko/usr/bin/.debug/binary...done. &lt;br /&gt;
And finally connect to the target:&lt;br /&gt;
 (gdb) target remote 192.168.0.202:2345&lt;br /&gt;
&lt;br /&gt;
====== Serial ======&lt;br /&gt;
First set the serial port speed on the target(before you issue the gdbserver command):&lt;br /&gt;
  stty speed 115200 &amp;lt; /dev/ttyS1&lt;br /&gt;
Then start gdbserver on the target:&lt;br /&gt;
 target/device$ gdbserver /dev/ttyS1 ./binary arg1 arg2&lt;br /&gt;
That will freeze the program until you connect with the cross gdb version and that you type &amp;quot;c&amp;quot; for continuing the execution of the program.&lt;br /&gt;
Note that GDB will slow the program a lot. if you have a program that uses a lot of resources,it's advised to attach to it just before the crash instead like that:&lt;br /&gt;
 target/device$ gdbserver /dev/ttyS1 --attach PID&lt;br /&gt;
Then do that on your workstation&lt;br /&gt;
 host/pc$ ./arm-angstrom-linux-gnueabi-gdb&lt;br /&gt;
 (gdb) target remote /dev/ttyS1&lt;br /&gt;
If you are using the serial method you need to make sure you have setup the serial speed correctly,&lt;br /&gt;
On the host:&lt;br /&gt;
  (gdb) set remotebaud 115200&lt;br /&gt;
&lt;br /&gt;
==== Non-cross(native) GDB ====&lt;br /&gt;
===== Howto =====&lt;br /&gt;
To start a new application for debug, use:&lt;br /&gt;
&lt;br /&gt;
  $ gdb ./binary&lt;br /&gt;
  $ gdb ./binary core.dump&lt;br /&gt;
  $ gdb --args ./binary arg1 arg2&lt;br /&gt;
  $ gdb --command=my-gdb-commands.txt --args ./binary arg1 arg2&lt;br /&gt;
&lt;br /&gt;
and then run it with (args just required if no --args were used):&lt;br /&gt;
&lt;br /&gt;
  (gdb) run arg1 arg2&lt;br /&gt;
&lt;br /&gt;
If application is already running, find out its pid (ps, top, pidof, ...) and:&lt;br /&gt;
&lt;br /&gt;
 $ gdb --pid $PID&lt;br /&gt;
&lt;br /&gt;
=== Tips ===&lt;br /&gt;
if you need to execute a series of commands every time, consider writing them on a file and use &amp;lt;code&amp;gt;--command=file&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;-x file&amp;lt;/code&amp;gt;).&lt;br /&gt;
=== Breakpoints ===&lt;br /&gt;
&lt;br /&gt;
If you control-C (^C), it will break at that point, but you can also schedule a breakpoint with:&lt;br /&gt;
&lt;br /&gt;
 (gdb) break function&lt;br /&gt;
 (gdb) break line&lt;br /&gt;
 (gdb) break file:function&lt;br /&gt;
 (gdb) break file:line&lt;br /&gt;
&lt;br /&gt;
conditional breaks are in the form:&lt;br /&gt;
&lt;br /&gt;
 (gdb) break where if condition&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;condition&amp;lt;/code&amp;gt; is some C expression that evaluates to 1 or 0, like &amp;lt;code&amp;gt;*ptr == NULL&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
One can disable or remove breakpoints with:&lt;br /&gt;
 (gdb) enable breakpoint-number&lt;br /&gt;
 (gdb) disable breakpoint-number&lt;br /&gt;
 (gdb) delete breakpoint-number&lt;br /&gt;
 (gdb) clear       # removes all breakpoints&lt;br /&gt;
&lt;br /&gt;
=== Examining ===&lt;br /&gt;
&lt;br /&gt;
To list source code nearby position or specific places:&lt;br /&gt;
 (gdb) list&lt;br /&gt;
 (gdb) list line&lt;br /&gt;
 (gdb) list function&lt;br /&gt;
 (gdb) list file:line&lt;br /&gt;
 (gdb) list file:function&lt;br /&gt;
 (gdb) list *address&lt;br /&gt;
&lt;br /&gt;
To list execution backtrace (or &amp;lt;code&amp;gt;bt&amp;lt;/code&amp;gt; for short):&lt;br /&gt;
 (gdb) backtrace&lt;br /&gt;
&lt;br /&gt;
To change frame to operate on:&lt;br /&gt;
 (gdb) frame frame-number&lt;br /&gt;
&lt;br /&gt;
To change thread to operate on:&lt;br /&gt;
 (gdb) thread thread-number&lt;br /&gt;
&lt;br /&gt;
To print some value or expression:&lt;br /&gt;
 (gdb) print $register&lt;br /&gt;
 (gdb) print variable&lt;br /&gt;
 (gdb) print *address&lt;br /&gt;
 (gdb) print *(int *)address&lt;br /&gt;
 (gdb) print *(char **)address&lt;br /&gt;
 (gdb) print myfunc(p1, p2) # will actually execute it and return result!&lt;br /&gt;
 (gdb) print *a = 123 # will actually change *a value and return 123!&lt;br /&gt;
 (gdb) print file::variable&lt;br /&gt;
 (gdb) print function::variable&lt;br /&gt;
&lt;br /&gt;
To disassembly:&lt;br /&gt;
 (gdb) disassembly&lt;br /&gt;
 (gdb) disassembly file:line&lt;br /&gt;
&lt;br /&gt;
Print function arguments:&lt;br /&gt;
 (gdb) info args&lt;br /&gt;
&lt;br /&gt;
Print locals:&lt;br /&gt;
 (gdb) info locals&lt;br /&gt;
&lt;br /&gt;
Print breakpoints:&lt;br /&gt;
 (gdb) info breakpoints&lt;br /&gt;
&lt;br /&gt;
Print threads:&lt;br /&gt;
 (gdb) info threads&lt;br /&gt;
&lt;br /&gt;
=== Stepping ===&lt;br /&gt;
&lt;br /&gt;
To go to next instruction, possible entering a function (or &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt; for short):&lt;br /&gt;
 (gdb) step&lt;br /&gt;
&lt;br /&gt;
To go to next instruction, but avoid entering new functions (or &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; for short):&lt;br /&gt;
 (gdb) next&lt;br /&gt;
&lt;br /&gt;
To continue until the function returns:&lt;br /&gt;
 (gdb) finish&lt;br /&gt;
&lt;br /&gt;
To continue execution (or &amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt; for short):&lt;br /&gt;
 (gdb) continue&lt;br /&gt;
&lt;br /&gt;
=== Manipulating Program ===&lt;br /&gt;
&lt;br /&gt;
To set variable to some value:&lt;br /&gt;
 (gdb) set var name=value&lt;br /&gt;
&lt;br /&gt;
To force function to return:&lt;br /&gt;
 (gdb) return value&lt;br /&gt;
 (gdb) return expression&lt;br /&gt;
&lt;br /&gt;
=== Changing Signal Handlers ===&lt;br /&gt;
&lt;br /&gt;
 (gdb) handle signal action&lt;br /&gt;
&lt;br /&gt;
debugging applications with old libC, those pre-nptl, can be really annoying due SIG32 and SIG33, one can ignore those with:&lt;br /&gt;
 (gdb) handle SIG32 nostop&lt;br /&gt;
 (gdb) handle SIG32 noprint&lt;br /&gt;
 (gdb) handle SIG33 nostop&lt;br /&gt;
 (gdb) handle SIG33 noprint&lt;br /&gt;
&lt;br /&gt;
=== Shared Object Paths ===&lt;br /&gt;
&lt;br /&gt;
Often your cross compile root is not &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt;, so you might have to add new paths to the search list.&lt;br /&gt;
&lt;br /&gt;
Unset absolute prefix:&lt;br /&gt;
  (gdb) set solib-absolute-prefix null&lt;br /&gt;
&lt;br /&gt;
Add paths to search paths:&lt;br /&gt;
  (gdb) set solib-search-path /path1:/path2&lt;br /&gt;
&lt;br /&gt;
Alternatively you can choose to set the prefix to the root of your target file system. Specially if you are doing&lt;br /&gt;
embedded development and already exporting your root file system from you host machine to your target machine it can &lt;br /&gt;
be very rewarding so simply use that as root:&lt;br /&gt;
  (gdb) set solib-absolute-prefix /rootfs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Starting application debug from host ===&lt;br /&gt;
Gdbserver could be run in multi-process mode where applications are started or processes connected to remotely, on the fly.&lt;br /&gt;
 gdbserver --multi :2345&lt;br /&gt;
&lt;br /&gt;
Run crosscompiled gdb on host (&amp;lt;gcc_toolchain_path&amp;gt;/bin/arm-none-linux-gnueabi-gdb &amp;lt;application&amp;gt;&lt;br /&gt;
Issue the following commands (multiprocess example):&lt;br /&gt;
 file &amp;lt;application&amp;gt;&lt;br /&gt;
 target extended remote &amp;lt;target_ip&amp;gt;:2345&lt;br /&gt;
 set remote exec-file &amp;lt;path/application&amp;gt;&lt;br /&gt;
 set solib-absolute-prefix  &amp;lt;rootfs_path&amp;gt;&lt;br /&gt;
 set solib-search-path  &amp;lt;targetlib_path&amp;gt;/lib: &amp;lt;targetlib_path&amp;gt;/usr/lib&lt;br /&gt;
 break main&lt;br /&gt;
 continue&lt;br /&gt;
&lt;br /&gt;
[[Category:Tools]]&lt;/div&gt;</summary>
		<author><name>Tord</name></author>	</entry>

	<entry>
		<id>http://elinux.org/GDB</id>
		<title>GDB</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/GDB"/>
				<updated>2011-10-27T23:40:24Z</updated>
		
		<summary type="html">&lt;p&gt;Tord: /* Starting application debug from host */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The GNU Debugger GDB is the most common debug tool for Linux. It features most used features one can think of, including server-client debug architecture (so you run the heavy debug part on your host/pc machine), but lack some bits as checkpoint-restart during execution.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
&lt;br /&gt;
GDB ships with extensive documentation at http://www.gnu.org/software/gdb/documentation/, but there are some good [http://refcards.com/docs/peschr/gdb/gdb-refcard-a4.pdf quick reference cards] as well.&lt;br /&gt;
&lt;br /&gt;
== Basic Usage ==&lt;br /&gt;
&lt;br /&gt;
Documentation is so large that sometimes its hard to get started, so most simple tasks can be done with the following commands, but please read GDB docs as soon as possible!&lt;br /&gt;
&lt;br /&gt;
=== Debug version ===&lt;br /&gt;
==== Debug packages ====&lt;br /&gt;
First note that in order to use GDB in an efficient way,you need the debug packages,that is to say the -dbg version of your package.&lt;br /&gt;
Under the opkg package management if you installed a binary like that:&lt;br /&gt;
 opkg install binary&lt;br /&gt;
you need to install the debug part of it:&lt;br /&gt;
 opkg install binary-dbg&lt;br /&gt;
&lt;br /&gt;
Without debug packages you will be limited to assembly debugging(no source level debugging)&lt;br /&gt;
&lt;br /&gt;
Here are some example of how usefull is debug symbols:&lt;br /&gt;
&lt;br /&gt;
Without debug symbols:&lt;br /&gt;
 DISPLAY=:0.0 gdbserver 10.10.10.10:8090 matchbox-desktop #target&lt;br /&gt;
 &lt;br /&gt;
 gnutoo@gnutoo-desktop:~/embedded/arm-2010q1/bin$ ./arm-none-linux-gnueabi-gdb&lt;br /&gt;
 GNU gdb (Sourcery G++ Lite 2010q1-202) 7.0.50.20100218-cvs&lt;br /&gt;
 Copyright (C) 2010 Free Software Foundation, Inc.&lt;br /&gt;
 License GPLv3+: GNU GPL version 3 or later &amp;lt;http://gnu.org/licenses/gpl.html&amp;gt;&lt;br /&gt;
 This is free software: you are free to change and redistribute it.&lt;br /&gt;
 There is NO WARRANTY, to the extent permitted by law.  Type &amp;quot;show copying&amp;quot;&lt;br /&gt;
 and &amp;quot;show warranty&amp;quot; for details.&lt;br /&gt;
 This GDB was configured as &amp;quot;--host=i686-pc-linux-gnu --target=arm-none-linux-gnueabi&amp;quot;.&lt;br /&gt;
 For bug reporting instructions, please see:&lt;br /&gt;
 &amp;lt;https://support.codesourcery.com/GNUToolchain/&amp;gt;.&lt;br /&gt;
 (gdb) target remote 10.10.10.10:8090&lt;br /&gt;
 Remote debugging using 10.10.10.10:8090&lt;br /&gt;
 0x400007e0 in ?? ()&lt;br /&gt;
 (gdb) c&lt;br /&gt;
 Continuing.&lt;br /&gt;
 Cannot access memory at address 0x0&lt;br /&gt;
 Program received signal SIGSEGV, Segmentation fault.&lt;br /&gt;
 0x403e1254 in ?? ()&lt;br /&gt;
 (gdb) bt&lt;br /&gt;
 #0  0x403e1254 in ?? ()&lt;br /&gt;
 Cannot access memory at address 0x302e3032&lt;br /&gt;
With debugggin symbols:&lt;br /&gt;
 opkg install matchbox-desktop-dbg&lt;br /&gt;
                 ...&lt;br /&gt;
 DISPLAY=:0.0 gdbserver 10.10.10.10:8090 matchbox-desktop #target&lt;br /&gt;
 root@gnutoo-desktop:/home/gnutoo/embedded/arm-2010q1/bin# ./arm-none-linux-gnueabi-gdb&lt;br /&gt;
 GNU gdb (Sourcery G++ Lite 2010q1-202) 7.0.50.20100218-cvs&lt;br /&gt;
 Copyright (C) 2010 Free Software Foundation, Inc.&lt;br /&gt;
 License GPLv3+: GNU GPL version 3 or later &amp;lt;http://gnu.org/licenses/gpl.html&amp;gt;&lt;br /&gt;
 This is free software: you are free to change and redistribute it.&lt;br /&gt;
 There is NO WARRANTY, to the extent permitted by law.  Type &amp;quot;show copying&amp;quot;&lt;br /&gt;
 and &amp;quot;show warranty&amp;quot; for details.&lt;br /&gt;
 This GDB was configured as &amp;quot;--host=i686-pc-linux-gnu --target=arm-none-linux-gnueabi&amp;quot;.&lt;br /&gt;
 For bug reporting instructions, please see:&lt;br /&gt;
 &amp;lt;https://support.codesourcery.com/GNUToolchain/&amp;gt;.&lt;br /&gt;
 (gdb) set sysroot /mnt/target/&lt;br /&gt;
 (gdb) file /mnt/target/usr/bin/matchbox-desktop&lt;br /&gt;
 Reading symbols from /mnt/target/usr/bin/matchbox-desktop...Reading symbols from /mnt/target/usr/bin/.debug/matchbox-desktop...done.&lt;br /&gt;
 done.&lt;br /&gt;
 (gdb) target remote 10.10.10.10:8090&lt;br /&gt;
 Remote debugging using 10.10.10.10:8090&lt;br /&gt;
 Reading symbols from /mnt/target/lib/ld-linux.so.3...Reading symbols from /mnt/target/lib/.debug/ld-2.9.so...done.&lt;br /&gt;
 done.&lt;br /&gt;
 Loaded symbols for /mnt/target/lib/ld-linux.so.3 &lt;br /&gt;
 0x400007e0 in _start () from /mnt/target/lib/ld-linux.so.3&lt;br /&gt;
 (gdb) c&lt;br /&gt;
 Continuing. &lt;br /&gt;
 Program received signal SIGSEGV, Segmentation fault.&lt;br /&gt;
 0x403e1254 in strlen () from /mnt/target/lib/libc.so.6&lt;br /&gt;
 (gdb) bt&lt;br /&gt;
 #0  0x403e1254 in strlen () from /mnt/target/lib/libc.so.6&lt;br /&gt;
 #1  0x4003350c in mb_pixbuf_img_new_from_file (pb=0x1fd58, filename=0x0) at mbpixbuf.c:1352&lt;br /&gt;
 #2  0x0000c8fc in mbdesktop_set_scroll_buttons (mb=0x1b008) at mbdesktop.c:689&lt;br /&gt;
 #3  0x0000d334 in mbdesktop_init (argc=&amp;lt;value optimized out&amp;gt;, argv=&amp;lt;value optimized out&amp;gt;) at mbdesktop.c:1022&lt;br /&gt;
 #4  0x0000e024 in main (argc=0, argv=0x0) at mbdesktop.c:1793&lt;br /&gt;
&lt;br /&gt;
Note that we have lines that looks like:&lt;br /&gt;
 #3  0x0000d334 in mbdesktop_init (argc=&amp;lt;value optimized out&amp;gt;, argv=&amp;lt;value optimized out&amp;gt;) at mbdesktop.c:1022&lt;br /&gt;
When we have the debug symbols.&lt;br /&gt;
The lack of some debug libs could result in a mix of lines like the one just shown above, and lines like that:&lt;br /&gt;
 #1  0x405ce03c in g_object_ref () from /home/gnutoo/embedded/sshfs/usr/lib/libgobject-2.0.so.0&lt;br /&gt;
Which means that the later lines don't have debug symbols(something went wrong).&lt;br /&gt;
&lt;br /&gt;
Also Note that if you have restricted space on the target,you could use NFS root if you have an ethernet connection.&lt;br /&gt;
&lt;br /&gt;
==== No packages ====&lt;br /&gt;
As I don't have packages which segfault at hand,I'll create a binary which segfault&lt;br /&gt;
First start exporting the path of the toolchain if it's not done yet:&lt;br /&gt;
 $ cd arm-2010q1/bin #codesourcey&lt;br /&gt;
 $ export PATH=$(pwd):$PATH&lt;br /&gt;
Then create a main.c file with the following content:&lt;br /&gt;
 #include &amp;lt;stdlib.h&amp;gt; &lt;br /&gt;
 struct test{ &lt;br /&gt;
 	struct test *crash;&lt;br /&gt;
 };&lt;br /&gt;
 int main(){&lt;br /&gt;
   struct test *test = NULL;&lt;br /&gt;
   test = test-&amp;gt;crash;&lt;br /&gt;
 }&lt;br /&gt;
Then compile it: &lt;br /&gt;
 $ arm-none-linux-gnueabi-gcc -ggdb3 -static -o binary main.c &lt;br /&gt;
*ggdb3 is for including as much debug informations as possible&lt;br /&gt;
*-static is only for our test,it's for avoiding runtime issues in case the libc is different or incompatible between codesourcey and our target(in case of ucilbc for instance)&lt;br /&gt;
&lt;br /&gt;
=== Cross or not crosss ===&lt;br /&gt;
A common error while using gdb,is using the wrong gdb. In order to debug a program that runs on a target from your host you need a cross gdb,that is to say a GDB that runs on your computer but can debug the target architecture.&lt;br /&gt;
Such version is normally included in your toolchain/SDK or buildable if you use a build system&lt;br /&gt;
&lt;br /&gt;
If you want to debug use GDB on target you can too,it's easier but has a huge drawback(amongs other) : ram usage (you can easily use too much memory and have an OOM(out of memory) )&lt;br /&gt;
==== Cross GDB ====&lt;br /&gt;
===== CodeSourcery Sourcery G++ Lite =====&lt;br /&gt;
Let's say that you downloaded arm-2010q1-202-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2&lt;br /&gt;
&lt;br /&gt;
You will need to unpack it,and to run the following command on your host computer (instead of just running gdb):&lt;br /&gt;
 cd arm-2010q1/bin&lt;br /&gt;
 ./arm-none-linux-gnueabi-gdb&lt;br /&gt;
&lt;br /&gt;
===== Openembedded =====&lt;br /&gt;
If your build system is also your debug workstation do:&lt;br /&gt;
 bitbake gdb-cross gdbserver&lt;br /&gt;
And it will build a cross gdb for your host and gdbserver for your target&lt;br /&gt;
The resulting binaries will be found in your TMPDIR here:&lt;br /&gt;
 /home/embedded/tmpdir/cross/armv6/bin/&lt;br /&gt;
replace &amp;quot;/home/embedded/tmpdir&amp;quot; by your tmpdir and armv6 by your target architecture&lt;br /&gt;
The binary name changes according to your distro settings,for me it was:&lt;br /&gt;
 arm-angstrom-linux-gnueabi-gdb&lt;br /&gt;
So in order to run it do:&lt;br /&gt;
./arm-angstrom-linux-gnueabi-gdb&lt;br /&gt;
===== Note on sources =====&lt;br /&gt;
If your workstation is not your build system,in order to view sources in gdb(else you will only have the path of the source file and the line number) look [http://sourceware.org/gdb/current/onlinedocs/gdb/Source-Path.html#set%20substitute-path here]&lt;br /&gt;
&lt;br /&gt;
Without the sources path:&lt;br /&gt;
 (gdb) bt&lt;br /&gt;
 #0  0x403e1254 in strlen () from /mnt/target/lib/libc.so.6&lt;br /&gt;
 #1  0x4003350c in mb_pixbuf_img_new_from_file (pb=0x1fd58, filename=0x0) at mbpixbuf.c:1352&lt;br /&gt;
 #2  0x0000c8fc in mbdesktop_set_scroll_buttons (mb=0x1b008) at mbdesktop.c:689&lt;br /&gt;
 #3  0x0000d334 in mbdesktop_init (argc=&amp;lt;value optimized out&amp;gt;, argv=&amp;lt;value optimized out&amp;gt;) at mbdesktop.c:1022&lt;br /&gt;
 #4  0x0000e024 in main (argc=0, argv=0x0) at mbdesktop.c:1793&lt;br /&gt;
 (gdb) f 0&lt;br /&gt;
 #0  0x403e1254 in strlen () from /mnt/target/lib/libc.so.6&lt;br /&gt;
 (gdb) l&lt;br /&gt;
 1784	mbdesktop.c: No such file or directory. &lt;br /&gt;
 	in mbdesktop.c&lt;br /&gt;
 (gdb)&lt;br /&gt;
With the sources path set:&lt;br /&gt;
 (gdb) set substitute-path / /media/port4&lt;br /&gt;
 (gdb) bt&lt;br /&gt;
 #0  0x403e1254 in strlen () from /mnt/target/lib/libc.so.6&lt;br /&gt;
 #1  0x4003350c in mb_pixbuf_img_new_from_file (pb=0x1fd58, filename=0x0) at mbpixbuf.c:1352&lt;br /&gt;
 #2  0x0000c8fc in mbdesktop_set_scroll_buttons (mb=0x1b008) at mbdesktop.c:689&lt;br /&gt;
 #3  0x0000d334 in mbdesktop_init (argc=&amp;lt;value optimized out&amp;gt;, argv=&amp;lt;value optimized out&amp;gt;) at mbdesktop.c:1022&lt;br /&gt;
 #4  0x0000e024 in main (argc=0, argv=0x0) at mbdesktop.c:1793&lt;br /&gt;
 (gdb) f 0&lt;br /&gt;
 #0  0x403e1254 in strlen () from /mnt/target/lib/libc.so.6&lt;br /&gt;
 (gdb) l&lt;br /&gt;
 1784	      fprintf(stderr, &amp;quot;matchbox-desktop: failed to load any item modules.\n&amp;quot;);&lt;br /&gt;
 1785	    }&lt;br /&gt;
 1786	}&lt;br /&gt;
 1787	 &lt;br /&gt;
 1788	int &lt;br /&gt;
 1789	main(int argc, char **argv)&lt;br /&gt;
 1790	{&lt;br /&gt;
 1791	  MBDesktop *mb;&lt;br /&gt;
 1792	&lt;br /&gt;
 1793	  mb = mbdesktop_init(argc, argv);&lt;br /&gt;
/media/port4 beeing where the root filesystem of the build system is mounted(could be sshfs,NSF etc...)&lt;br /&gt;
&lt;br /&gt;
===== Howto =====&lt;br /&gt;
If you have networking,it's advised to choose it because it will be faster than serial,but if you only have serial choose serial&lt;br /&gt;
====== Core dump ======&lt;br /&gt;
Sometimes you can get a coredump.&lt;br /&gt;
A man page describing the core dump,and in which condition it can occur can be found [http://www.kernel.org/doc/man-pages/online/pages/man5/core.5.html here]&lt;br /&gt;
In order to make possible core dumps(that unlimit the size limit on coredumps)&lt;br /&gt;
 target/device$ ulimit -c unlimited&lt;br /&gt;
Then run your binary:&lt;br /&gt;
 target/device$ ./binary&lt;br /&gt;
Then reproduce the conditions under which the coredump happen.The core file will appear in your current working directory and will be named core&lt;br /&gt;
&lt;br /&gt;
Then copy the coredump to your workstation,and run gdb on your workstation(core is assumed to be in the current directory)&lt;br /&gt;
 ./arm-angstrom-linux-gnueabi-gdb &lt;br /&gt;
 (gdb) set sysroot /mnt/target&lt;br /&gt;
 (gdb) file /mnt/moko/usr/bin/binary&lt;br /&gt;
 (gdb) target core core&lt;br /&gt;
&lt;br /&gt;
====== Networking ======&lt;br /&gt;
Fist start gdbserver on the target:&lt;br /&gt;
 target/device$ gdbserver :2345 ./binary arg1 arg2&lt;br /&gt;
Note that will expose a gdb session to all networking interfaces,for instance if you have wifi on,someone could connect to it.&lt;br /&gt;
So if you don't want that,make it listen only on your the ip of the target interface you want to use for debugging:&lt;br /&gt;
 target/device$ gdbserver 192.168.0.202:2345 ./binary arg1 arg2&lt;br /&gt;
Then start GDB on your workstation,but do not connect to the target yet(else you'll have some undefined symbols):&lt;br /&gt;
 host/pc$ ./arm-angstrom-linux-gnueabi-gdb&lt;br /&gt;
 GNU gdb (Sourcery G++ Lite 2010q1-202) 7.0.50.20100218-cvs&lt;br /&gt;
 Copyright (C) 2010 Free Software Foundation, Inc.&lt;br /&gt;
 License GPLv3+: GNU GPL version 3 or later &amp;lt;http://gnu.org/licenses/gpl.html&amp;gt;&lt;br /&gt;
 This is free software: you are free to change and redistribute it.&lt;br /&gt;
 There is NO WARRANTY, to the extent permitted by law.  Type &amp;quot;show copying&amp;quot;&lt;br /&gt;
 and &amp;quot;show warranty&amp;quot; for details.&lt;br /&gt;
 This GDB was configured as &amp;quot;--host=i686-pc-linux-gnu --target=arm-none-linux-gnueabi&amp;quot;.&lt;br /&gt;
 For bug reporting instructions, please see:&lt;br /&gt;
 &amp;lt;https://support.codesourcery.com/GNUToolchain/&amp;gt;.&lt;br /&gt;
 (gdb) &lt;br /&gt;
&lt;br /&gt;
Then you need access to the target filesystem,knowing that we have networking we could use the following options:&lt;br /&gt;
*sshfs:&lt;br /&gt;
In order to use sshfs you need sftp-server installed on the target,and sshfs installed on the host computer.&lt;br /&gt;
To mount the filesystem do:&lt;br /&gt;
 mkdir /mnt/target/&lt;br /&gt;
 sudo sshfs root@192.168.0.202:/ /mnt/target/ -o allow_other&lt;br /&gt;
*NFS(maybe you already had nfsroot on the target)&lt;br /&gt;
*any other system that export the filesystem,and that is mountable&lt;br /&gt;
&lt;br /&gt;
Then you need to set a variable called sysroot in order to make the cross gdb find the libraries to load&lt;br /&gt;
 (gdb) set sysroot /mnt/target&lt;br /&gt;
Then load the binary:&lt;br /&gt;
 (gdb) file /mnt/target/usr/bin/binary&lt;br /&gt;
 Reading symbols from /mnt/target/usr/bin/binary...Reading symbols from /mnt/moko/usr/bin/.debug/binary...done. &lt;br /&gt;
And finally connect to the target:&lt;br /&gt;
 (gdb) target remote 192.168.0.202:2345&lt;br /&gt;
&lt;br /&gt;
====== Serial ======&lt;br /&gt;
First set the serial port speed on the target(before you issue the gdbserver command):&lt;br /&gt;
  stty speed 115200 &amp;lt; /dev/ttyS1&lt;br /&gt;
Then start gdbserver on the target:&lt;br /&gt;
 target/device$ gdbserver /dev/ttyS1 ./binary arg1 arg2&lt;br /&gt;
That will freeze the program until you connect with the cross gdb version and that you type &amp;quot;c&amp;quot; for continuing the execution of the program.&lt;br /&gt;
Note that GDB will slow the program a lot. if you have a program that uses a lot of resources,it's advised to attach to it just before the crash instead like that:&lt;br /&gt;
 target/device$ gdbserver /dev/ttyS1 --attach PID&lt;br /&gt;
Then do that on your workstation&lt;br /&gt;
 host/pc$ ./arm-angstrom-linux-gnueabi-gdb&lt;br /&gt;
 (gdb) target remote /dev/ttyS1&lt;br /&gt;
If you are using the serial method you need to make sure you have setup the serial speed correctly,&lt;br /&gt;
On the host:&lt;br /&gt;
  (gdb) set remotebaud 115200&lt;br /&gt;
&lt;br /&gt;
==== Non-cross(native) GDB ====&lt;br /&gt;
===== Howto =====&lt;br /&gt;
To start a new application for debug, use:&lt;br /&gt;
&lt;br /&gt;
  $ gdb ./binary&lt;br /&gt;
  $ gdb ./binary core.dump&lt;br /&gt;
  $ gdb --args ./binary arg1 arg2&lt;br /&gt;
  $ gdb --command=my-gdb-commands.txt --args ./binary arg1 arg2&lt;br /&gt;
&lt;br /&gt;
and then run it with (args just required if no --args were used):&lt;br /&gt;
&lt;br /&gt;
  (gdb) run arg1 arg2&lt;br /&gt;
&lt;br /&gt;
If application is already running, find out its pid (ps, top, pidof, ...) and:&lt;br /&gt;
&lt;br /&gt;
 $ gdb --pid $PID&lt;br /&gt;
&lt;br /&gt;
=== Tips ===&lt;br /&gt;
if you need to execute a series of commands every time, consider writing them on a file and use &amp;lt;code&amp;gt;--command=file&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;-x file&amp;lt;/code&amp;gt;).&lt;br /&gt;
=== Breakpoints ===&lt;br /&gt;
&lt;br /&gt;
If you control-C (^C), it will break at that point, but you can also schedule a breakpoint with:&lt;br /&gt;
&lt;br /&gt;
 (gdb) break function&lt;br /&gt;
 (gdb) break line&lt;br /&gt;
 (gdb) break file:function&lt;br /&gt;
 (gdb) break file:line&lt;br /&gt;
&lt;br /&gt;
conditional breaks are in the form:&lt;br /&gt;
&lt;br /&gt;
 (gdb) break where if condition&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;condition&amp;lt;/code&amp;gt; is some C expression that evaluates to 1 or 0, like &amp;lt;code&amp;gt;*ptr == NULL&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
One can disable or remove breakpoints with:&lt;br /&gt;
 (gdb) enable breakpoint-number&lt;br /&gt;
 (gdb) disable breakpoint-number&lt;br /&gt;
 (gdb) delete breakpoint-number&lt;br /&gt;
 (gdb) clear       # removes all breakpoints&lt;br /&gt;
&lt;br /&gt;
=== Examining ===&lt;br /&gt;
&lt;br /&gt;
To list source code nearby position or specific places:&lt;br /&gt;
 (gdb) list&lt;br /&gt;
 (gdb) list line&lt;br /&gt;
 (gdb) list function&lt;br /&gt;
 (gdb) list file:line&lt;br /&gt;
 (gdb) list file:function&lt;br /&gt;
 (gdb) list *address&lt;br /&gt;
&lt;br /&gt;
To list execution backtrace (or &amp;lt;code&amp;gt;bt&amp;lt;/code&amp;gt; for short):&lt;br /&gt;
 (gdb) backtrace&lt;br /&gt;
&lt;br /&gt;
To change frame to operate on:&lt;br /&gt;
 (gdb) frame frame-number&lt;br /&gt;
&lt;br /&gt;
To change thread to operate on:&lt;br /&gt;
 (gdb) thread thread-number&lt;br /&gt;
&lt;br /&gt;
To print some value or expression:&lt;br /&gt;
 (gdb) print $register&lt;br /&gt;
 (gdb) print variable&lt;br /&gt;
 (gdb) print *address&lt;br /&gt;
 (gdb) print *(int *)address&lt;br /&gt;
 (gdb) print *(char **)address&lt;br /&gt;
 (gdb) print myfunc(p1, p2) # will actually execute it and return result!&lt;br /&gt;
 (gdb) print *a = 123 # will actually change *a value and return 123!&lt;br /&gt;
 (gdb) print file::variable&lt;br /&gt;
 (gdb) print function::variable&lt;br /&gt;
&lt;br /&gt;
To disassembly:&lt;br /&gt;
 (gdb) disassembly&lt;br /&gt;
 (gdb) disassembly file:line&lt;br /&gt;
&lt;br /&gt;
Print function arguments:&lt;br /&gt;
 (gdb) info args&lt;br /&gt;
&lt;br /&gt;
Print locals:&lt;br /&gt;
 (gdb) info locals&lt;br /&gt;
&lt;br /&gt;
Print breakpoints:&lt;br /&gt;
 (gdb) info breakpoints&lt;br /&gt;
&lt;br /&gt;
Print threads:&lt;br /&gt;
 (gdb) info threads&lt;br /&gt;
&lt;br /&gt;
=== Stepping ===&lt;br /&gt;
&lt;br /&gt;
To go to next instruction, possible entering a function (or &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt; for short):&lt;br /&gt;
 (gdb) step&lt;br /&gt;
&lt;br /&gt;
To go to next instruction, but avoid entering new functions (or &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; for short):&lt;br /&gt;
 (gdb) next&lt;br /&gt;
&lt;br /&gt;
To continue until the function returns:&lt;br /&gt;
 (gdb) finish&lt;br /&gt;
&lt;br /&gt;
To continue execution (or &amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt; for short):&lt;br /&gt;
 (gdb) continue&lt;br /&gt;
&lt;br /&gt;
=== Manipulating Program ===&lt;br /&gt;
&lt;br /&gt;
To set variable to some value:&lt;br /&gt;
 (gdb) set var name=value&lt;br /&gt;
&lt;br /&gt;
To force function to return:&lt;br /&gt;
 (gdb) return value&lt;br /&gt;
 (gdb) return expression&lt;br /&gt;
&lt;br /&gt;
=== Changing Signal Handlers ===&lt;br /&gt;
&lt;br /&gt;
 (gdb) handle signal action&lt;br /&gt;
&lt;br /&gt;
debugging applications with old libC, those pre-nptl, can be really annoying due SIG32 and SIG33, one can ignore those with:&lt;br /&gt;
 (gdb) handle SIG32 nostop&lt;br /&gt;
 (gdb) handle SIG32 noprint&lt;br /&gt;
 (gdb) handle SIG33 nostop&lt;br /&gt;
 (gdb) handle SIG33 noprint&lt;br /&gt;
&lt;br /&gt;
=== Shared Object Paths ===&lt;br /&gt;
&lt;br /&gt;
Often your cross compile root is not &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt;, so you might have to add new paths to the search list.&lt;br /&gt;
&lt;br /&gt;
Unset absolute prefix:&lt;br /&gt;
  (gdb) set solib-absolute-prefix null&lt;br /&gt;
&lt;br /&gt;
Add paths to search paths:&lt;br /&gt;
  (gdb) set solib-search-path /path1:/path2&lt;br /&gt;
&lt;br /&gt;
Alternatively you can choose to set the prefix to the root of your target file system. Specially if you are doing&lt;br /&gt;
embedded development and already exporting your root file system from you host machine to your target machine it can &lt;br /&gt;
be very rewarding so simply use that as root:&lt;br /&gt;
  (gdb) set solib-absolute-prefix /rootfs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Appendix: Starting application debug from host on the fly ===&lt;br /&gt;
Gdbserver could be run in multi-process mode where applications are started or processes connected to remotely, on the fly.&lt;br /&gt;
 gdbserver --multi :2345&lt;br /&gt;
&lt;br /&gt;
Run crosscompiled gdb on host (&amp;lt;gcc_toolchain_path&amp;gt;/bin/arm-none-linux-gnueabi-gdb &amp;lt;application&amp;gt;&lt;br /&gt;
Issue the following commands (multiprocess example):&lt;br /&gt;
 file &amp;lt;application&amp;gt;&lt;br /&gt;
 target extended remote &amp;lt;target_ip&amp;gt;:2345&lt;br /&gt;
 set remote exec-file &amp;lt;path/application&amp;gt;&lt;br /&gt;
 set solib-absolute-prefix  &amp;lt;rootfs_path&amp;gt;&lt;br /&gt;
 set solib-search-path  &amp;lt;targetlib_path&amp;gt;/lib: &amp;lt;targetlib_path&amp;gt;/usr/lib&lt;br /&gt;
 break main&lt;br /&gt;
 continue&lt;br /&gt;
&lt;br /&gt;
[[Category:Tools]]&lt;/div&gt;</summary>
		<author><name>Tord</name></author>	</entry>

	<entry>
		<id>http://elinux.org/GDB</id>
		<title>GDB</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/GDB"/>
				<updated>2011-10-27T23:33:32Z</updated>
		
		<summary type="html">&lt;p&gt;Tord: /* Shared Object Paths */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The GNU Debugger GDB is the most common debug tool for Linux. It features most used features one can think of, including server-client debug architecture (so you run the heavy debug part on your host/pc machine), but lack some bits as checkpoint-restart during execution.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
&lt;br /&gt;
GDB ships with extensive documentation at http://www.gnu.org/software/gdb/documentation/, but there are some good [http://refcards.com/docs/peschr/gdb/gdb-refcard-a4.pdf quick reference cards] as well.&lt;br /&gt;
&lt;br /&gt;
== Basic Usage ==&lt;br /&gt;
&lt;br /&gt;
Documentation is so large that sometimes its hard to get started, so most simple tasks can be done with the following commands, but please read GDB docs as soon as possible!&lt;br /&gt;
&lt;br /&gt;
=== Debug version ===&lt;br /&gt;
==== Debug packages ====&lt;br /&gt;
First note that in order to use GDB in an efficient way,you need the debug packages,that is to say the -dbg version of your package.&lt;br /&gt;
Under the opkg package management if you installed a binary like that:&lt;br /&gt;
 opkg install binary&lt;br /&gt;
you need to install the debug part of it:&lt;br /&gt;
 opkg install binary-dbg&lt;br /&gt;
&lt;br /&gt;
Without debug packages you will be limited to assembly debugging(no source level debugging)&lt;br /&gt;
&lt;br /&gt;
Here are some example of how usefull is debug symbols:&lt;br /&gt;
&lt;br /&gt;
Without debug symbols:&lt;br /&gt;
 DISPLAY=:0.0 gdbserver 10.10.10.10:8090 matchbox-desktop #target&lt;br /&gt;
 &lt;br /&gt;
 gnutoo@gnutoo-desktop:~/embedded/arm-2010q1/bin$ ./arm-none-linux-gnueabi-gdb&lt;br /&gt;
 GNU gdb (Sourcery G++ Lite 2010q1-202) 7.0.50.20100218-cvs&lt;br /&gt;
 Copyright (C) 2010 Free Software Foundation, Inc.&lt;br /&gt;
 License GPLv3+: GNU GPL version 3 or later &amp;lt;http://gnu.org/licenses/gpl.html&amp;gt;&lt;br /&gt;
 This is free software: you are free to change and redistribute it.&lt;br /&gt;
 There is NO WARRANTY, to the extent permitted by law.  Type &amp;quot;show copying&amp;quot;&lt;br /&gt;
 and &amp;quot;show warranty&amp;quot; for details.&lt;br /&gt;
 This GDB was configured as &amp;quot;--host=i686-pc-linux-gnu --target=arm-none-linux-gnueabi&amp;quot;.&lt;br /&gt;
 For bug reporting instructions, please see:&lt;br /&gt;
 &amp;lt;https://support.codesourcery.com/GNUToolchain/&amp;gt;.&lt;br /&gt;
 (gdb) target remote 10.10.10.10:8090&lt;br /&gt;
 Remote debugging using 10.10.10.10:8090&lt;br /&gt;
 0x400007e0 in ?? ()&lt;br /&gt;
 (gdb) c&lt;br /&gt;
 Continuing.&lt;br /&gt;
 Cannot access memory at address 0x0&lt;br /&gt;
 Program received signal SIGSEGV, Segmentation fault.&lt;br /&gt;
 0x403e1254 in ?? ()&lt;br /&gt;
 (gdb) bt&lt;br /&gt;
 #0  0x403e1254 in ?? ()&lt;br /&gt;
 Cannot access memory at address 0x302e3032&lt;br /&gt;
With debugggin symbols:&lt;br /&gt;
 opkg install matchbox-desktop-dbg&lt;br /&gt;
                 ...&lt;br /&gt;
 DISPLAY=:0.0 gdbserver 10.10.10.10:8090 matchbox-desktop #target&lt;br /&gt;
 root@gnutoo-desktop:/home/gnutoo/embedded/arm-2010q1/bin# ./arm-none-linux-gnueabi-gdb&lt;br /&gt;
 GNU gdb (Sourcery G++ Lite 2010q1-202) 7.0.50.20100218-cvs&lt;br /&gt;
 Copyright (C) 2010 Free Software Foundation, Inc.&lt;br /&gt;
 License GPLv3+: GNU GPL version 3 or later &amp;lt;http://gnu.org/licenses/gpl.html&amp;gt;&lt;br /&gt;
 This is free software: you are free to change and redistribute it.&lt;br /&gt;
 There is NO WARRANTY, to the extent permitted by law.  Type &amp;quot;show copying&amp;quot;&lt;br /&gt;
 and &amp;quot;show warranty&amp;quot; for details.&lt;br /&gt;
 This GDB was configured as &amp;quot;--host=i686-pc-linux-gnu --target=arm-none-linux-gnueabi&amp;quot;.&lt;br /&gt;
 For bug reporting instructions, please see:&lt;br /&gt;
 &amp;lt;https://support.codesourcery.com/GNUToolchain/&amp;gt;.&lt;br /&gt;
 (gdb) set sysroot /mnt/target/&lt;br /&gt;
 (gdb) file /mnt/target/usr/bin/matchbox-desktop&lt;br /&gt;
 Reading symbols from /mnt/target/usr/bin/matchbox-desktop...Reading symbols from /mnt/target/usr/bin/.debug/matchbox-desktop...done.&lt;br /&gt;
 done.&lt;br /&gt;
 (gdb) target remote 10.10.10.10:8090&lt;br /&gt;
 Remote debugging using 10.10.10.10:8090&lt;br /&gt;
 Reading symbols from /mnt/target/lib/ld-linux.so.3...Reading symbols from /mnt/target/lib/.debug/ld-2.9.so...done.&lt;br /&gt;
 done.&lt;br /&gt;
 Loaded symbols for /mnt/target/lib/ld-linux.so.3 &lt;br /&gt;
 0x400007e0 in _start () from /mnt/target/lib/ld-linux.so.3&lt;br /&gt;
 (gdb) c&lt;br /&gt;
 Continuing. &lt;br /&gt;
 Program received signal SIGSEGV, Segmentation fault.&lt;br /&gt;
 0x403e1254 in strlen () from /mnt/target/lib/libc.so.6&lt;br /&gt;
 (gdb) bt&lt;br /&gt;
 #0  0x403e1254 in strlen () from /mnt/target/lib/libc.so.6&lt;br /&gt;
 #1  0x4003350c in mb_pixbuf_img_new_from_file (pb=0x1fd58, filename=0x0) at mbpixbuf.c:1352&lt;br /&gt;
 #2  0x0000c8fc in mbdesktop_set_scroll_buttons (mb=0x1b008) at mbdesktop.c:689&lt;br /&gt;
 #3  0x0000d334 in mbdesktop_init (argc=&amp;lt;value optimized out&amp;gt;, argv=&amp;lt;value optimized out&amp;gt;) at mbdesktop.c:1022&lt;br /&gt;
 #4  0x0000e024 in main (argc=0, argv=0x0) at mbdesktop.c:1793&lt;br /&gt;
&lt;br /&gt;
Note that we have lines that looks like:&lt;br /&gt;
 #3  0x0000d334 in mbdesktop_init (argc=&amp;lt;value optimized out&amp;gt;, argv=&amp;lt;value optimized out&amp;gt;) at mbdesktop.c:1022&lt;br /&gt;
When we have the debug symbols.&lt;br /&gt;
The lack of some debug libs could result in a mix of lines like the one just shown above, and lines like that:&lt;br /&gt;
 #1  0x405ce03c in g_object_ref () from /home/gnutoo/embedded/sshfs/usr/lib/libgobject-2.0.so.0&lt;br /&gt;
Which means that the later lines don't have debug symbols(something went wrong).&lt;br /&gt;
&lt;br /&gt;
Also Note that if you have restricted space on the target,you could use NFS root if you have an ethernet connection.&lt;br /&gt;
&lt;br /&gt;
==== No packages ====&lt;br /&gt;
As I don't have packages which segfault at hand,I'll create a binary which segfault&lt;br /&gt;
First start exporting the path of the toolchain if it's not done yet:&lt;br /&gt;
 $ cd arm-2010q1/bin #codesourcey&lt;br /&gt;
 $ export PATH=$(pwd):$PATH&lt;br /&gt;
Then create a main.c file with the following content:&lt;br /&gt;
 #include &amp;lt;stdlib.h&amp;gt; &lt;br /&gt;
 struct test{ &lt;br /&gt;
 	struct test *crash;&lt;br /&gt;
 };&lt;br /&gt;
 int main(){&lt;br /&gt;
   struct test *test = NULL;&lt;br /&gt;
   test = test-&amp;gt;crash;&lt;br /&gt;
 }&lt;br /&gt;
Then compile it: &lt;br /&gt;
 $ arm-none-linux-gnueabi-gcc -ggdb3 -static -o binary main.c &lt;br /&gt;
*ggdb3 is for including as much debug informations as possible&lt;br /&gt;
*-static is only for our test,it's for avoiding runtime issues in case the libc is different or incompatible between codesourcey and our target(in case of ucilbc for instance)&lt;br /&gt;
&lt;br /&gt;
=== Cross or not crosss ===&lt;br /&gt;
A common error while using gdb,is using the wrong gdb. In order to debug a program that runs on a target from your host you need a cross gdb,that is to say a GDB that runs on your computer but can debug the target architecture.&lt;br /&gt;
Such version is normally included in your toolchain/SDK or buildable if you use a build system&lt;br /&gt;
&lt;br /&gt;
If you want to debug use GDB on target you can too,it's easier but has a huge drawback(amongs other) : ram usage (you can easily use too much memory and have an OOM(out of memory) )&lt;br /&gt;
==== Cross GDB ====&lt;br /&gt;
===== CodeSourcery Sourcery G++ Lite =====&lt;br /&gt;
Let's say that you downloaded arm-2010q1-202-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2&lt;br /&gt;
&lt;br /&gt;
You will need to unpack it,and to run the following command on your host computer (instead of just running gdb):&lt;br /&gt;
 cd arm-2010q1/bin&lt;br /&gt;
 ./arm-none-linux-gnueabi-gdb&lt;br /&gt;
&lt;br /&gt;
===== Openembedded =====&lt;br /&gt;
If your build system is also your debug workstation do:&lt;br /&gt;
 bitbake gdb-cross gdbserver&lt;br /&gt;
And it will build a cross gdb for your host and gdbserver for your target&lt;br /&gt;
The resulting binaries will be found in your TMPDIR here:&lt;br /&gt;
 /home/embedded/tmpdir/cross/armv6/bin/&lt;br /&gt;
replace &amp;quot;/home/embedded/tmpdir&amp;quot; by your tmpdir and armv6 by your target architecture&lt;br /&gt;
The binary name changes according to your distro settings,for me it was:&lt;br /&gt;
 arm-angstrom-linux-gnueabi-gdb&lt;br /&gt;
So in order to run it do:&lt;br /&gt;
./arm-angstrom-linux-gnueabi-gdb&lt;br /&gt;
===== Note on sources =====&lt;br /&gt;
If your workstation is not your build system,in order to view sources in gdb(else you will only have the path of the source file and the line number) look [http://sourceware.org/gdb/current/onlinedocs/gdb/Source-Path.html#set%20substitute-path here]&lt;br /&gt;
&lt;br /&gt;
Without the sources path:&lt;br /&gt;
 (gdb) bt&lt;br /&gt;
 #0  0x403e1254 in strlen () from /mnt/target/lib/libc.so.6&lt;br /&gt;
 #1  0x4003350c in mb_pixbuf_img_new_from_file (pb=0x1fd58, filename=0x0) at mbpixbuf.c:1352&lt;br /&gt;
 #2  0x0000c8fc in mbdesktop_set_scroll_buttons (mb=0x1b008) at mbdesktop.c:689&lt;br /&gt;
 #3  0x0000d334 in mbdesktop_init (argc=&amp;lt;value optimized out&amp;gt;, argv=&amp;lt;value optimized out&amp;gt;) at mbdesktop.c:1022&lt;br /&gt;
 #4  0x0000e024 in main (argc=0, argv=0x0) at mbdesktop.c:1793&lt;br /&gt;
 (gdb) f 0&lt;br /&gt;
 #0  0x403e1254 in strlen () from /mnt/target/lib/libc.so.6&lt;br /&gt;
 (gdb) l&lt;br /&gt;
 1784	mbdesktop.c: No such file or directory. &lt;br /&gt;
 	in mbdesktop.c&lt;br /&gt;
 (gdb)&lt;br /&gt;
With the sources path set:&lt;br /&gt;
 (gdb) set substitute-path / /media/port4&lt;br /&gt;
 (gdb) bt&lt;br /&gt;
 #0  0x403e1254 in strlen () from /mnt/target/lib/libc.so.6&lt;br /&gt;
 #1  0x4003350c in mb_pixbuf_img_new_from_file (pb=0x1fd58, filename=0x0) at mbpixbuf.c:1352&lt;br /&gt;
 #2  0x0000c8fc in mbdesktop_set_scroll_buttons (mb=0x1b008) at mbdesktop.c:689&lt;br /&gt;
 #3  0x0000d334 in mbdesktop_init (argc=&amp;lt;value optimized out&amp;gt;, argv=&amp;lt;value optimized out&amp;gt;) at mbdesktop.c:1022&lt;br /&gt;
 #4  0x0000e024 in main (argc=0, argv=0x0) at mbdesktop.c:1793&lt;br /&gt;
 (gdb) f 0&lt;br /&gt;
 #0  0x403e1254 in strlen () from /mnt/target/lib/libc.so.6&lt;br /&gt;
 (gdb) l&lt;br /&gt;
 1784	      fprintf(stderr, &amp;quot;matchbox-desktop: failed to load any item modules.\n&amp;quot;);&lt;br /&gt;
 1785	    }&lt;br /&gt;
 1786	}&lt;br /&gt;
 1787	 &lt;br /&gt;
 1788	int &lt;br /&gt;
 1789	main(int argc, char **argv)&lt;br /&gt;
 1790	{&lt;br /&gt;
 1791	  MBDesktop *mb;&lt;br /&gt;
 1792	&lt;br /&gt;
 1793	  mb = mbdesktop_init(argc, argv);&lt;br /&gt;
/media/port4 beeing where the root filesystem of the build system is mounted(could be sshfs,NSF etc...)&lt;br /&gt;
&lt;br /&gt;
===== Howto =====&lt;br /&gt;
If you have networking,it's advised to choose it because it will be faster than serial,but if you only have serial choose serial&lt;br /&gt;
====== Core dump ======&lt;br /&gt;
Sometimes you can get a coredump.&lt;br /&gt;
A man page describing the core dump,and in which condition it can occur can be found [http://www.kernel.org/doc/man-pages/online/pages/man5/core.5.html here]&lt;br /&gt;
In order to make possible core dumps(that unlimit the size limit on coredumps)&lt;br /&gt;
 target/device$ ulimit -c unlimited&lt;br /&gt;
Then run your binary:&lt;br /&gt;
 target/device$ ./binary&lt;br /&gt;
Then reproduce the conditions under which the coredump happen.The core file will appear in your current working directory and will be named core&lt;br /&gt;
&lt;br /&gt;
Then copy the coredump to your workstation,and run gdb on your workstation(core is assumed to be in the current directory)&lt;br /&gt;
 ./arm-angstrom-linux-gnueabi-gdb &lt;br /&gt;
 (gdb) set sysroot /mnt/target&lt;br /&gt;
 (gdb) file /mnt/moko/usr/bin/binary&lt;br /&gt;
 (gdb) target core core&lt;br /&gt;
&lt;br /&gt;
====== Networking ======&lt;br /&gt;
Fist start gdbserver on the target:&lt;br /&gt;
 target/device$ gdbserver :2345 ./binary arg1 arg2&lt;br /&gt;
Note that will expose a gdb session to all networking interfaces,for instance if you have wifi on,someone could connect to it.&lt;br /&gt;
So if you don't want that,make it listen only on your the ip of the target interface you want to use for debugging:&lt;br /&gt;
 target/device$ gdbserver 192.168.0.202:2345 ./binary arg1 arg2&lt;br /&gt;
Then start GDB on your workstation,but do not connect to the target yet(else you'll have some undefined symbols):&lt;br /&gt;
 host/pc$ ./arm-angstrom-linux-gnueabi-gdb&lt;br /&gt;
 GNU gdb (Sourcery G++ Lite 2010q1-202) 7.0.50.20100218-cvs&lt;br /&gt;
 Copyright (C) 2010 Free Software Foundation, Inc.&lt;br /&gt;
 License GPLv3+: GNU GPL version 3 or later &amp;lt;http://gnu.org/licenses/gpl.html&amp;gt;&lt;br /&gt;
 This is free software: you are free to change and redistribute it.&lt;br /&gt;
 There is NO WARRANTY, to the extent permitted by law.  Type &amp;quot;show copying&amp;quot;&lt;br /&gt;
 and &amp;quot;show warranty&amp;quot; for details.&lt;br /&gt;
 This GDB was configured as &amp;quot;--host=i686-pc-linux-gnu --target=arm-none-linux-gnueabi&amp;quot;.&lt;br /&gt;
 For bug reporting instructions, please see:&lt;br /&gt;
 &amp;lt;https://support.codesourcery.com/GNUToolchain/&amp;gt;.&lt;br /&gt;
 (gdb) &lt;br /&gt;
&lt;br /&gt;
Then you need access to the target filesystem,knowing that we have networking we could use the following options:&lt;br /&gt;
*sshfs:&lt;br /&gt;
In order to use sshfs you need sftp-server installed on the target,and sshfs installed on the host computer.&lt;br /&gt;
To mount the filesystem do:&lt;br /&gt;
 mkdir /mnt/target/&lt;br /&gt;
 sudo sshfs root@192.168.0.202:/ /mnt/target/ -o allow_other&lt;br /&gt;
*NFS(maybe you already had nfsroot on the target)&lt;br /&gt;
*any other system that export the filesystem,and that is mountable&lt;br /&gt;
&lt;br /&gt;
Then you need to set a variable called sysroot in order to make the cross gdb find the libraries to load&lt;br /&gt;
 (gdb) set sysroot /mnt/target&lt;br /&gt;
Then load the binary:&lt;br /&gt;
 (gdb) file /mnt/target/usr/bin/binary&lt;br /&gt;
 Reading symbols from /mnt/target/usr/bin/binary...Reading symbols from /mnt/moko/usr/bin/.debug/binary...done. &lt;br /&gt;
And finally connect to the target:&lt;br /&gt;
 (gdb) target remote 192.168.0.202:2345&lt;br /&gt;
&lt;br /&gt;
====== Serial ======&lt;br /&gt;
First set the serial port speed on the target(before you issue the gdbserver command):&lt;br /&gt;
  stty speed 115200 &amp;lt; /dev/ttyS1&lt;br /&gt;
Then start gdbserver on the target:&lt;br /&gt;
 target/device$ gdbserver /dev/ttyS1 ./binary arg1 arg2&lt;br /&gt;
That will freeze the program until you connect with the cross gdb version and that you type &amp;quot;c&amp;quot; for continuing the execution of the program.&lt;br /&gt;
Note that GDB will slow the program a lot. if you have a program that uses a lot of resources,it's advised to attach to it just before the crash instead like that:&lt;br /&gt;
 target/device$ gdbserver /dev/ttyS1 --attach PID&lt;br /&gt;
Then do that on your workstation&lt;br /&gt;
 host/pc$ ./arm-angstrom-linux-gnueabi-gdb&lt;br /&gt;
 (gdb) target remote /dev/ttyS1&lt;br /&gt;
If you are using the serial method you need to make sure you have setup the serial speed correctly,&lt;br /&gt;
On the host:&lt;br /&gt;
  (gdb) set remotebaud 115200&lt;br /&gt;
&lt;br /&gt;
==== Non-cross(native) GDB ====&lt;br /&gt;
===== Howto =====&lt;br /&gt;
To start a new application for debug, use:&lt;br /&gt;
&lt;br /&gt;
  $ gdb ./binary&lt;br /&gt;
  $ gdb ./binary core.dump&lt;br /&gt;
  $ gdb --args ./binary arg1 arg2&lt;br /&gt;
  $ gdb --command=my-gdb-commands.txt --args ./binary arg1 arg2&lt;br /&gt;
&lt;br /&gt;
and then run it with (args just required if no --args were used):&lt;br /&gt;
&lt;br /&gt;
  (gdb) run arg1 arg2&lt;br /&gt;
&lt;br /&gt;
If application is already running, find out its pid (ps, top, pidof, ...) and:&lt;br /&gt;
&lt;br /&gt;
 $ gdb --pid $PID&lt;br /&gt;
&lt;br /&gt;
=== Tips ===&lt;br /&gt;
if you need to execute a series of commands every time, consider writing them on a file and use &amp;lt;code&amp;gt;--command=file&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;-x file&amp;lt;/code&amp;gt;).&lt;br /&gt;
=== Breakpoints ===&lt;br /&gt;
&lt;br /&gt;
If you control-C (^C), it will break at that point, but you can also schedule a breakpoint with:&lt;br /&gt;
&lt;br /&gt;
 (gdb) break function&lt;br /&gt;
 (gdb) break line&lt;br /&gt;
 (gdb) break file:function&lt;br /&gt;
 (gdb) break file:line&lt;br /&gt;
&lt;br /&gt;
conditional breaks are in the form:&lt;br /&gt;
&lt;br /&gt;
 (gdb) break where if condition&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;condition&amp;lt;/code&amp;gt; is some C expression that evaluates to 1 or 0, like &amp;lt;code&amp;gt;*ptr == NULL&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
One can disable or remove breakpoints with:&lt;br /&gt;
 (gdb) enable breakpoint-number&lt;br /&gt;
 (gdb) disable breakpoint-number&lt;br /&gt;
 (gdb) delete breakpoint-number&lt;br /&gt;
 (gdb) clear       # removes all breakpoints&lt;br /&gt;
&lt;br /&gt;
=== Examining ===&lt;br /&gt;
&lt;br /&gt;
To list source code nearby position or specific places:&lt;br /&gt;
 (gdb) list&lt;br /&gt;
 (gdb) list line&lt;br /&gt;
 (gdb) list function&lt;br /&gt;
 (gdb) list file:line&lt;br /&gt;
 (gdb) list file:function&lt;br /&gt;
 (gdb) list *address&lt;br /&gt;
&lt;br /&gt;
To list execution backtrace (or &amp;lt;code&amp;gt;bt&amp;lt;/code&amp;gt; for short):&lt;br /&gt;
 (gdb) backtrace&lt;br /&gt;
&lt;br /&gt;
To change frame to operate on:&lt;br /&gt;
 (gdb) frame frame-number&lt;br /&gt;
&lt;br /&gt;
To change thread to operate on:&lt;br /&gt;
 (gdb) thread thread-number&lt;br /&gt;
&lt;br /&gt;
To print some value or expression:&lt;br /&gt;
 (gdb) print $register&lt;br /&gt;
 (gdb) print variable&lt;br /&gt;
 (gdb) print *address&lt;br /&gt;
 (gdb) print *(int *)address&lt;br /&gt;
 (gdb) print *(char **)address&lt;br /&gt;
 (gdb) print myfunc(p1, p2) # will actually execute it and return result!&lt;br /&gt;
 (gdb) print *a = 123 # will actually change *a value and return 123!&lt;br /&gt;
 (gdb) print file::variable&lt;br /&gt;
 (gdb) print function::variable&lt;br /&gt;
&lt;br /&gt;
To disassembly:&lt;br /&gt;
 (gdb) disassembly&lt;br /&gt;
 (gdb) disassembly file:line&lt;br /&gt;
&lt;br /&gt;
Print function arguments:&lt;br /&gt;
 (gdb) info args&lt;br /&gt;
&lt;br /&gt;
Print locals:&lt;br /&gt;
 (gdb) info locals&lt;br /&gt;
&lt;br /&gt;
Print breakpoints:&lt;br /&gt;
 (gdb) info breakpoints&lt;br /&gt;
&lt;br /&gt;
Print threads:&lt;br /&gt;
 (gdb) info threads&lt;br /&gt;
&lt;br /&gt;
=== Stepping ===&lt;br /&gt;
&lt;br /&gt;
To go to next instruction, possible entering a function (or &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt; for short):&lt;br /&gt;
 (gdb) step&lt;br /&gt;
&lt;br /&gt;
To go to next instruction, but avoid entering new functions (or &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; for short):&lt;br /&gt;
 (gdb) next&lt;br /&gt;
&lt;br /&gt;
To continue until the function returns:&lt;br /&gt;
 (gdb) finish&lt;br /&gt;
&lt;br /&gt;
To continue execution (or &amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt; for short):&lt;br /&gt;
 (gdb) continue&lt;br /&gt;
&lt;br /&gt;
=== Manipulating Program ===&lt;br /&gt;
&lt;br /&gt;
To set variable to some value:&lt;br /&gt;
 (gdb) set var name=value&lt;br /&gt;
&lt;br /&gt;
To force function to return:&lt;br /&gt;
 (gdb) return value&lt;br /&gt;
 (gdb) return expression&lt;br /&gt;
&lt;br /&gt;
=== Changing Signal Handlers ===&lt;br /&gt;
&lt;br /&gt;
 (gdb) handle signal action&lt;br /&gt;
&lt;br /&gt;
debugging applications with old libC, those pre-nptl, can be really annoying due SIG32 and SIG33, one can ignore those with:&lt;br /&gt;
 (gdb) handle SIG32 nostop&lt;br /&gt;
 (gdb) handle SIG32 noprint&lt;br /&gt;
 (gdb) handle SIG33 nostop&lt;br /&gt;
 (gdb) handle SIG33 noprint&lt;br /&gt;
&lt;br /&gt;
=== Shared Object Paths ===&lt;br /&gt;
&lt;br /&gt;
Often your cross compile root is not &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt;, so you might have to add new paths to the search list.&lt;br /&gt;
&lt;br /&gt;
Unset absolute prefix:&lt;br /&gt;
  (gdb) set solib-absolute-prefix null&lt;br /&gt;
&lt;br /&gt;
Add paths to search paths:&lt;br /&gt;
  (gdb) set solib-search-path /path1:/path2&lt;br /&gt;
&lt;br /&gt;
Alternatively you can choose to set the prefix to the root of your target file system. Specially if you are doing&lt;br /&gt;
embedded development and already exporting your root file system from you host machine to your target machine it can &lt;br /&gt;
be very rewarding so simply use that as root:&lt;br /&gt;
  (gdb) set solib-absolute-prefix /rootfs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Starting application debug from host ===&lt;br /&gt;
Gdbserver could be run in multi-process mode where applications are started or processes connected to remotely, on the fly.&lt;br /&gt;
 gdbserver --multi :4000&lt;br /&gt;
&lt;br /&gt;
Run crosscompiled gdb on host (&amp;lt;gcc_toolchain_path&amp;gt;/bin/arm-none-linux-gnueabi-gdb &amp;lt;application&amp;gt;&lt;br /&gt;
Issue the following commands (multiprocess example):&lt;br /&gt;
&lt;br /&gt;
If we use multiprocess mode:&lt;br /&gt;
 file &amp;lt;application&amp;gt;&lt;br /&gt;
 target extended remote &amp;lt;target_ip&amp;gt;:4000&lt;br /&gt;
 set remote exec-file &amp;lt;path/application&amp;gt;&lt;br /&gt;
 set solib-absolute-prefix  &amp;lt;rootfs_path&amp;gt;/rootfs&lt;br /&gt;
 set solib-search-path  &amp;lt;targetlib_path&amp;gt;/lib: &amp;lt;targetlib_path&amp;gt;/usr/lib&lt;br /&gt;
 break main&lt;br /&gt;
 continue&lt;br /&gt;
&lt;br /&gt;
[[Category:Tools]]&lt;/div&gt;</summary>
		<author><name>Tord</name></author>	</entry>

	<entry>
		<id>http://elinux.org/Toolbox</id>
		<title>Toolbox</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/Toolbox"/>
				<updated>2011-10-27T23:15:32Z</updated>
		
		<summary type="html">&lt;p&gt;Tord: /* gdb tips - target debugging with gdbserver */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page has information about developing Embedded Linux, including links to toolchains, debuggers and other development tools.  Also, it has links to pages with debugging tips.&lt;br /&gt;
&lt;br /&gt;
= Development Tools =&lt;br /&gt;
== Logic Analyzers ==&lt;br /&gt;
* see [[Logic_Analyzers]]&lt;br /&gt;
&lt;br /&gt;
== Toolchains ==&lt;br /&gt;
* see [[Toolchains]]&lt;br /&gt;
&lt;br /&gt;
== Build Systems ==&lt;br /&gt;
* see [[Build Systems]]&lt;br /&gt;
&lt;br /&gt;
== Embedded Linux Distributions ==&lt;br /&gt;
* see [[Embedded Linux Distributions]]&lt;br /&gt;
&lt;br /&gt;
== Debuggers ==&lt;br /&gt;
Debugging is one of the most common activities of an embedded developper. Here are some debuggers howto and links:&lt;br /&gt;
* [http://openocd.berlios.de/web/ Open On-Chip Debugger]&lt;br /&gt;
* [[GDB|GDB - The GNU debugger]]&lt;br /&gt;
* [http://www.gnu.org/software/ddd/ DDD - Data Display Debugger]&lt;br /&gt;
* [[kgdb| kgdb - kernel source level debugger]]&lt;br /&gt;
* [[KDB]] - In-kernel debugger&lt;br /&gt;
* [[Valgrind|valgrind - memory, cache and other debuggers and profilers]]&lt;br /&gt;
&lt;br /&gt;
== Memory Debuggers ==&lt;br /&gt;
See [[Memory Debuggers]]&lt;br /&gt;
&lt;br /&gt;
== Other debugging tools(not debuggers) ==&lt;br /&gt;
* [[addr2line for kernel debugging]]&lt;br /&gt;
* [[ioctl| decode an ioctl]]&lt;br /&gt;
* [[Exception Analysis tools]]&lt;br /&gt;
** This includes things like oops emitters, exception monitors, coredump analysis, etc.&lt;br /&gt;
&lt;br /&gt;
== Integrated Development Environments ==&lt;br /&gt;
* [[Eclipse]] - Powerfull IDE written in JAVA.&lt;br /&gt;
* [http://www.jedit.org jEdit] - Editor written in JAVA which can be expanded to a full IDE with plug-ins.&lt;br /&gt;
* [http://www.kdevelop.org KDevelop] - Standard IDE for KDE.&lt;br /&gt;
* [http://www.gnu.org/software/emacs Emacs] - Powerful IDE, extensible in LISP, ships with modes to integrates with SCM (GIT, SVN, CVS...), build systems, debugger and even fancy multi-window with [http://ecb.sourceforge.net/ ECB].&lt;br /&gt;
* [http://www.vim.org/ VIm] - Powerful IDE, extensible with scripting, can use various modules for completion and more.&lt;br /&gt;
* [http://kscope.sourceforge.net/ KScope] - Cscope based source editing environment with KDE.&lt;br /&gt;
* [http://www.anjuta.org Anjuta] - IDE with nice plugin support&lt;br /&gt;
* [http://qt.nokia.com/products/developer-tools/ QtCreator] is an nice IDE which has code completion, remote deployment (with version 2.3) and Outline view. It also has an VIm mode. Its menus are much cleaner than these from Eclipse and its easier to get started with this ide than Eclipse for that very reason.&lt;br /&gt;
* [http://www.armkits.com/Product/idemain.asp Embest IDE for ARM]&lt;br /&gt;
&lt;br /&gt;
== Emulators ==&lt;br /&gt;
* [[Qemu| Qemu - hardware emulator]] - for everything (try this first)&lt;br /&gt;
* [http://www.skyeye.org/ Skyeye] - for ARM&lt;br /&gt;
* [http://aranym.org Aranym] - for M68K&lt;br /&gt;
* [http://www.hercules-390.org Hercules] - For S390&lt;br /&gt;
* [http://www.armkits.com/Product/unetice.asp UNetICE] for ARM7 and ARM9 processors from [http://www.armkits.com Embest]&lt;br /&gt;
* [http://www.armkits.com/Product/xds100.asp XDS100v2] for TI processor available from [http://www.armkits.com Embest]&lt;br /&gt;
&lt;br /&gt;
== Tracers and Profilers ==&lt;br /&gt;
* [[Strace]] - trace system calls by a program (or set of programs) (very handy)&lt;br /&gt;
* ltrace - trace library calls&lt;br /&gt;
* see [[Kernel Trace Systems]]&lt;br /&gt;
* see [[Profilers]]&lt;br /&gt;
&lt;br /&gt;
== Benchmarks ==&lt;br /&gt;
* see [[Benchmark Programs]]&lt;br /&gt;
&lt;br /&gt;
A list of benchmark results would be useful:&lt;br /&gt;
* Comparing performance of different FFT implementations on Beagleboard-XM: http://pmeerw.dyndns.org/blog/programming/arm_fft.html&lt;br /&gt;
&lt;br /&gt;
== Source Management Tools ==&lt;br /&gt;
There are a number of tools for managing patches, which are useful for different tasks.&lt;br /&gt;
There's now a whole page devoted to this.  See [[Source Management Tools]]&lt;br /&gt;
&lt;br /&gt;
For some simple tools for managing patches, see [[Diff And Patch Tricks]]&lt;br /&gt;
&lt;br /&gt;
== Test Systems ==&lt;br /&gt;
* See [[Test Systems]]&lt;br /&gt;
&lt;br /&gt;
= Developer Resources =&lt;br /&gt;
== mailing lists, web sites, etc. ==&lt;br /&gt;
* See [[Linux Kernel Resources]]&lt;br /&gt;
&lt;br /&gt;
== Articles on kernel subsystems ==&lt;br /&gt;
* [http://www.linusakesson.net/programming/tty/index.php The TTY Demystified] - excellent explanation of kernel tty system&lt;br /&gt;
* [[Device Trees]] - a structure used to describe system hardware at startup - can be passed or modified by firmware, or built into kernel&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
==== Kernel ====&lt;br /&gt;
* See [[Linux Kernel Resources]] - the rest of this material is (mostly) about userspace.&lt;br /&gt;
&lt;br /&gt;
==== Online ====&lt;br /&gt;
* Papers from the Ottawa Linux Symposium - broken out - see http://kernel.org/doc/ols/&lt;br /&gt;
* Free Software tools for embedded systems - http://free-electrons.com/training/devtools&lt;br /&gt;
* Real time in embedded Linux systems - http://free-electrons.com/articles/realtime/&lt;br /&gt;
* Embedded Linux optimizations - http://free-electrons.com/articles/optimizations&lt;br /&gt;
* Audio in embedded Linux systems - http://free-electrons.com/training/audio&lt;br /&gt;
* Multimedia in embedded Linux systems - http://free-electrons.com/training/multimedia&lt;br /&gt;
* Embedded Linux From Scratch... in 40 minutes! - http://free-electrons.com/articles/elfs/&lt;br /&gt;
&lt;br /&gt;
==== Books ====&lt;br /&gt;
* [[Embedded Linux System Design and Development]] - by P. Raghavan, Amol Lad, and Sriram Neelakandan (Hardcover - Dec 21, 2005)&lt;br /&gt;
** This one looks quite good.&lt;br /&gt;
&lt;br /&gt;
* [[Embedded_linux_primer | Embedded Linux Primer: A Practical Real-World Approach]] - by Christopher Hallinan&lt;br /&gt;
** So does this one.&lt;br /&gt;
&lt;br /&gt;
* [[Building Embedded Linux Systems]] - by Karim Yaghmour&lt;br /&gt;
** Be sure to get the second edition (from 2008). The first edition (from 2003) is outdated.&lt;br /&gt;
&lt;br /&gt;
* [http://www.amazon.com/Programming-Environment-Addison-Wesley-Professional-Computing/dp/0321525949/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1259788186&amp;amp;sr=8-1 Advanced Programming in the UNIX Environment, Second Edition] by the late W. Richard Stevens and Stephen A. Rago&lt;br /&gt;
** Not embedded specific, but THE reference for Linux/Unix programming&lt;br /&gt;
&lt;br /&gt;
* [http://www.amazon.com/Linux-System-Programming-Robert-Love/dp/0596009585/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1259788281&amp;amp;sr=1-1 Linux System Programming] - by Robert Love&lt;br /&gt;
** Good introduction to Linux system programming&lt;br /&gt;
&lt;br /&gt;
* [[Linux Debugging and Performance Tuning]] - by Steve Best&lt;br /&gt;
* [[OMAP and DaVinci Software for Dummies]] - by Steve Blonstein, Alan Campbell, Texas Instruments&lt;br /&gt;
* [[Essential Linux Device Drivers]]&lt;br /&gt;
* [[Linux Device Drivers]]&lt;br /&gt;
&lt;br /&gt;
See also [[:Category:Books]]&lt;br /&gt;
&lt;br /&gt;
==== Reference Material ====&lt;br /&gt;
* ARM Processor Reference Manuals - Registration required, but it's free.&lt;br /&gt;
** go to http://infocenter.arm.com/ =&amp;gt; ARM architecture =&amp;gt; Reference Manuals =&amp;gt; ... =&amp;gt; registration link (only name, e-mail address and company name are strictly required).&lt;br /&gt;
* The [[UHAPI]] Forum standardizes hardware-independent application programming interfaces (APIs) for analog and digital televisions, set top boxes, DVD players and recorders, personal video recorders (PVRs), home servers and other consumer audio/video (A/V) devices.&lt;br /&gt;
* [[Hello_World_in_C]]&lt;br /&gt;
* [[Traceroute_-_Tracing_Route|How traceroute works!]]&lt;br /&gt;
* [[DNS_-_Domain_Name_Server|How DNS works!]]&lt;br /&gt;
* [[Order_One_Study]]&lt;br /&gt;
* [[RTWG-discussion-points]]&lt;br /&gt;
* [[Subset_Libc_Specification]]&lt;br /&gt;
* [[Extern_Vs_Static_Inline]]&lt;br /&gt;
* [[Slab_allocator]]&lt;br /&gt;
* [[Size_Tunables]]&lt;br /&gt;
&lt;br /&gt;
==== Podcasts ====&lt;br /&gt;
* [http://tllts.org] - The (Original) Linux Link Tech Show, weekly Linux podcast with archive going back to 2003.&lt;br /&gt;
* [http://www.timesys.com/resources/podcast] - Timesys LinuxLink Radio.  (Despite the name, it's has nothing to do with the older Linux Link podcast, and it's not on the radio.  No longer updates on a regular schedule, but the archives are available.)&lt;br /&gt;
&lt;br /&gt;
== Code Style Tips ==&lt;br /&gt;
* See [[Code Styling Tips]]&lt;br /&gt;
* see also [[Sparse]]&lt;br /&gt;
&lt;br /&gt;
== Debugging Tips ==&lt;br /&gt;
* See the [[Kernel Debugging Tips]] page&lt;br /&gt;
* See also [[Debugging Makefiles]]&lt;br /&gt;
* [[Printk]]&lt;br /&gt;
* Debug user-space initialization:&lt;br /&gt;
** If you get a panic - &amp;quot;not syncing: Attempted to kill init!&amp;quot; it can be for many different reasons. Try setting CONFIG_DEBUG_USER=y in your .config and pass 'user_debug=255' in the kernel command line. That will give you a more verbose output about why user space programs crash. Thanks to Daniel Mack on the linux-arm-kernel mailing list for this tip.&lt;br /&gt;
=== gdb tips - get element size ===&lt;br /&gt;
Sometimes, with complex structures (arrays of structs containing nested structs or arrays), it is&lt;br /&gt;
hard to determine the actual size of a particular element.&lt;br /&gt;
&lt;br /&gt;
You can use gdb with a program image to get the size of structures, by looking at the offset&lt;br /&gt;
of an element of the structure relative to an address of zero:&lt;br /&gt;
&lt;br /&gt;
Here are some examples:&lt;br /&gt;
   ${CROSS_COMPILE}gdb vmlinux&lt;br /&gt;
 GNU gdb (GDB) 7.2&lt;br /&gt;
 Copyright (C) 2010 Free Software Foundation, Inc.&lt;br /&gt;
 License GPLv3+: GNU GPL version 3 or later &amp;lt;http://gnu.org/licenses/gpl.html&amp;gt;&lt;br /&gt;
 This is free software: you are free to change and redistribute it.&lt;br /&gt;
 There is NO WARRANTY, to the extent permitted by law.  Type &amp;quot;show copying&amp;quot;&lt;br /&gt;
 and &amp;quot;show warranty&amp;quot; for details.&lt;br /&gt;
 This GDB was configured as &amp;quot;--host=i686-pc-linux-gnu --target=arm-sony-linux-gnueabi&amp;quot;.&lt;br /&gt;
 For bug reporting instructions, please see:&lt;br /&gt;
 &amp;lt;http://www.gnu.org/software/gdb/bugs/&amp;gt;.&lt;br /&gt;
 (gdb) p &amp;amp;((struct poll_wqueues *)0)-&amp;gt;polling_task&lt;br /&gt;
 $6 = (struct task_struct **) 0xc&lt;br /&gt;
 (gdb) p/d &amp;amp;((struct poll_wqueues *)0)-&amp;gt;error&lt;br /&gt;
 $4 = 20&lt;br /&gt;
&lt;br /&gt;
the second example could be read as: &amp;quot;print, in decimal, the address (offset)&lt;br /&gt;
of the element error using address 0 cast as a pointer to struct poll_wqueues&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'pt' is the first element of struct poll_wqueues.&lt;br /&gt;
Here is an example using array offsets, showing that struct poll_wqueues is 604 bytes long.&lt;br /&gt;
&lt;br /&gt;
 (gdb) p/d &amp;amp;((struct poll_wqueues *)0)[0]-&amp;gt;pt&lt;br /&gt;
 $2 = 0&lt;br /&gt;
 (gdb) p/d &amp;amp;((struct poll_wqueues *)0)[1]-&amp;gt;pt&lt;br /&gt;
 $3 = 604&lt;br /&gt;
&lt;br /&gt;
== GCC Tips and Tricks ==&lt;br /&gt;
* This section of [[GCC Tips]] is a collection of tips and tricks helpful for embedded developers&lt;br /&gt;
&lt;br /&gt;
== Network Setup ==&lt;br /&gt;
* Settings up a [[Bluetooth Network]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Wishlist Items =&lt;br /&gt;
*[[Continuous Logging for Watchdog Timer Expiration]]&lt;br /&gt;
*[[Crash Diagnostics]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Development Tools]]&lt;/div&gt;</summary>
		<author><name>Tord</name></author>	</entry>

	<entry>
		<id>http://elinux.org/Toolbox</id>
		<title>Toolbox</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/Toolbox"/>
				<updated>2011-10-27T23:11:01Z</updated>
		
		<summary type="html">&lt;p&gt;Tord: /* gdb tips - running gdb with gdbserver */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page has information about developing Embedded Linux, including links to toolchains, debuggers and other development tools.  Also, it has links to pages with debugging tips.&lt;br /&gt;
&lt;br /&gt;
= Development Tools =&lt;br /&gt;
== Logic Analyzers ==&lt;br /&gt;
* see [[Logic_Analyzers]]&lt;br /&gt;
&lt;br /&gt;
== Toolchains ==&lt;br /&gt;
* see [[Toolchains]]&lt;br /&gt;
&lt;br /&gt;
== Build Systems ==&lt;br /&gt;
* see [[Build Systems]]&lt;br /&gt;
&lt;br /&gt;
== Embedded Linux Distributions ==&lt;br /&gt;
* see [[Embedded Linux Distributions]]&lt;br /&gt;
&lt;br /&gt;
== Debuggers ==&lt;br /&gt;
Debugging is one of the most common activities of an embedded developper. Here are some debuggers howto and links:&lt;br /&gt;
* [http://openocd.berlios.de/web/ Open On-Chip Debugger]&lt;br /&gt;
* [[GDB|GDB - The GNU debugger]]&lt;br /&gt;
* [http://www.gnu.org/software/ddd/ DDD - Data Display Debugger]&lt;br /&gt;
* [[kgdb| kgdb - kernel source level debugger]]&lt;br /&gt;
* [[KDB]] - In-kernel debugger&lt;br /&gt;
* [[Valgrind|valgrind - memory, cache and other debuggers and profilers]]&lt;br /&gt;
&lt;br /&gt;
== Memory Debuggers ==&lt;br /&gt;
See [[Memory Debuggers]]&lt;br /&gt;
&lt;br /&gt;
== Other debugging tools(not debuggers) ==&lt;br /&gt;
* [[addr2line for kernel debugging]]&lt;br /&gt;
* [[ioctl| decode an ioctl]]&lt;br /&gt;
* [[Exception Analysis tools]]&lt;br /&gt;
** This includes things like oops emitters, exception monitors, coredump analysis, etc.&lt;br /&gt;
&lt;br /&gt;
== Integrated Development Environments ==&lt;br /&gt;
* [[Eclipse]] - Powerfull IDE written in JAVA.&lt;br /&gt;
* [http://www.jedit.org jEdit] - Editor written in JAVA which can be expanded to a full IDE with plug-ins.&lt;br /&gt;
* [http://www.kdevelop.org KDevelop] - Standard IDE for KDE.&lt;br /&gt;
* [http://www.gnu.org/software/emacs Emacs] - Powerful IDE, extensible in LISP, ships with modes to integrates with SCM (GIT, SVN, CVS...), build systems, debugger and even fancy multi-window with [http://ecb.sourceforge.net/ ECB].&lt;br /&gt;
* [http://www.vim.org/ VIm] - Powerful IDE, extensible with scripting, can use various modules for completion and more.&lt;br /&gt;
* [http://kscope.sourceforge.net/ KScope] - Cscope based source editing environment with KDE.&lt;br /&gt;
* [http://www.anjuta.org Anjuta] - IDE with nice plugin support&lt;br /&gt;
* [http://qt.nokia.com/products/developer-tools/ QtCreator] is an nice IDE which has code completion, remote deployment (with version 2.3) and Outline view. It also has an VIm mode. Its menus are much cleaner than these from Eclipse and its easier to get started with this ide than Eclipse for that very reason.&lt;br /&gt;
* [http://www.armkits.com/Product/idemain.asp Embest IDE for ARM]&lt;br /&gt;
&lt;br /&gt;
== Emulators ==&lt;br /&gt;
* [[Qemu| Qemu - hardware emulator]] - for everything (try this first)&lt;br /&gt;
* [http://www.skyeye.org/ Skyeye] - for ARM&lt;br /&gt;
* [http://aranym.org Aranym] - for M68K&lt;br /&gt;
* [http://www.hercules-390.org Hercules] - For S390&lt;br /&gt;
* [http://www.armkits.com/Product/unetice.asp UNetICE] for ARM7 and ARM9 processors from [http://www.armkits.com Embest]&lt;br /&gt;
* [http://www.armkits.com/Product/xds100.asp XDS100v2] for TI processor available from [http://www.armkits.com Embest]&lt;br /&gt;
&lt;br /&gt;
== Tracers and Profilers ==&lt;br /&gt;
* [[Strace]] - trace system calls by a program (or set of programs) (very handy)&lt;br /&gt;
* ltrace - trace library calls&lt;br /&gt;
* see [[Kernel Trace Systems]]&lt;br /&gt;
* see [[Profilers]]&lt;br /&gt;
&lt;br /&gt;
== Benchmarks ==&lt;br /&gt;
* see [[Benchmark Programs]]&lt;br /&gt;
&lt;br /&gt;
A list of benchmark results would be useful:&lt;br /&gt;
* Comparing performance of different FFT implementations on Beagleboard-XM: http://pmeerw.dyndns.org/blog/programming/arm_fft.html&lt;br /&gt;
&lt;br /&gt;
== Source Management Tools ==&lt;br /&gt;
There are a number of tools for managing patches, which are useful for different tasks.&lt;br /&gt;
There's now a whole page devoted to this.  See [[Source Management Tools]]&lt;br /&gt;
&lt;br /&gt;
For some simple tools for managing patches, see [[Diff And Patch Tricks]]&lt;br /&gt;
&lt;br /&gt;
== Test Systems ==&lt;br /&gt;
* See [[Test Systems]]&lt;br /&gt;
&lt;br /&gt;
= Developer Resources =&lt;br /&gt;
== mailing lists, web sites, etc. ==&lt;br /&gt;
* See [[Linux Kernel Resources]]&lt;br /&gt;
&lt;br /&gt;
== Articles on kernel subsystems ==&lt;br /&gt;
* [http://www.linusakesson.net/programming/tty/index.php The TTY Demystified] - excellent explanation of kernel tty system&lt;br /&gt;
* [[Device Trees]] - a structure used to describe system hardware at startup - can be passed or modified by firmware, or built into kernel&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
==== Kernel ====&lt;br /&gt;
* See [[Linux Kernel Resources]] - the rest of this material is (mostly) about userspace.&lt;br /&gt;
&lt;br /&gt;
==== Online ====&lt;br /&gt;
* Papers from the Ottawa Linux Symposium - broken out - see http://kernel.org/doc/ols/&lt;br /&gt;
* Free Software tools for embedded systems - http://free-electrons.com/training/devtools&lt;br /&gt;
* Real time in embedded Linux systems - http://free-electrons.com/articles/realtime/&lt;br /&gt;
* Embedded Linux optimizations - http://free-electrons.com/articles/optimizations&lt;br /&gt;
* Audio in embedded Linux systems - http://free-electrons.com/training/audio&lt;br /&gt;
* Multimedia in embedded Linux systems - http://free-electrons.com/training/multimedia&lt;br /&gt;
* Embedded Linux From Scratch... in 40 minutes! - http://free-electrons.com/articles/elfs/&lt;br /&gt;
&lt;br /&gt;
==== Books ====&lt;br /&gt;
* [[Embedded Linux System Design and Development]] - by P. Raghavan, Amol Lad, and Sriram Neelakandan (Hardcover - Dec 21, 2005)&lt;br /&gt;
** This one looks quite good.&lt;br /&gt;
&lt;br /&gt;
* [[Embedded_linux_primer | Embedded Linux Primer: A Practical Real-World Approach]] - by Christopher Hallinan&lt;br /&gt;
** So does this one.&lt;br /&gt;
&lt;br /&gt;
* [[Building Embedded Linux Systems]] - by Karim Yaghmour&lt;br /&gt;
** Be sure to get the second edition (from 2008). The first edition (from 2003) is outdated.&lt;br /&gt;
&lt;br /&gt;
* [http://www.amazon.com/Programming-Environment-Addison-Wesley-Professional-Computing/dp/0321525949/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1259788186&amp;amp;sr=8-1 Advanced Programming in the UNIX Environment, Second Edition] by the late W. Richard Stevens and Stephen A. Rago&lt;br /&gt;
** Not embedded specific, but THE reference for Linux/Unix programming&lt;br /&gt;
&lt;br /&gt;
* [http://www.amazon.com/Linux-System-Programming-Robert-Love/dp/0596009585/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1259788281&amp;amp;sr=1-1 Linux System Programming] - by Robert Love&lt;br /&gt;
** Good introduction to Linux system programming&lt;br /&gt;
&lt;br /&gt;
* [[Linux Debugging and Performance Tuning]] - by Steve Best&lt;br /&gt;
* [[OMAP and DaVinci Software for Dummies]] - by Steve Blonstein, Alan Campbell, Texas Instruments&lt;br /&gt;
* [[Essential Linux Device Drivers]]&lt;br /&gt;
* [[Linux Device Drivers]]&lt;br /&gt;
&lt;br /&gt;
See also [[:Category:Books]]&lt;br /&gt;
&lt;br /&gt;
==== Reference Material ====&lt;br /&gt;
* ARM Processor Reference Manuals - Registration required, but it's free.&lt;br /&gt;
** go to http://infocenter.arm.com/ =&amp;gt; ARM architecture =&amp;gt; Reference Manuals =&amp;gt; ... =&amp;gt; registration link (only name, e-mail address and company name are strictly required).&lt;br /&gt;
* The [[UHAPI]] Forum standardizes hardware-independent application programming interfaces (APIs) for analog and digital televisions, set top boxes, DVD players and recorders, personal video recorders (PVRs), home servers and other consumer audio/video (A/V) devices.&lt;br /&gt;
* [[Hello_World_in_C]]&lt;br /&gt;
* [[Traceroute_-_Tracing_Route|How traceroute works!]]&lt;br /&gt;
* [[DNS_-_Domain_Name_Server|How DNS works!]]&lt;br /&gt;
* [[Order_One_Study]]&lt;br /&gt;
* [[RTWG-discussion-points]]&lt;br /&gt;
* [[Subset_Libc_Specification]]&lt;br /&gt;
* [[Extern_Vs_Static_Inline]]&lt;br /&gt;
* [[Slab_allocator]]&lt;br /&gt;
* [[Size_Tunables]]&lt;br /&gt;
&lt;br /&gt;
==== Podcasts ====&lt;br /&gt;
* [http://tllts.org] - The (Original) Linux Link Tech Show, weekly Linux podcast with archive going back to 2003.&lt;br /&gt;
* [http://www.timesys.com/resources/podcast] - Timesys LinuxLink Radio.  (Despite the name, it's has nothing to do with the older Linux Link podcast, and it's not on the radio.  No longer updates on a regular schedule, but the archives are available.)&lt;br /&gt;
&lt;br /&gt;
== Code Style Tips ==&lt;br /&gt;
* See [[Code Styling Tips]]&lt;br /&gt;
* see also [[Sparse]]&lt;br /&gt;
&lt;br /&gt;
== Debugging Tips ==&lt;br /&gt;
* See the [[Kernel Debugging Tips]] page&lt;br /&gt;
* See also [[Debugging Makefiles]]&lt;br /&gt;
* [[Printk]]&lt;br /&gt;
* Debug user-space initialization:&lt;br /&gt;
** If you get a panic - &amp;quot;not syncing: Attempted to kill init!&amp;quot; it can be for many different reasons. Try setting CONFIG_DEBUG_USER=y in your .config and pass 'user_debug=255' in the kernel command line. That will give you a more verbose output about why user space programs crash. Thanks to Daniel Mack on the linux-arm-kernel mailing list for this tip.&lt;br /&gt;
=== gdb tips - target debugging with gdbserver===&lt;br /&gt;
&lt;br /&gt;
In order to debug an ethernet connected target system from a host we could use gdbserver.&lt;br /&gt;
&lt;br /&gt;
Initial preparations:&lt;br /&gt;
* Copy gdbserver to target (if not there already)&lt;br /&gt;
* Change file permissions to execute&lt;br /&gt;
* Make sure libthread_db is installed in target /lib.&lt;br /&gt;
(libthread_db is found in &amp;lt;gcc_toolchain_path&amp;gt;/arm-none-linux-gnueabi/libc/usr/lib/libthread_db.so)&lt;br /&gt;
* Run gdbserver on target&lt;br /&gt;
 gdbserver :4000 &amp;lt;application&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gdbserver could also be run in multiprocess mode where applications are started or processes connected to remotely, on the fly.&lt;br /&gt;
 gdbserver --multi :4000&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Run crosscompiled gdb on host (&amp;lt;gcc_toolchain_path&amp;gt;/bin/arm-none-linux-gnueabi-gdb &amp;lt;application&amp;gt;&lt;br /&gt;
Issue the following commands (non multiprocess example):&lt;br /&gt;
 target remote &amp;lt;target_ip&amp;gt;:4000&lt;br /&gt;
 set solib-absolute-prefix  &amp;lt;rootfs_path&amp;gt;/rootfs&lt;br /&gt;
 set solib-search-path  &amp;lt;targetlib_path&amp;gt;/lib: &amp;lt;targetlib_path&amp;gt;/usr/lib&lt;br /&gt;
 break main&lt;br /&gt;
 continue&lt;br /&gt;
&lt;br /&gt;
If we use multiprocess mode:&lt;br /&gt;
 file &amp;lt;application&amp;gt;&lt;br /&gt;
 target extended remote &amp;lt;target_ip&amp;gt;:4000&lt;br /&gt;
 set remote exec-file &amp;lt;path/application&amp;gt;&lt;br /&gt;
 set solib-absolute-prefix  &amp;lt;rootfs_path&amp;gt;/rootfs&lt;br /&gt;
 set solib-search-path  &amp;lt;targetlib_path&amp;gt;/lib: &amp;lt;targetlib_path&amp;gt;/usr/lib&lt;br /&gt;
 break main&lt;br /&gt;
 continue&lt;br /&gt;
&lt;br /&gt;
=== gdb tips - get element size ===&lt;br /&gt;
Sometimes, with complex structures (arrays of structs containing nested structs or arrays), it is&lt;br /&gt;
hard to determine the actual size of a particular element.&lt;br /&gt;
&lt;br /&gt;
You can use gdb with a program image to get the size of structures, by looking at the offset&lt;br /&gt;
of an element of the structure relative to an address of zero:&lt;br /&gt;
&lt;br /&gt;
Here are some examples:&lt;br /&gt;
   ${CROSS_COMPILE}gdb vmlinux&lt;br /&gt;
 GNU gdb (GDB) 7.2&lt;br /&gt;
 Copyright (C) 2010 Free Software Foundation, Inc.&lt;br /&gt;
 License GPLv3+: GNU GPL version 3 or later &amp;lt;http://gnu.org/licenses/gpl.html&amp;gt;&lt;br /&gt;
 This is free software: you are free to change and redistribute it.&lt;br /&gt;
 There is NO WARRANTY, to the extent permitted by law.  Type &amp;quot;show copying&amp;quot;&lt;br /&gt;
 and &amp;quot;show warranty&amp;quot; for details.&lt;br /&gt;
 This GDB was configured as &amp;quot;--host=i686-pc-linux-gnu --target=arm-sony-linux-gnueabi&amp;quot;.&lt;br /&gt;
 For bug reporting instructions, please see:&lt;br /&gt;
 &amp;lt;http://www.gnu.org/software/gdb/bugs/&amp;gt;.&lt;br /&gt;
 (gdb) p &amp;amp;((struct poll_wqueues *)0)-&amp;gt;polling_task&lt;br /&gt;
 $6 = (struct task_struct **) 0xc&lt;br /&gt;
 (gdb) p/d &amp;amp;((struct poll_wqueues *)0)-&amp;gt;error&lt;br /&gt;
 $4 = 20&lt;br /&gt;
&lt;br /&gt;
the second example could be read as: &amp;quot;print, in decimal, the address (offset)&lt;br /&gt;
of the element error using address 0 cast as a pointer to struct poll_wqueues&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'pt' is the first element of struct poll_wqueues.&lt;br /&gt;
Here is an example using array offsets, showing that struct poll_wqueues is 604 bytes long.&lt;br /&gt;
&lt;br /&gt;
 (gdb) p/d &amp;amp;((struct poll_wqueues *)0)[0]-&amp;gt;pt&lt;br /&gt;
 $2 = 0&lt;br /&gt;
 (gdb) p/d &amp;amp;((struct poll_wqueues *)0)[1]-&amp;gt;pt&lt;br /&gt;
 $3 = 604&lt;br /&gt;
&lt;br /&gt;
== GCC Tips and Tricks ==&lt;br /&gt;
* This section of [[GCC Tips]] is a collection of tips and tricks helpful for embedded developers&lt;br /&gt;
&lt;br /&gt;
== Network Setup ==&lt;br /&gt;
* Settings up a [[Bluetooth Network]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Wishlist Items =&lt;br /&gt;
*[[Continuous Logging for Watchdog Timer Expiration]]&lt;br /&gt;
*[[Crash Diagnostics]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Development Tools]]&lt;/div&gt;</summary>
		<author><name>Tord</name></author>	</entry>

	<entry>
		<id>http://elinux.org/Toolbox</id>
		<title>Toolbox</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/Toolbox"/>
				<updated>2011-10-27T23:07:42Z</updated>
		
		<summary type="html">&lt;p&gt;Tord: /* gdb tips */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page has information about developing Embedded Linux, including links to toolchains, debuggers and other development tools.  Also, it has links to pages with debugging tips.&lt;br /&gt;
&lt;br /&gt;
= Development Tools =&lt;br /&gt;
== Logic Analyzers ==&lt;br /&gt;
* see [[Logic_Analyzers]]&lt;br /&gt;
&lt;br /&gt;
== Toolchains ==&lt;br /&gt;
* see [[Toolchains]]&lt;br /&gt;
&lt;br /&gt;
== Build Systems ==&lt;br /&gt;
* see [[Build Systems]]&lt;br /&gt;
&lt;br /&gt;
== Embedded Linux Distributions ==&lt;br /&gt;
* see [[Embedded Linux Distributions]]&lt;br /&gt;
&lt;br /&gt;
== Debuggers ==&lt;br /&gt;
Debugging is one of the most common activities of an embedded developper. Here are some debuggers howto and links:&lt;br /&gt;
* [http://openocd.berlios.de/web/ Open On-Chip Debugger]&lt;br /&gt;
* [[GDB|GDB - The GNU debugger]]&lt;br /&gt;
* [http://www.gnu.org/software/ddd/ DDD - Data Display Debugger]&lt;br /&gt;
* [[kgdb| kgdb - kernel source level debugger]]&lt;br /&gt;
* [[KDB]] - In-kernel debugger&lt;br /&gt;
* [[Valgrind|valgrind - memory, cache and other debuggers and profilers]]&lt;br /&gt;
&lt;br /&gt;
== Memory Debuggers ==&lt;br /&gt;
See [[Memory Debuggers]]&lt;br /&gt;
&lt;br /&gt;
== Other debugging tools(not debuggers) ==&lt;br /&gt;
* [[addr2line for kernel debugging]]&lt;br /&gt;
* [[ioctl| decode an ioctl]]&lt;br /&gt;
* [[Exception Analysis tools]]&lt;br /&gt;
** This includes things like oops emitters, exception monitors, coredump analysis, etc.&lt;br /&gt;
&lt;br /&gt;
== Integrated Development Environments ==&lt;br /&gt;
* [[Eclipse]] - Powerfull IDE written in JAVA.&lt;br /&gt;
* [http://www.jedit.org jEdit] - Editor written in JAVA which can be expanded to a full IDE with plug-ins.&lt;br /&gt;
* [http://www.kdevelop.org KDevelop] - Standard IDE for KDE.&lt;br /&gt;
* [http://www.gnu.org/software/emacs Emacs] - Powerful IDE, extensible in LISP, ships with modes to integrates with SCM (GIT, SVN, CVS...), build systems, debugger and even fancy multi-window with [http://ecb.sourceforge.net/ ECB].&lt;br /&gt;
* [http://www.vim.org/ VIm] - Powerful IDE, extensible with scripting, can use various modules for completion and more.&lt;br /&gt;
* [http://kscope.sourceforge.net/ KScope] - Cscope based source editing environment with KDE.&lt;br /&gt;
* [http://www.anjuta.org Anjuta] - IDE with nice plugin support&lt;br /&gt;
* [http://qt.nokia.com/products/developer-tools/ QtCreator] is an nice IDE which has code completion, remote deployment (with version 2.3) and Outline view. It also has an VIm mode. Its menus are much cleaner than these from Eclipse and its easier to get started with this ide than Eclipse for that very reason.&lt;br /&gt;
* [http://www.armkits.com/Product/idemain.asp Embest IDE for ARM]&lt;br /&gt;
&lt;br /&gt;
== Emulators ==&lt;br /&gt;
* [[Qemu| Qemu - hardware emulator]] - for everything (try this first)&lt;br /&gt;
* [http://www.skyeye.org/ Skyeye] - for ARM&lt;br /&gt;
* [http://aranym.org Aranym] - for M68K&lt;br /&gt;
* [http://www.hercules-390.org Hercules] - For S390&lt;br /&gt;
* [http://www.armkits.com/Product/unetice.asp UNetICE] for ARM7 and ARM9 processors from [http://www.armkits.com Embest]&lt;br /&gt;
* [http://www.armkits.com/Product/xds100.asp XDS100v2] for TI processor available from [http://www.armkits.com Embest]&lt;br /&gt;
&lt;br /&gt;
== Tracers and Profilers ==&lt;br /&gt;
* [[Strace]] - trace system calls by a program (or set of programs) (very handy)&lt;br /&gt;
* ltrace - trace library calls&lt;br /&gt;
* see [[Kernel Trace Systems]]&lt;br /&gt;
* see [[Profilers]]&lt;br /&gt;
&lt;br /&gt;
== Benchmarks ==&lt;br /&gt;
* see [[Benchmark Programs]]&lt;br /&gt;
&lt;br /&gt;
A list of benchmark results would be useful:&lt;br /&gt;
* Comparing performance of different FFT implementations on Beagleboard-XM: http://pmeerw.dyndns.org/blog/programming/arm_fft.html&lt;br /&gt;
&lt;br /&gt;
== Source Management Tools ==&lt;br /&gt;
There are a number of tools for managing patches, which are useful for different tasks.&lt;br /&gt;
There's now a whole page devoted to this.  See [[Source Management Tools]]&lt;br /&gt;
&lt;br /&gt;
For some simple tools for managing patches, see [[Diff And Patch Tricks]]&lt;br /&gt;
&lt;br /&gt;
== Test Systems ==&lt;br /&gt;
* See [[Test Systems]]&lt;br /&gt;
&lt;br /&gt;
= Developer Resources =&lt;br /&gt;
== mailing lists, web sites, etc. ==&lt;br /&gt;
* See [[Linux Kernel Resources]]&lt;br /&gt;
&lt;br /&gt;
== Articles on kernel subsystems ==&lt;br /&gt;
* [http://www.linusakesson.net/programming/tty/index.php The TTY Demystified] - excellent explanation of kernel tty system&lt;br /&gt;
* [[Device Trees]] - a structure used to describe system hardware at startup - can be passed or modified by firmware, or built into kernel&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
==== Kernel ====&lt;br /&gt;
* See [[Linux Kernel Resources]] - the rest of this material is (mostly) about userspace.&lt;br /&gt;
&lt;br /&gt;
==== Online ====&lt;br /&gt;
* Papers from the Ottawa Linux Symposium - broken out - see http://kernel.org/doc/ols/&lt;br /&gt;
* Free Software tools for embedded systems - http://free-electrons.com/training/devtools&lt;br /&gt;
* Real time in embedded Linux systems - http://free-electrons.com/articles/realtime/&lt;br /&gt;
* Embedded Linux optimizations - http://free-electrons.com/articles/optimizations&lt;br /&gt;
* Audio in embedded Linux systems - http://free-electrons.com/training/audio&lt;br /&gt;
* Multimedia in embedded Linux systems - http://free-electrons.com/training/multimedia&lt;br /&gt;
* Embedded Linux From Scratch... in 40 minutes! - http://free-electrons.com/articles/elfs/&lt;br /&gt;
&lt;br /&gt;
==== Books ====&lt;br /&gt;
* [[Embedded Linux System Design and Development]] - by P. Raghavan, Amol Lad, and Sriram Neelakandan (Hardcover - Dec 21, 2005)&lt;br /&gt;
** This one looks quite good.&lt;br /&gt;
&lt;br /&gt;
* [[Embedded_linux_primer | Embedded Linux Primer: A Practical Real-World Approach]] - by Christopher Hallinan&lt;br /&gt;
** So does this one.&lt;br /&gt;
&lt;br /&gt;
* [[Building Embedded Linux Systems]] - by Karim Yaghmour&lt;br /&gt;
** Be sure to get the second edition (from 2008). The first edition (from 2003) is outdated.&lt;br /&gt;
&lt;br /&gt;
* [http://www.amazon.com/Programming-Environment-Addison-Wesley-Professional-Computing/dp/0321525949/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1259788186&amp;amp;sr=8-1 Advanced Programming in the UNIX Environment, Second Edition] by the late W. Richard Stevens and Stephen A. Rago&lt;br /&gt;
** Not embedded specific, but THE reference for Linux/Unix programming&lt;br /&gt;
&lt;br /&gt;
* [http://www.amazon.com/Linux-System-Programming-Robert-Love/dp/0596009585/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1259788281&amp;amp;sr=1-1 Linux System Programming] - by Robert Love&lt;br /&gt;
** Good introduction to Linux system programming&lt;br /&gt;
&lt;br /&gt;
* [[Linux Debugging and Performance Tuning]] - by Steve Best&lt;br /&gt;
* [[OMAP and DaVinci Software for Dummies]] - by Steve Blonstein, Alan Campbell, Texas Instruments&lt;br /&gt;
* [[Essential Linux Device Drivers]]&lt;br /&gt;
* [[Linux Device Drivers]]&lt;br /&gt;
&lt;br /&gt;
See also [[:Category:Books]]&lt;br /&gt;
&lt;br /&gt;
==== Reference Material ====&lt;br /&gt;
* ARM Processor Reference Manuals - Registration required, but it's free.&lt;br /&gt;
** go to http://infocenter.arm.com/ =&amp;gt; ARM architecture =&amp;gt; Reference Manuals =&amp;gt; ... =&amp;gt; registration link (only name, e-mail address and company name are strictly required).&lt;br /&gt;
* The [[UHAPI]] Forum standardizes hardware-independent application programming interfaces (APIs) for analog and digital televisions, set top boxes, DVD players and recorders, personal video recorders (PVRs), home servers and other consumer audio/video (A/V) devices.&lt;br /&gt;
* [[Hello_World_in_C]]&lt;br /&gt;
* [[Traceroute_-_Tracing_Route|How traceroute works!]]&lt;br /&gt;
* [[DNS_-_Domain_Name_Server|How DNS works!]]&lt;br /&gt;
* [[Order_One_Study]]&lt;br /&gt;
* [[RTWG-discussion-points]]&lt;br /&gt;
* [[Subset_Libc_Specification]]&lt;br /&gt;
* [[Extern_Vs_Static_Inline]]&lt;br /&gt;
* [[Slab_allocator]]&lt;br /&gt;
* [[Size_Tunables]]&lt;br /&gt;
&lt;br /&gt;
==== Podcasts ====&lt;br /&gt;
* [http://tllts.org] - The (Original) Linux Link Tech Show, weekly Linux podcast with archive going back to 2003.&lt;br /&gt;
* [http://www.timesys.com/resources/podcast] - Timesys LinuxLink Radio.  (Despite the name, it's has nothing to do with the older Linux Link podcast, and it's not on the radio.  No longer updates on a regular schedule, but the archives are available.)&lt;br /&gt;
&lt;br /&gt;
== Code Style Tips ==&lt;br /&gt;
* See [[Code Styling Tips]]&lt;br /&gt;
* see also [[Sparse]]&lt;br /&gt;
&lt;br /&gt;
== Debugging Tips ==&lt;br /&gt;
* See the [[Kernel Debugging Tips]] page&lt;br /&gt;
* See also [[Debugging Makefiles]]&lt;br /&gt;
* [[Printk]]&lt;br /&gt;
* Debug user-space initialization:&lt;br /&gt;
** If you get a panic - &amp;quot;not syncing: Attempted to kill init!&amp;quot; it can be for many different reasons. Try setting CONFIG_DEBUG_USER=y in your .config and pass 'user_debug=255' in the kernel command line. That will give you a more verbose output about why user space programs crash. Thanks to Daniel Mack on the linux-arm-kernel mailing list for this tip.&lt;br /&gt;
=== gdb tips - running gdb with gdbserver===&lt;br /&gt;
&lt;br /&gt;
In order to debug an ethernet connected target system from a host we could use gdbserver.&lt;br /&gt;
&lt;br /&gt;
Initial preparations:&lt;br /&gt;
* Copy gdbserver to target (if not there already)&lt;br /&gt;
* Change file permissions to execute&lt;br /&gt;
* Make sure libthread_db is installed in target /lib.&lt;br /&gt;
(libthread_db is found in &amp;lt;gcc_toolchain_path&amp;gt;/arm-none-linux-gnueabi/libc/usr/lib/libthread_db.so)&lt;br /&gt;
* Run gdbserver on target&lt;br /&gt;
 gdbserver :4000 &amp;lt;application&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gdbserver could also be run in multiprocess mode where applications are started or processes connected to remotely, on the fly.&lt;br /&gt;
 gdbserver --multi :4000&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Run crosscompiled gdb on host (&amp;lt;gcc_toolchain_path&amp;gt;/bin/arm-none-linux-gnueabi-gdb &amp;lt;application&amp;gt;&lt;br /&gt;
Issue the following commands (non multiprocess example):&lt;br /&gt;
 target remote &amp;lt;target_ip&amp;gt;:4000&lt;br /&gt;
 set solib-absolute-prefix  &amp;lt;rootfs_path&amp;gt;/rootfs&lt;br /&gt;
 set solib-search-path  &amp;lt;targetlib_path&amp;gt;/lib: &amp;lt;targetlib_path&amp;gt;/usr/lib&lt;br /&gt;
 break main&lt;br /&gt;
 continue&lt;br /&gt;
&lt;br /&gt;
If we use multiprocess mode:&lt;br /&gt;
 file &amp;lt;application&amp;gt;&lt;br /&gt;
 target extended remote &amp;lt;target_ip&amp;gt;:4000&lt;br /&gt;
 set remote exec-file &amp;lt;path/application&amp;gt;&lt;br /&gt;
 set solib-absolute-prefix  &amp;lt;rootfs_path&amp;gt;/rootfs&lt;br /&gt;
 set solib-search-path  &amp;lt;targetlib_path&amp;gt;/lib: &amp;lt;targetlib_path&amp;gt;/usr/lib&lt;br /&gt;
 break main&lt;br /&gt;
 continue&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== gdb tips - get element size ===&lt;br /&gt;
Sometimes, with complex structures (arrays of structs containing nested structs or arrays), it is&lt;br /&gt;
hard to determine the actual size of a particular element.&lt;br /&gt;
&lt;br /&gt;
You can use gdb with a program image to get the size of structures, by looking at the offset&lt;br /&gt;
of an element of the structure relative to an address of zero:&lt;br /&gt;
&lt;br /&gt;
Here are some examples:&lt;br /&gt;
   ${CROSS_COMPILE}gdb vmlinux&lt;br /&gt;
 GNU gdb (GDB) 7.2&lt;br /&gt;
 Copyright (C) 2010 Free Software Foundation, Inc.&lt;br /&gt;
 License GPLv3+: GNU GPL version 3 or later &amp;lt;http://gnu.org/licenses/gpl.html&amp;gt;&lt;br /&gt;
 This is free software: you are free to change and redistribute it.&lt;br /&gt;
 There is NO WARRANTY, to the extent permitted by law.  Type &amp;quot;show copying&amp;quot;&lt;br /&gt;
 and &amp;quot;show warranty&amp;quot; for details.&lt;br /&gt;
 This GDB was configured as &amp;quot;--host=i686-pc-linux-gnu --target=arm-sony-linux-gnueabi&amp;quot;.&lt;br /&gt;
 For bug reporting instructions, please see:&lt;br /&gt;
 &amp;lt;http://www.gnu.org/software/gdb/bugs/&amp;gt;.&lt;br /&gt;
 (gdb) p &amp;amp;((struct poll_wqueues *)0)-&amp;gt;polling_task&lt;br /&gt;
 $6 = (struct task_struct **) 0xc&lt;br /&gt;
 (gdb) p/d &amp;amp;((struct poll_wqueues *)0)-&amp;gt;error&lt;br /&gt;
 $4 = 20&lt;br /&gt;
&lt;br /&gt;
the second example could be read as: &amp;quot;print, in decimal, the address (offset)&lt;br /&gt;
of the element error using address 0 cast as a pointer to struct poll_wqueues&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'pt' is the first element of struct poll_wqueues.&lt;br /&gt;
Here is an example using array offsets, showing that struct poll_wqueues is 604 bytes long.&lt;br /&gt;
&lt;br /&gt;
 (gdb) p/d &amp;amp;((struct poll_wqueues *)0)[0]-&amp;gt;pt&lt;br /&gt;
 $2 = 0&lt;br /&gt;
 (gdb) p/d &amp;amp;((struct poll_wqueues *)0)[1]-&amp;gt;pt&lt;br /&gt;
 $3 = 604&lt;br /&gt;
&lt;br /&gt;
== GCC Tips and Tricks ==&lt;br /&gt;
* This section of [[GCC Tips]] is a collection of tips and tricks helpful for embedded developers&lt;br /&gt;
&lt;br /&gt;
== Network Setup ==&lt;br /&gt;
* Settings up a [[Bluetooth Network]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Wishlist Items =&lt;br /&gt;
*[[Continuous Logging for Watchdog Timer Expiration]]&lt;br /&gt;
*[[Crash Diagnostics]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Development Tools]]&lt;/div&gt;</summary>
		<author><name>Tord</name></author>	</entry>

	</feed>