Skip to content

Commit 075630b

Browse files
committed
Add missing Makefile, Readme and documentation
1 parent a38d511 commit 075630b

11 files changed

+113
-18
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
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>"

CODEOWNERS

Lines changed: 1 addition & 0 deletions
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

Lines changed: 33 additions & 0 deletions
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

Lines changed: 6 additions & 2 deletions
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 linking.dir
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

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
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

11-
# # Man page
12-
# if(NOT WIN32)
13-
# install(
14-
# DIRECTORY ${CMAKE_SOURCE_DIR}/doc/man/
15-
# DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
16-
# FILES_MATCHING PATTERN "goto-harness*")
17-
# endif()
16+
# Man page
17+
if(NOT WIN32)
18+
install(
19+
DIRECTORY ${CMAKE_SOURCE_DIR}/doc/man/
20+
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
21+
FILES_MATCHING PATTERN "goto-harness*")
22+
endif()

src/goto-inspect/Makefile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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+
../linking/linking$(LIBEXT) \
7+
../langapi/langapi$(LIBEXT) \
8+
../goto-programs/goto-programs$(LIBEXT) \
9+
../util/util$(LIBEXT) \
10+
# Empty last line
11+
12+
INCLUDES= -I ..
13+
14+
LIBS =
15+
16+
CLEANFILES = goto-inspect$(EXEEXT) goto-inspect$(LIBEXT)
17+
18+
include ../config.inc
19+
include ../common
20+
21+
all: goto-inspect$(EXEEXT)
22+
23+
###############################################################################
24+
25+
goto-inspect$(EXEEXT): $(OBJ)
26+
$(LINKBIN)
27+
28+
.PHONY: goto-inspect-mac-signed
29+
30+
goto-inspect-mac-signed: goto-inspect$(EXEEXT)
31+
codesign -v -s $(OSX_IDENTITY) goto-inspect$(EXEEXT)
Lines changed: 13 additions & 1 deletion
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
}

src/goto-inspect/goto_inspect_parse_options.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
#include <util/config.h>
66
#include <util/exception_utils.h>
77
#include <util/exit_codes.h>
8-
#include <util/invariant.h>
9-
#include <util/make_unique.h>
108
#include <util/version.h>
119

1210
#include <goto-programs/goto_model.h>
@@ -36,7 +34,7 @@ int goto_inspect_parse_optionst::doit()
3634
// This just sets up the defaults (and would interpret options such as --32).
3735
config.set(cmdline);
3836

39-
// Normally we would register language front-ends here but as goto-harness
37+
// Normally we would register language front-ends here but as goto-inspect
4038
// only works on goto binaries, we don't need to
4139

4240
auto binary_filename = cmdline.args[0];

src/goto-inspect/goto_inspect_parse_options.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
// Author: Fotis Koutoulakis for Diffblue Ltd.
22

3-
#ifndef CPROVER_GOTO_INSPECT_PARSE_OPTIONS_H
4-
#define CPROVER_GOTO_INSPECT_PARSE_OPTIONS_H
3+
#ifndef CPROVER_GOTO_INSPECT_GOTO_INSPECT_PARSE_OPTIONS_H
4+
#define CPROVER_GOTO_INSPECT_GOTO_INSPECT_PARSE_OPTIONS_H
55

66
#include <util/parse_options.h>
77

8-
#include <string>
9-
108
// clang-format off
119
#define GOTO_INSPECT_OPTIONS \
1210
"(version)" \
@@ -23,4 +21,4 @@ struct goto_inspect_parse_optionst : public parse_options_baset
2321
goto_inspect_parse_optionst(int argc, const char *argv[]);
2422
};
2523

26-
#endif // CPROVER_GOTO_INSPECT_PARSE_OPTIONS_H
24+
#endif // CPROVER_GOTO_INSPECT_GOTO_INSPECT_PARSE_OPTIONS_H
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
goto-programs
2+
util

src/goto-inspect/readme.md

Lines changed: 10 additions & 0 deletions
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)