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 and then click "OK".
Optionally, you can select an TCF connection
instead.
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.
Be sure you change to the "Debug" perspective in Eclipse.
Click "Debug"
Accept the debug perspective.