Category: Eclipse

Eclipse: how to change perspective after terminating a process?

Eclipse, by default, automatically switches to the Debug perspective when you start debugging. However, it doesn’t go back to the previous perspective when the debug session is terminated and it just stays there even though there is nothing to debug because nothing is running.

I couldn’t find a native solution more than installing the Perspective Switcher Plugin. Once downloaded and unzipped the file, copy the .jar file (currently de.richinternet.plugins.perspectiveswitcher_0.1.1.jar) into the eclipse/plugins folder.

Restart Eclipse and will get a new Preference panel. Now once you terminate the debug session, Eclipse will come back automatically to the previous perspective. Tested in Eclipse CDT Mars.

eclipse_perspective_switcher

 

 

 

 

Eclipse Luna/Mars: how to fix the ugly theme with XFCE

The latest versions of Eclipse Luna and Mars have an ugly aspect on XFCE, I am running Xubuntu and tried both with XFCE 4.10 and 4.12.

eclipse_ugly_theme_xfce_before

To fix the appearance we have to disable GTK3 by exporting SWT_GTK3=0

You can do this by creating a launcher and editing the .desktop file, for instance the launchers available on XFCE panels are stored in ~/.config/xfce4/panel, precisely in the launcher-xx subfolders. Once found out the appropriate .desktop file, edit the Exec line:

Exec=env SWT_GTK3=0 <path_to_eclipse_binary>

Save and launch it again. Now it should look like this:

eclipse_ugly_theme_xfce_after

 

 

Current instruction pointer and line highlight colors in Eclipse CDT

I always forget how to change two colours while developing with Eclipse CDT.

Current line highlight

Window=>Preferences=>General=>Editors=>Text Editors

Appearance color options=>Current line highlight

 

eclipse_cdt_current_line_highlight

 

Debug Current Instruction Pointer

Window=>Preferences=>General=>Editors=>Text Editors=>Annotations

Annotation types=>Debug Current Instruction Pointer

 

eclipse_cdt_current_debug_line

How to install OpenOCD v0.8.x, a useful hardware debugger for Eclipse and Netbeans

OpenOCD (Open On-Chip Debugger) is an open-source software that provides debugging and in-system programming for embedded target devices using JTAG interface.

OpenOCD provides also the ability to flash NAND and NOR FLASH memory devices that are attached to the processor on the target system. Flash programming is supported for external CFI compatible flashes (Intel and AMD/Spansion command set) and several internal flashes (LPC2000, AT91SAM7, STR7x, STR9x, LM3 and STM32x). Official website: http://openocd.sourceforge.net

 

How to install OpenOCD v0.8.0

This procedure has been verified on Xubuntu 14.04.

We create a working directory and clone its repository:

mkdir openocd
git clone git://git.code.sf.net/p/openocd/code repository
cd repository

To see all the available stable versions:

git tag

Switch from master to the latest stable release, at this time v.0.8.0.

git checkout v0.8.0

Install packages:

sudo apt-get install libtool automake libusb-1.0.0-dev texinfo libusb-dev

libusb-dev will enable automatically the support for
Olimex ARM-JTAG-EW Programmer           yes (auto)

libusb-1.0.0-dev will enable automatically the support for
MPSSE mode of FTDI based devices        yes (auto)
ST-Link JTAG Programmer                 yes (auto)
TI ICDI JTAG Programmer                 yes (auto)

texinfo is also needed to avoid the error

line 81: makeinfo: command not found
WARNING: 'makeinfo' is missing on your system.
You should only need it if you modified a '.texi' file, or
any other file indirectly affecting the aspect of the manual.

 

Before compiling

Because we are building from repository

./bootstrap

To see the list of all the supported options: ./configure –help

This time any interface based on the parallel port are not enabled

./configure

At the end we will get the summary reporting the supported devices

OpenOCD configuration summary
--------------------------------------------------
MPSSE mode of FTDI based devices        yes (auto)
ST-Link JTAG Programmer                 yes (auto)
TI ICDI JTAG Programmer                 yes (auto)
Keil ULINK JTAG Programmer              yes (auto)
Altera USB-Blaster II Compatible        yes (auto)
Segger J-Link JTAG Programmer           yes (auto)
OSBDM (JTAG only) Programmer            yes (auto)
eStick/opendous JTAG Programmer         yes (auto)
Andes JTAG Programmer                   yes (auto)
Versaloon-Link JTAG Programmer          yes (auto)
USBProg JTAG Programmer                 yes (auto)
Raisonance RLink JTAG Programmer        yes (auto)
Olimex ARM-JTAG-EW Programmer           yes (auto)
CMSIS-DAP Compliant Debugger            no

 

Time to compile and install

make
sudo make install

The executable will be installed in: /usr/local/bin/openocd while

scripts will be in: /usr/local/share/openocd/scripts

 

Configure UDEV for the new devices

Copy the rules file into udev default directory and reload the rules. After that assure your username is in the plugdev group.

sudo cp  /usr/local/share/openocd/contrib/99-openocd.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules

 

Create the pdf documentation

texlive is needed to create the documentation

sudo apt-get install texlive
make pdf

A pdf containing the documentation will be created in /doc.

WordPress Themes