Once the QEMU emulator is running the image, you can deploy your application using the Eclipse IDE and then use the emulator to perform debugging. Follow these steps to deploy the application.
$ ssh -XYUsing the above form, here is an example:user_name
@remote_host_ip
$ ssh -XY root@192.168.7.2After running the command, add the command to be executed in Eclipse's run configuration before the application as follows:
export DISPLAY=:10.0Be sure to not destroy the connection during your QEMU session (i.e. do not exit out of or close that shell).
Select "Debug Configurations..." from the "Run" menu.
In the left area, expand "C/C++Remote Application".
Locate your project and select it to bring up a new tabbed view in the Debug Configurations Dialog.
Click on the "Debugger" tab to see the cross-tool debugger you are using. Be sure to change to the debugger perspective in Eclipse.
Click on the "Main" tab.
Create a new connection to the QEMU instance by clicking on "new".
Select "SSH", which means Secure Socket Shell. Optionally, you can select a TCF connection instead.
Click "Next".
Clear out the "Connection name" field and enter any name you want for the connection.
Put the IP address for the connection in the "Host" field. For QEMU, the default is "192.168.7.2". However, if a previous QEMU session did not exit cleanly, the IP address increments (e.g. "192.168.7.3").
Enter "root", which is the default for QEMU, for the "User" field. Be sure to leave the password field empty.
Click "Finish" to close the New Connections Dialog.
If necessary, use the drop-down menu now in the "Connection" field and pick the IP Address you entered.
Assuming you are connecting as the root user,
which is the default for QEMU x86-64 SDK images provided by
the Yocto Project, in the "Remote Absolute File Path for
C/C++ Application" field, browse to
/home/root/
ProjectName
(e.g. /home/root/hello
).
You could also browse to any other path you have write
access to on the target such as
/usr/bin
.
This location is where your application will be located on
the QEMU system.
If you fail to browse to and specify an appropriate
location, QEMU will not understand what to remotely
launch.
Eclipse is helpful in that it auto fills your application
name for you assuming you browsed to a directory.
If you are prompted to provide a username and to optionally set a password, be sure you provide "root" as the username and you leave the password field blank.
If browsing to a directory fails or times
out, but you can
ssh
into your QEMU
or target from the command line and you
have proxies set up, it is likely that
Eclipse is sending the SSH traffic to a
proxy.
In this case, either use TCF , or click on
"Configure proxy settings" in the
connection dialog and add the target IP
address to the "bypass proxy" section.
You might also need to change
"Active Provider" from Native to Manual.
Be sure you change to the "Debug" perspective in Eclipse.
Click "Debug"
Accept the debug perspective.