debuggers: import openocd-0.7.0

Initial check-in of openocd-0.7.0 as it can be downloaded from
http://sourceforge.net/projects/openocd/files/openocd/0.7.0/

Any modifications will follow.

Change-Id: I6949beaefd589e046395ea0cb80f4e1ab1654d55
This commit is contained in:
Lars Rademacher
2013-10-21 00:50:02 +02:00
parent 85fffe007e
commit 83d72a091e
1148 changed files with 571445 additions and 0 deletions

View File

@ -0,0 +1,11 @@
include $(top_srcdir)/common.mk
#METASOURCES = AUTO
noinst_LTLIBRARIES = libtransport.la
libtransport_la_SOURCES = \
transport.c
noinst_HEADERS = \
transport.h
MAINTAINERCLEANFILES = $(srcdir)/Makefile.in

View File

@ -0,0 +1,567 @@
# Makefile.in generated by automake 1.13.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2012 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__make_dryrun = \
{ \
am__dry=no; \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
*) \
for am__flg in $$MAKEFLAGS; do \
case $$am__flg in \
*=*|--*) ;; \
*n*) am__dry=yes; break;; \
esac; \
done;; \
esac; \
test $$am__dry = yes; \
}
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
DIST_COMMON = $(top_srcdir)/common.mk $(srcdir)/Makefile.in \
$(srcdir)/Makefile.am $(top_srcdir)/depcomp $(noinst_HEADERS)
@INTERNAL_JIMTCL_TRUE@am__append_1 = -I$(top_srcdir)/jimtcl \
@INTERNAL_JIMTCL_TRUE@ -I$(top_builddir)/jimtcl
subdir = src/transport
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/config_subdir.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
LTLIBRARIES = $(noinst_LTLIBRARIES)
libtransport_la_LIBADD =
am_libtransport_la_OBJECTS = transport.lo
libtransport_la_OBJECTS = $(am_libtransport_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am__v_lt_1 =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
AM_V_CC = $(am__v_CC_@AM_V@)
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
am__v_CC_0 = @echo " CC " $@;
am__v_CC_1 =
CCLD = $(CC)
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
SOURCES = $(libtransport_la_SOURCES)
DIST_SOURCES = $(libtransport_la_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
HEADERS = $(noinst_HEADERS)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CC_FOR_BUILD = @CC_FOR_BUILD@
CFLAGS = @CFLAGS@
CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@
FGREP = @FGREP@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIBTOOL_DEPS = @LIBTOOL_DEPS@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
doxygen_as_html = @doxygen_as_html@
doxygen_as_pdf = @doxygen_as_pdf@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
subdirs = @subdirs@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
# common flags used in openocd build
AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/src \
-I$(top_srcdir)/src/helper -DPKGDATADIR=\"$(pkgdatadir)\" \
-DPKGLIBDIR=\"$(pkglibdir)\" $(am__append_1)
#METASOURCES = AUTO
noinst_LTLIBRARIES = libtransport.la
libtransport_la_SOURCES = \
transport.c
noinst_HEADERS = \
transport.h
MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/common.mk $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/transport/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu src/transport/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_srcdir)/common.mk:
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
clean-noinstLTLIBRARIES:
-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
@list='$(noinst_LTLIBRARIES)'; \
locs=`for p in $$list; do echo $$p; done | \
sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
sort -u`; \
test -z "$$locs" || { \
echo rm -f $${locs}; \
rm -f $${locs}; \
}
libtransport.la: $(libtransport_la_OBJECTS) $(libtransport_la_DEPENDENCIES) $(EXTRA_libtransport_la_DEPENDENCIES)
$(AM_V_CCLD)$(LINK) $(libtransport_la_OBJECTS) $(libtransport_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/transport.Plo@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-am
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-am
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-am
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(LTLIBRARIES) $(HEADERS)
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
clean: clean-am
clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am:
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am:
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \
ctags-am distclean distclean-compile distclean-generic \
distclean-libtool distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags tags-am uninstall uninstall-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@ -0,0 +1,363 @@
/*
* Copyright (c) 2010 by David Brownell
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
/** @file
* Infrastructure for specifying and managing the transport protocol
* used in a given debug or programming session.
*
* Examples of "debug-capable" transports are JTAG or SWD.
* Additionally, JTAG supports boundary scan testing.
*
* Examples of "programming-capable" transports include SPI or UART;
* those are used (often mediated by a ROM bootloader) for ISP style
* programming, to perform an initial load of code into flash, or
* sometimes into SRAM. Target code could use "variant" options to
* decide how to use such protocols. For example, Cortex-M3 cores
* from TI/Luminary and from NXP use different protocols for for
* UART or SPI based firmware loading.
*
* As a rule, there are protocols layered on top of the transport.
* For example, different chip families use JTAG in different ways
* for debugging. Also, each family that supports programming over
* a UART link for initial firmware loading tends to define its own
* messaging and error handling.
*/
#include <helper/log.h>
#include <transport/transport.h>
extern struct command_context *global_cmd_ctx;
/*-----------------------------------------------------------------------*/
/*
* Infrastructure internals
*/
/** List of transports known to OpenOCD. */
static struct transport *transport_list;
/**
* NULL-terminated Vector of names of transports which the
* currently selected debug adapter supports. This is declared
* by the time that adapter is fully set up.
*/
static const char **allowed_transports;
/** * The transport being used for the current OpenOCD session. */
static struct transport *session;
static int transport_select(struct command_context *ctx, const char *name)
{
/* name may only identify a known transport;
* caller guarantees session's transport isn't yet set.*/
for (struct transport *t = transport_list; t; t = t->next) {
if (strcmp(t->name, name) == 0) {
int retval = t->select(ctx);
/* select() registers commands specific to this
* transport, and may also reset the link, e.g.
* forcing it to JTAG or SWD mode.
*/
if (retval == ERROR_OK)
session = t;
else
LOG_ERROR("Error selecting '%s' as transport", t->name);
return retval;
}
}
LOG_ERROR("No transport named '%s' is available.", name);
return ERROR_FAIL;
}
/**
* Called by debug adapter drivers, or affiliated Tcl config scripts,
* to declare the set of transports supported by an adapter. When
* there is only one member of that set, it is automatically selected.
*/
int allow_transports(struct command_context *ctx, const char **vector)
{
/* NOTE: caller is required to provide only a list
* of *valid* transport names
*
* REVISIT should we validate that? and insist there's
* at least one non-NULL element in that list?
*
* ... allow removals, e.g. external strapping prevents use
* of one transport; C code should be definitive about what
* can be used when all goes well.
*/
if (allowed_transports != NULL || session) {
LOG_ERROR("Can't modify the set of allowed transports.");
return ERROR_FAIL;
}
allowed_transports = vector;
/* autoselect if there's no choice ... */
if (!vector[1]) {
LOG_INFO("only one transport option; autoselect '%s'", vector[0]);
return transport_select(ctx, vector[0]);
}
return ERROR_OK;
}
/**
* Used to verify corrrect adapter driver initialization.
*
* @returns true iff the adapter declared one or more transports.
*/
bool transports_are_declared(void)
{
return allowed_transports != NULL;
}
/**
* Registers a transport. There are general purpose transports
* (such as JTAG), as well as relatively proprietary ones which are
* specific to a given chip (or chip family).
*
* Code implementing a transport needs to register it before it can
* be selected and then activated. This is a dynamic process, so
* that chips (and families) can define transports as needed (without
* nneeding error-prone static tables).
*
* @param new_transport the transport being registered. On a
* successful return, this memory is owned by the transport framework.
*
* @returns ERROR_OK on success, else a fault code.
*/
int transport_register(struct transport *new_transport)
{
struct transport *t;
for (t = transport_list; t; t = t->next) {
if (strcmp(t->name, new_transport->name) == 0) {
LOG_ERROR("transport name already used");
return ERROR_FAIL;
}
}
if (!new_transport->select || !new_transport->init)
LOG_ERROR("invalid transport %s", new_transport->name);
/* splice this into the list */
new_transport->next = transport_list;
transport_list = new_transport;
LOG_DEBUG("register '%s'", new_transport->name);
return ERROR_OK;
}
/**
* Returns the transport currently being used by this debug or
* programming session.
*
* @returns handle to the read-only transport entity.
*/
struct transport *get_current_transport(void)
{
/* REVISIT -- constify */
return session;
}
/*-----------------------------------------------------------------------*/
/*
* Infrastructure for Tcl interface to transports.
*/
/**
* Makes and stores a copy of a set of transports passed as
* parameters to a command.
*
* @param vector where the resulting copy is stored, as an argv-style
* NULL-terminated vector.
*/
COMMAND_HELPER(transport_list_parse, char ***vector)
{
char **argv;
unsigned n = CMD_ARGC;
unsigned j = 0;
*vector = NULL;
if (n < 1)
return ERROR_COMMAND_SYNTAX_ERROR;
/* our return vector must be NULL terminated */
argv = (char **) calloc(n + 1, sizeof(char *));
if (argv == NULL)
return ERROR_FAIL;
for (unsigned i = 0; i < n; i++) {
struct transport *t;
for (t = transport_list; t; t = t->next) {
if (strcmp(t->name, CMD_ARGV[i]) != 0)
continue;
argv[j++] = strdup(CMD_ARGV[i]);
break;
}
if (!t) {
LOG_ERROR("no such transport '%s'", CMD_ARGV[i]);
goto fail;
}
}
*vector = argv;
return ERROR_OK;
fail:
for (unsigned i = 0; i < n; i++)
free(argv[i]);
free(argv);
return ERROR_FAIL;
}
COMMAND_HANDLER(handle_transport_init)
{
LOG_DEBUG("%s", __func__);
if (!session) {
LOG_ERROR("session's transport is not selected.");
/* no session transport configured, print transports then fail */
const char **vector = allowed_transports;
while (*vector) {
LOG_ERROR("allow transport '%s'", *vector);
vector++;
}
return ERROR_FAIL;
}
return session->init(CMD_CTX);
}
COMMAND_HANDLER(handle_transport_list)
{
if (CMD_ARGC != 0)
return ERROR_COMMAND_SYNTAX_ERROR;
command_print(CMD_CTX, "The following transports are available:");
for (struct transport *t = transport_list; t; t = t->next)
command_print(CMD_CTX, "\t%s", t->name);
return ERROR_OK;
}
/**
* Implements the Tcl "transport select" command, choosing the
* transport to be used in this debug session from among the
* set supported by the debug adapter being used. Return value
* is scriptable (allowing "if swd then..." etc).
*/
static int jim_transport_select(Jim_Interp *interp, int argc, Jim_Obj * const *argv)
{
switch (argc) {
case 1: /* return/display */
if (!session) {
LOG_ERROR("session's transport is not selected.");
return JIM_ERR;
} else {
Jim_SetResultString(interp, session->name, -1);
return JIM_OK;
}
break;
case 2: /* assign */
if (session) {
/* can't change session's transport after-the-fact */
LOG_ERROR("session's transport is already selected.");
return JIM_ERR;
}
/* Is this transport supported by our debug adapter?
* Example, "JTAG-only" means SWD is not supported.
*
* NOTE: requires adapter to have been set up, with
* transports declared via C.
*/
if (!allowed_transports) {
LOG_ERROR("Debug adapter doesn't support any transports?");
return JIM_ERR;
}
for (unsigned i = 0; allowed_transports[i]; i++) {
if (strcmp(allowed_transports[i], argv[1]->bytes) == 0)
return transport_select(global_cmd_ctx, argv[1]->bytes);
}
LOG_ERROR("Debug adapter doesn't support '%s' transport", argv[1]->bytes);
return JIM_ERR;
break;
default:
Jim_WrongNumArgs(interp, 1, argv, "[too many parameters]");
return JIM_ERR;
}
}
static const struct command_registration transport_commands[] = {
{
.name = "init",
.handler = handle_transport_init,
/* this would be COMMAND_CONFIG ... except that
* it needs to trigger event handlers that may
* require COMMAND_EXEC ...
*/
.mode = COMMAND_ANY,
.help = "Initialize this session's transport",
.usage = ""
},
{
.name = "list",
.handler = handle_transport_list,
.mode = COMMAND_ANY,
.help = "list all built-in transports",
.usage = ""
},
{
.name = "select",
.jim_handler = jim_transport_select,
.mode = COMMAND_ANY,
.help = "Select this session's transport",
.usage = "[transport_name]",
},
COMMAND_REGISTRATION_DONE
};
static const struct command_registration transport_group[] = {
{
.name = "transport",
.mode = COMMAND_ANY,
.help = "Transport command group",
.chain = transport_commands,
.usage = ""
},
COMMAND_REGISTRATION_DONE
};
int transport_register_commands(struct command_context *ctx)
{
return register_commands(ctx, NULL, transport_group);
}

View File

@ -0,0 +1,86 @@
/*
* Copyright (c) 2010 by David Brownell
* Copyright (C) 2011 Tomasz Boleslaw CEDRO (http://www.tomek.cedro.info)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef TRANSPORT_H
#define TRANSPORT_H
#include "helper/command.h"
/**
* Wrapper for transport lifecycle operations.
*
* OpenOCD talks to targets through some kind of debugging
* or programming adapter, using some protocol that probably
* has target-specific aspects.
*
* A "transport" reflects electrical protocol to the target,
* e..g jtag, swd, spi, uart, ... NOT the messaging protocols
* layered over it (e.g. JTAG has eICE, CoreSight, Nexus, OnCE,
* and more).
*
* In addition to the lifecycle operations packaged by this
* structure, a transport also involves an interface supported
* by debug adapters and used by components such as debug targets.
* For non-debug transports, there may be interfaces used to
* write to flash chips.
*/
struct transport {
/**
* Each transport has a unique name, used to select it
* from among the alternatives. Examples might include
* "jtag", * "swd", "AVR_ISP" and more.
*/
const char *name;
/**
* When a transport is selected, this method registers
* its commands and activates the transport (e.g. resets
* the link).
*
* After those commands are registered, they will often
* be used for further configuration of the debug link.
*/
int (*select)(struct command_context *ctx);
/**
* server startup uses this method to validate transport
* configuration. (For example, with JTAG this interrogates
* the scan chain against the list of expected TAPs.)
*/
int (*init)(struct command_context *ctx);
/**
* Transports are stored in a singly linked list.
*/
struct transport *next;
};
int transport_register(struct transport *new_transport);
struct transport *get_current_transport(void);
int transport_register_commands(struct command_context *ctx);
COMMAND_HELPER(transport_list_parse, char ***vector);
int allow_transports(struct command_context *ctx, const char **vector);
bool transports_are_declared(void);
#endif