Commit 6c6c8849 authored by Julian Kranz's avatar Julian Kranz

Merge ../gdsl-toolkit-lovis into lovis

parents cc2539fb 885162a4
# GDSL Toolkit
This section describes how the GDSL toolkit is built and which dependencies are
required.
The GDSL toolkit is a software framework for specifying machine language
decoders. It is meant to allow a natural specification that resembles the way
the vendor manuals describe the instruction set. The toolkit comes with a set
of decoders, semantics translators to the analysis-friendly intermediate
reprensentation RReil, IR optimizations, and bindings to other programming
languages such as C++ and Java.
## Dependencies
The GDSL compiler and core libraries require the following software to be on the
current search PATH:
This section describes how the GDSL toolkit is built and which dependencies
are required. The GDSL compiler and core libraries require the following
software to be on the current search PATH:
* MLton
* CMake
......@@ -44,3 +49,11 @@ tools can be specified.
The GDSL toolkit contains a number of demo applications and libraries. The tools
and libraries are presented in wiki (http://code.google.com/p/gdsl-toolkit/).
# Roadmap
* Architectures
* Full support for ARMv7 and ARMv8
* Testing
* Support testing of all our architectures (reusing common parts of the tester)
* Testing of the decoder by reacting to / expecting illegal instruction exceptions
\ No newline at end of file
......@@ -6,6 +6,9 @@ namespace gdsl {
bare_frontend::bare_frontend(std::string const& name) {
char err = gdsl_multiplex_frontend_get_by_lib_name(&frontend, name.c_str());
if (err != GDSL_MULTIPLEX_ERROR_NONE)
err = gdsl_multiplex_frontend_get_by_path_name_with_base(&frontend, ".",
name.c_str());
if (err != GDSL_MULTIPLEX_ERROR_NONE)
throw std::runtime_error("Unable to open frontend");
initialized = true;
......
......@@ -126,6 +126,17 @@ extern size_t gdsl_multiplex_frontends_list_with_base(
extern int gdsl_multiplex_frontend_get_by_desc(struct frontend* frontend,
struct frontend_desc desc);
/*
* This function opens a front-end specified by its library name found in
* the folder pointed to by 'base' and returns whether opening was successful.
*
* Important: This is a stub only. This function always returns a front-end
* where all callbacks point to linked functions. There is no opening
* going on.
*/
extern int gdsl_multiplex_frontend_get_by_path_name_with_base(
struct frontend *frontend, char const *base, char const *name);
/*
* This function opens a front-end specified by its library name and returns
* whether opening was successful.
......
......@@ -156,6 +156,22 @@ int gdsl_multiplex_frontend_get_by_desc(struct frontend *frontend, struct fronte
return gdsl_multiplex_frontend_get(frontend, dl);
}
int gdsl_multiplex_frontend_get_by_path_name_with_base(
struct frontend *frontend, char const *base, char const *name) {
char *lib;
size_t lib_length;
FILE *libf = open_memstream(&lib, &lib_length);
fprintf(libf, "%s/libgdsl-%s.so", base, name);
fputc(0, libf);
fclose(libf);
void *dl = dlopen(lib, RTLD_LAZY);
free(lib);
if (!dl) return GDSL_MULTIPLEX_ERROR_UNABLE_TO_OPEN;
return gdsl_multiplex_frontend_get(frontend, dl);
}
int gdsl_multiplex_frontend_get_by_lib_name(struct frontend *frontend, char const *name) {
char *lib;
size_t lib_length;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment