Skip to content

Commit b97cfd6

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents a920a8a + f5dd564 commit b97cfd6

File tree

371 files changed

+8705
-3044
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

371 files changed

+8705
-3044
lines changed

.checkpatch.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
--ignore LINE_SPACING
1818
--ignore LOGICAL_CONTINUATIONS
1919
--ignore MACRO_WITH_FLOW_CONTROL
20-
--ignore NEW_TYPEDEFS
2120
--ignore PARENTHESIS_ALIGNMENT
2221
--ignore PREFER_DEFINED_ATTRIBUTE_MACRO
2322
--ignore PREFER_FALLTHROUGH

.github/workflows/snapshot.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
sudo apt-get update
1919
sudo apt-get install autotools-dev autoconf automake libtool pkg-config cmake texinfo texlive g++-mingw-w64-i686
2020
- name: Checkout Code
21-
uses: actions/checkout@v1
21+
uses: actions/checkout@v4
2222
- run: ./bootstrap
2323
- name: Prepare libusb1
2424
env:
@@ -66,6 +66,14 @@ jobs:
6666
cd libjaylink-${LIBJAYLINK_VER}
6767
./autogen.sh
6868
echo "LIBJAYLINK_SRC=$PWD" >> $GITHUB_ENV
69+
- name: Prepare jimtcl
70+
env:
71+
JIMTCL_VER: 0.83
72+
run: |
73+
mkdir -p $DL_DIR && cd $DL_DIR
74+
wget https://github.com/msteveb/jimtcl/archive/refs/tags/${JIMTCL_VER}.tar.gz
75+
tar -xzf ${JIMTCL_VER}.tar.gz
76+
echo "JIMTCL_SRC=$PWD/jimtcl-${JIMTCL_VER}" >> $GITHUB_ENV
6977
- name: Package OpenOCD for windows
7078
env:
7179
MAKE_JOBS: 2
@@ -75,6 +83,7 @@ jobs:
7583
LIBFTDI_CONFIG: -DSTATICLIBS=OFF -DEXAMPLES=OFF -DFTDI_EEPROM=OFF
7684
CAPSTONE_CONFIG: "CAPSTONE_BUILD_CORE_ONLY=yes CAPSTONE_STATIC=yes CAPSTONE_SHARED=no"
7785
LIBJAYLINK_CONFIG: --enable-shared --disable-static
86+
JIMTCL_CONFIG: --with-ext=json --minimal --disable-ssl
7887
run: |
7988
# check if there is tag pointing at HEAD, otherwise take the HEAD SHA-1 as OPENOCD_TAG
8089
OPENOCD_TAG="`git tag --points-at HEAD`"
@@ -102,11 +111,11 @@ jobs:
102111
echo "IS_PRE_RELEASE=$IS_PRE_RELEASE" >> $GITHUB_ENV
103112
echo "ARTIFACT_PATH=$PWD/$ARTIFACT" >> $GITHUB_ENV
104113
- name: Publish OpenOCD packaged for windows
105-
uses: actions/upload-artifact@v3
114+
uses: actions/upload-artifact@v4
106115
with:
107116
path: ${{ env.ARTIFACT_PATH }}
108117
- name: Delete 'latest' Release
109-
uses: dev-drprasad/delete-tag-and-release@v0.2.1
118+
uses: dev-drprasad/delete-tag-and-release@v1.1
110119
with:
111120
delete_release: true
112121
tag_name: ${{ env.RELEASE_NAME }}

.gitignore

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
*.la
1212
*.in
1313

14-
# generated source files
15-
src/jtag/minidriver_imp.h
16-
src/jtag/jtag_minidriver.h
14+
# coverage files (gcov)
15+
*.gcda
16+
*.gcno
1717

