Using OpenOCD
Open On-Chip Debugger (OpenOCD), is a piece of software that acts as a bridge between your debugger interface and the JTAG interface. On one side, it will drive your JTAG interface and on the other side, present a standard GDB server that the debugger will use to drive it.
It will translate the debugger command I want to read a 32-bit value at address X to a series of zeros and ones your JTAG interface will clock to TDI. The interface gets the answer on TDO and sends it to OpenOCD, which translates it to an answer to GDB, the value at X is Y.
As much as the GDB server side is well established and standardized, OpenOCD needs to be able to talk correctly to your adapter and generate the correct series of zeros and ones for your target CPU/MCU. For this, OpenOCD will need the correct configuration. This is done in a series of configuration statements in TCL (http://openocd.org/doc/html/Tcl-Crash-Course.html).
OpenOCD configuration files are not simply variable affectation...