Skip to content

Commit 7c90a0e

Browse files
committed
Add missing Makefile, Readme and documentation
1 parent a38d511 commit 7c90a0e

9 files changed

+102
-3
lines changed

CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR
158158
"$<TARGET_FILE:goto-cc>"
159159
"$<TARGET_FILE:goto-diff>"
160160
"$<TARGET_FILE:goto-instrument>"
161+
"$<TARGET_FILE:goto-inspect>"
161162
"$<TARGET_FILE:goto-synthesizer>"
162163
"$<TARGET_FILE:janalyzer>"
163164
"$<TARGET_FILE:jbmc>"
@@ -232,6 +233,7 @@ cprover_default_properties(
232233
goto-diff-lib
233234
goto-inspect
234235
goto-harness
236+
goto-inspect
235237
goto-instrument
236238
goto-instrument-lib
237239
goto-programs

CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
/src/goto-harness/ @martin-cs @chris-ryder @peterschrammel
5454
/src/goto-instrument/ @martin-cs @chris-ryder @peterschrammel @tautschnig @kroening
5555
/src/goto-instrument/contracts/ @tautschnig @feliperodri @remi-delmas-3000
56+
/src/goto-inspect/ @diffblue/diffblue-opensource
5657
/src/goto-synthesizer/ @qinheping @tautschnig @feliperodri @remi-delmas-3000
5758
/src/goto-diff/ @tautschnig @peterschrammel
5859
/src/jsil/ @kroening @tautschnig

doc/man/goto-inspect.1

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
.TH GOTO-INSPECT "2" "May 2023" "goto-inspect-5.81.0" "User Commands"
2+
.SH NAME
3+
goto\-inspect \- Inspect goto-binaries.
4+
.SH SYNOPSIS
5+
.TP
6+
.B goto\-inspect [\-?] [\-h] [\-\-help]
7+
show help
8+
.TP
9+
.B goto\-inspect \-\-version
10+
show version and exit
11+
.TP
12+
.B goto\-inspect [options] \fIin\fR
13+
Inspect (show properties, goto-functions, etc of) given goto-binary.
14+
.SH DESCRIPTION
15+
\fBgoto-inspect\fR reads a GOTO binary, and shows goto-functions, properties,
16+
and other attributes associated with the goto-program.
17+
.SH OPTIONS
18+
.SS "User-interface options:"
19+
.TP
20+
\fB\-\-show\-goto\-functions\fR
21+
print the goto-program instructions for the functions contained by the binary.
22+
.SH ENVIRONMENT
23+
All tools honor the TMPDIR environment variable when generating temporary
24+
files and directories.
25+
.SH BUGS
26+
If you encounter a problem please create an issue at
27+
.B https://github.com/diffblue/cbmc/issues
28+
.SH SEE ALSO
29+
.BR cbmc (1),
30+
.BR goto-cc (1)
31+
.BR goto-instrument (1)
32+
.SH COPYRIGHT
33+
2023, Fotis Koutoulakis

src/Makefile

+6-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ DIRS = analyses \
1010
goto-cc \
1111
goto-checker \
1212
goto-diff \
13+
goto-inspect \
1314
goto-instrument \
1415
goto-harness \
1516
goto-programs \
@@ -36,6 +37,7 @@ all: cbmc.dir \
3637
goto-cc.dir \
3738
goto-diff.dir \
3839
goto-instrument.dir \
40+
goto-inspect.dir \
3941
goto-harness.dir \
4042
goto-synthesizer.dir \
4143
symtab2gb.dir \
@@ -82,6 +84,8 @@ goto-harness.dir: util.dir goto-programs.dir langapi.dir linking.dir \
8284
goto-instrument.dir: languages goto-programs.dir pointer-analysis.dir \
8385
goto-symex.dir linking.dir analyses.dir solvers.dir
8486

87+
goto-inspect.dir: util.dir goto-programs.dir languages
88+
8589
goto-checker.dir: solvers.dir goto-symex.dir goto-programs.dir
8690

8791
cbmc.dir: languages solvers.dir goto-symex.dir analyses.dir \
@@ -190,8 +194,8 @@ doc :
190194
install: all
191195
for b in \
192196
cbmc crangler \
193-
goto-analyzer goto-cc goto-diff goto-instrument goto-harness goto-synthesizer \
194-
symtab2gb ; do \
197+
goto-analyzer goto-cc goto-diff goto-instrument goto-inspect goto-harness \
198+
goto-synthesizer symtab2gb ; do \
195199
cp $$b/$$b $(PREFIX)/bin/ ; \
196200
cp ../doc/man/$$b.1 $(PREFIX)/doc/man/man1/ ; \
197201
done

src/goto-inspect/CMakeLists.txt

+5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1+
# For goto-inspect, we are not building a library - only a binary.
2+
13
file(GLOB_RECURSE sources "*.cpp" "*.h")
4+
25
add_executable(goto-inspect ${sources})
6+
37
generic_includes(goto-inspect)
48

59
target_link_libraries(goto-inspect
610
util
711
goto-programs
812
)
13+
914
install(TARGETS goto-inspect DESTINATION ${CMAKE_INSTALL_BINDIR})
1015

1116
# # Man page

src/goto-inspect/Makefile

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
SRC = goto_inspect_main.cpp \
2+
goto_inspect_parse_options.cpp \
3+
# Empty last line
4+
5+
OBJ += ../big-int/big-int$(LIBEXT) \
6+
../langapi/langapi$(LIBEXT) \
7+
../goto-programs/goto-programs$(LIBEXT) \
8+
../util/util$(LIBEXT) \
9+
# Empty last line
10+
11+
INCLUDES= -I ..
12+
13+
LIBS =
14+
15+
CLEANFILES = goto-inspect$(EXEEXT) goto-inspect$(LIBEXT)
16+
17+
include ../config.inc
18+
include ../common
19+
20+
all: goto-inspect$(EXEEXT)
21+
22+
###############################################################################
23+
24+
goto-inspect$(EXEEXT): $(OBJ)
25+
$(LINKBIN)
26+
27+
.PHONY: goto-inspect-mac-signed
28+
29+
goto-inspect-mac-signed: goto-inspect$(EXEEXT)
30+
codesign -v -s $(OSX_IDENTITY) goto-inspect$(EXEEXT)
+13-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
11
// Author: Fotis Koutoulakis for Diffblue Ltd.
22

3+
#ifdef _MSC_VER
4+
# include <util/unicode.h>
5+
#endif
6+
37
#include "goto_inspect_parse_options.h"
48

5-
int main(int argc, const char *argv[])
9+
#ifdef _MSC_VER
10+
int wmain(int argc, const wchar_t **argv_wide)
11+
{
12+
auto vec = narrow_argv(argc, argv_wide);
13+
auto narrow = to_c_str_array(std::begin(vec), std::end(vec));
14+
auto argv = narrow.data();
15+
#else
16+
int main(int argc, const char **argv)
617
{
18+
#endif
719
return goto_inspect_parse_optionst{argc, argv}.main();
820
}
+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
goto-programs
2+
util

src/goto-inspect/readme.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
\ingroup module_hidden
2+
\defgroup goto-synthesizer goto-synthesizer
3+
4+
# Folder goto-inspect
5+
6+
\author Fotis Koutoulakis
7+
8+
The `goto-inspect/` contains the code for the binary `goto-inspect`, intended
9+
to provide an all-purpose tool for inspection of goto-binaries (properties,
10+
goto-functions, etc).

0 commit comments

Comments
 (0)