1818
# OpenULINK driver files generated by SDCC
1919
src/jtag/drivers/OpenULINK/*.rel
@@ -84,6 +84,9 @@ patches
8484
.cproject
8585
.settings
8686

87+
# VSCode stuff
88+
.vscode
89+
8790
# Emacs temp files
8891
*~
8992

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
[submodule "tools/git2cl"]
2-
path = tools/git2cl
3-
url = https://git.savannah.nongnu.org/git/git2cl.git
41
[submodule "jimtcl"]
52
path = jimtcl
63
url = https://github.com/msteveb/jimtcl.git

HACKING

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,22 @@ patch:
9292
make
9393
@endcode
9494

95+
- Code coverage analysis
96+
97+
By inspecting the code coverage, you can identify potential gaps in your testing
98+
and use that information to improve your test scenarios.
99+
100+
Example usage:
101+
@code
102+
mkdir build-gcov; cd build-gcov
103+
../configure --enable-gcov [...]
104+
make
105+
# ... Now execute your test scenarios to collect OpenOCD code coverage ...
106+
lcov --capture --directory ./src --output-file openocd-coverage.info
107+
genhtml openocd-coverage.info --output-directory coverage_report
108+
# ... Open coverage_report/index.html in a web browser ...
109+
@endcode
110+
95111
Please consider performing these additional checks where appropriate
96112
(especially Clang Static Analyzer for big portions of new code) and
97113
mention the results (e.g. "Valgrind-clean, no new Clang analyzer
@@ -287,6 +303,13 @@ Only for <em>exceptional cases</em>, it is allowed to submit patches
287303
to Gerrit with the special field 'Checkpatch-ignore:' in the commit
288304
message. This field will cause checkpatch to ignore the error types
289305
listed in the field, only for the patch itself.
306+
For errors in the commit message, the special field has to be put in
307+
the commit message before the line that produces the error.
308+
The special field must be added <em>before</em> the 'Signed-off-by:'
309+
line, otherwise it is ignored.
310+
To ignore multiple errors, either add multiple lines with the special
311+
field or add multiple error types, separated by space or commas, in a
312+
single line.
290313
The error type is printed by checkpatch on failure.
291314
For example the names of Windows APIs mix lower and upper case chars,
292315
in violation of OpenOCD coding style, triggering a 'CAMELCASE' error:

Makefile.am

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ AUTOMAKE_OPTIONS = gnu 1.6
77
.DELETE_ON_ERROR:
88

99
# make sure we pass the correct jimtcl flags to distcheck
10-
DISTCHECK_CONFIGURE_FLAGS = --disable-install-jim
10+
AM_DISTCHECK_CONFIGURE_FLAGS = --disable-install-jim
1111

1212
# do not run Jim Tcl tests (esp. during distcheck)
1313
check-recursive: SUBDIRS :=
@@ -38,6 +38,7 @@ endif
3838

3939
# common flags used in openocd build
4040
AM_CFLAGS = $(GCC_WARNINGS)
41+
AM_LDFLAGS =
4142

4243
AM_CPPFLAGS = $(HOST_CPPFLAGS)\
4344
-I$(top_srcdir)/src \
@@ -51,6 +52,12 @@ AM_CPPFLAGS += -I$(top_srcdir)/jimtcl \
5152
else
5253
AM_CPPFLAGS += $(JIMTCL_CFLAGS)
5354
endif
55+
56+
if USE_GCOV
57+
AM_CFLAGS += --coverage
58+
AM_LDFLAGS += --coverage
59+
endif
60+
5461
EXTRA_DIST += \
5562
BUGS \
5663
HACKING \
@@ -116,14 +123,13 @@ TCL_PATH = tcl
116123
TCL_FILES = find $(srcdir)/$(TCL_PATH) -name '*.cfg' -o -name '*.tcl' -o -name '*.txt' | \
117124
sed -e 's,^$(srcdir)/$(TCL_PATH),,'
118125

119-
# Without the PERL_UNICODE="IO" workaround below when running git2cl, you get several
120-
# "Wide character" warnings and you also risk an invalid character encoding in
121-
# the generated ChangeLog file. For more information, see this bug report:
122-
# Warning "Wide character in print"
123-
# https://savannah.nongnu.org/bugs/?65689
126+
# The git log command below generates many empty text lines with only some space characters
127+
# for indentation purposes, so use sed to trim all trailing whitespace.
124128
dist-hook:
125129
if test -d $(srcdir)/.git -a \( ! -e $(distdir)/ChangeLog -o -w $(distdir)/ChangeLog \) ; then \
126-
git --git-dir $(srcdir)/.git log | PERL_UNICODE="IO" $(srcdir)/tools/git2cl/git2cl > $(distdir)/ChangeLog ; \
130+
git --git-dir $(srcdir)/.git log --date=short --pretty="format:%ad %aN <%aE>%n%n%w(0,4,6)* %B" \
131+
| sed 's/[[:space:]]*$$//' > $(distdir)/ChangeLog.tmp && \
132+
mv $(distdir)/ChangeLog.tmp $(distdir)/ChangeLog; \
127133
fi
128134
for i in $$($(TCL_FILES)); do \
129135
j="$(distdir)/$(TCL_PATH)/$$i" && \

README

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,7 @@ You'll also need:
209209
- make
210210
- libtool
211211
- pkg-config >= 0.23 or pkgconf
212-
213-
OpenOCD uses jimtcl library; build from git can retrieve jimtcl as git
214-
submodule.
212+
- libjim >= 0.79
215213

216214
Additionally, for building from git:
217215

bootstrap

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
# Run the autotools bootstrap sequence to create the configure script
55

6-
# Abort execution on error
7-
set -e
6+
set -e # Abort execution on error.
7+
set -u # Abort if you reference an undefined variable.
88

99
if which libtoolize > /dev/null; then
1010
libtoolize="libtoolize"
@@ -15,13 +15,23 @@ else
1515
exit 1
1616
fi
1717

18-
if [ "$1" = "nosubmodule" ]; then
19-
SKIP_SUBMODULE=1
20-
elif [ -n "$1" ]; then
21-
echo "$0: Illegal argument $1"
22-
echo "USAGE: $0 [nosubmodule]"
23-
exit 1
24-
fi
18+
WITH_SUBMODULES=0
19+
20+
case "$#" in
21+
0) ;;
22+
1) if [ "$1" = "with-submodules" ]; then
23+
WITH_SUBMODULES=1
24+
elif [ "$1" = "nosubmodule" ]; then
25+
WITH_SUBMODULES=0
26+
elif [ -n "$1" ]; then
27+
echo "$0: Illegal argument $1" >&2
28+
echo "USAGE: $0 [with-submodules]" >&2
29+
exit 1
30+
fi;;
31+
*) echo "$0: Wrong number of command-line arguments." >&2
32+
echo "USAGE: $0 [with-submodules]" >&2
33+
exit 1;;
34+
esac
2535

2636
# bootstrap the autotools
2737
(
@@ -34,12 +44,12 @@ autoheader --warnings=all
3444
automake --warnings=all --gnu --add-missing --copy
3545
)
3646

37-
if [ -n "$SKIP_SUBMODULE" ]; then
38-
echo "Skipping submodule setup"
39-
else
47+
if [ "$WITH_SUBMODULES" -ne 0 ]; then
4048
echo "Setting up submodules"
4149
git submodule sync
4250
git submodule update --init
51+
else
52+
echo "Skipping submodule setup"
4353
fi
4454

4555
if [ -x src/jtag/drivers/libjaylink/autogen.sh ]; then

config_subdir.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ AC_DEFUN([AX_CONFIG_SUBDIR_OPTION],
77
AC_CONFIG_SUBDIRS([$1])
88
99
m4_ifblank([$2], [rm -f $srcdir/$1/configure.gnu],
10-
[echo -e '#!/bin/sh\nexec "`dirname "'\$'0"`/configure" '"$2"' "'\$'@"' > "$srcdir/$1/configure.gnu"
10+
[printf '#!/bin/sh\nexec "`dirname "'\$'0"`/configure" '"$2"' "'\$'@"\n' > "$srcdir/$1/configure.gnu"
1111
])
1212
])

0 commit comments

Comments
 (0)