Skip to content

Commit

Permalink
Automake, scoping as patch
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian Kranz committed May 26, 2015
1 parent 345cc03 commit 15306ad
Show file tree
Hide file tree
Showing 3 changed files with 151 additions and 7 deletions.
8 changes: 2 additions & 6 deletions Makefile.am
Expand Up @@ -717,15 +717,11 @@ if BUILD_AUXBINS
#endif
endif

#if X86_RREIL
private_headers += $(srcdir)/tools/x86-test-stats-runner/src/hash_array.h
#endif

MLLPT_LIB = $(srcdir)/detail/external/mllpt-lib/repair.sml $(srcdir)/detail/external/mllpt-lib/NJ-LICENSE $(srcdir)/detail/external/mllpt-lib/stream-pos.sml $(srcdir)/detail/external/mllpt-lib/ml-lpt-lib.cm $(srcdir)/detail/external/mllpt-lib/mllpt-lib.mlb $(srcdir)/detail/external/mllpt-lib/err-handler.sml $(srcdir)/detail/external/mllpt-lib/MLton-LICENSE $(srcdir)/detail/external/mllpt-lib/ulex-buffer.sml $(srcdir)/detail/external/mllpt-lib/ml-lpt-lib.mlb $(srcdir)/detail/external/mllpt-lib/wrapped-strm.sml $(srcdir)/detail/external/mllpt-lib/antlr-tokens-sig.sml $(srcdir)/detail/external/mllpt-lib/antlr-lexer-sig.sml $(srcdir)/detail/external/mllpt-lib/ebnf.sml

EXTRA_DIST = LICENSE $(JSOURCES_FULLPATH) $(MLLPT_LIB) $(GDSL_BASIS) $(GDSL_ASM) $(GDSL_X86) $(GDSL_RREIL) $(GDSL_X86SEM) $(GDSL_AVR) $(GDSL_AVRSEM) $(GDSL_MIPS5) $(GDSL_MIPS5SEM) $(GDSL_MIPS6) $(GDSL_MIPS6SEM) $(GDSL_ARM7) $(private_headers) $(RUNTIME) $(srcdir)/gdsl.h $(srcdir)/gdslc.mlb $(srcdir)/gdsl.cm $(GDSLC_SML_FILES) $(srcdir)/detail/ml/smlnj/unsealed.cm build.bat
EXTRA_DIST = LICENSE $(JSOURCES_FULLPATH) $(MLLPT_LIB) $(GDSL_BASIS) $(GDSL_ASM) $(GDSL_X86) $(GDSL_RREIL) $(GDSL_X86SEM) $(GDSL_AVR) $(GDSL_AVRSEM) $(GDSL_MIPS5) $(GDSL_MIPS5SEM) $(GDSL_MIPS6) $(GDSL_MIPS6SEM) $(GDSL_ARM7) $(GDSL_ARM7SEM) $(private_headers) $(RUNTIME) $(srcdir)/gdsl.h $(srcdir)/gdslc.mlb $(srcdir)/gdsl.cm $(GDSLC_SML_FILES) $(srcdir)/detail/ml/smlnj/unsealed.cm build.bat

WINDOWS_DISTFILES = $(GDSLC) LICENSE $(GDSL_BASIS) $(GDSL_ASM) $(GDSL_X86) $(GDSL_RREIL) $(GDSL_X86SEM) $(GDSL_AVR) $(GDSL_AVRSEM) $(GDSL_MIPS5) $(GDSL_MIPS5SEM) $(GDSL_MIPS6) $(GDSL_MIPS6SEM) $(GDSL_ARM7) $(RUNTIME) build.bat
WINDOWS_DISTFILES = $(GDSLC) LICENSE $(GDSL_BASIS) $(GDSL_ASM) $(GDSL_X86) $(GDSL_RREIL) $(GDSL_X86SEM) $(GDSL_AVR) $(GDSL_AVRSEM) $(GDSL_MIPS5) $(GDSL_MIPS5SEM) $(GDSL_MIPS6) $(GDSL_MIPS6SEM) $(GDSL_ARM7) $(GDSL_ARM7SEM) $(RUNTIME) build.bat

# distribution .tgz file for Windows
.PHONY: win-distdir win-dist
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
@@ -1,5 +1,5 @@
dnl configure file for the GDSL compiler and the decoders shipped with it
AC_INIT([gdsl], [1.0.0], [http://code.google.com/p/gdsl-toolkit/], [gdsl-toolkit])
AC_INIT([gdsl], [1.1.0], [http://code.google.com/p/gdsl-toolkit/], [gdsl-toolkit])

AM_INIT_AUTOMAKE([no-dependencies -Wall foreign no-define subdir-objects])

Expand Down
148 changes: 148 additions & 0 deletions scoping.patch
@@ -0,0 +1,148 @@
From 38e3d848217c70c5dea98e52aca72b45b17bacec Mon Sep 17 00:00:00 2001
From: Julian Kranz <kranzj@in.tum.de>
Date: Fri, 6 Feb 2015 14:20:06 +0100
Subject: Scoping

---
specifications/rreil/rreil-translator.ml | 4 +--
specifications/rreil/rreil.ml | 4 +--
specifications/x86/x86-rreil-translator.ml | 48 +++++++++++++++---------------
3 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/specifications/rreil/rreil-translator.ml b/specifications/rreil/rreil-translator.ml
index a6d6eeb..a06f727 100644
--- a/specifications/rreil/rreil-translator.ml
+++ b/specifications/rreil/rreil-translator.ml
@@ -19,7 +19,7 @@ val decode-translate-block-headless config limit = do
end

val decode-translate-block config limit = do
- update @{tmp=0,ins_count=0,stack=SEM_NIL,foundJump='0'};
+ update @{ins_count=0,stack=SEM_NIL,foundJump='0'};
stmts <- decode-translate-block-headless config limit;
return (rreil-stmts-rev stmts)
end
@@ -106,7 +106,7 @@ val decode-translate-super-block config limit = let
end
end
in do
- update @{tmp=0,ins_count=0,stack=SEM_NIL,foundJump='0'};
+ update @{ins_count=0,stack=SEM_NIL,foundJump='0'};
stmts <- decode-translate-block-headless config limit;

ic <- query $ins_count;
diff --git a/specifications/rreil/rreil.ml b/specifications/rreil/rreil.ml
index 60cddfc..e604b3c 100644
--- a/specifications/rreil/rreil.ml
+++ b/specifications/rreil/rreil.ml
@@ -136,9 +136,9 @@ val mktemp = do
end

val with-subscope m = do
-# l <- query $tmp;
+ l <- query $tmp;
ret <- m;
-# update @{tmp=l};
+ update @{tmp=l};
return ret
end

diff --git a/specifications/x86/x86-rreil-translator.ml b/specifications/x86/x86-rreil-translator.ml
index 6ab964d..0636731 100644
--- a/specifications/x86/x86-rreil-translator.ml
+++ b/specifications/x86/x86-rreil-translator.ml
@@ -93,9 +93,9 @@ in
if mode64 then
case s of
FS: SEM_LIN_ADD {opnd1=seg-sem s,opnd2=address}
- | GS: SEM_LIN_ADD {opnd1=seg-sem s,opnd2=address}
- | _: address
- end
+ | GS: SEM_LIN_ADD {opnd1=seg-sem s,opnd2=address}
+ | _: address
+ end
else
SEM_LIN_ADD {opnd1=seg-sem s,opnd2=address}
end
@@ -160,14 +160,14 @@ type offset-option =
val conv-with is-mem ptro conv sz x =
let
val conv-imm conv x = case conv of
- Signed: return (SEM_LIN_IMM{const=sx x})
- | Unsigned: return (SEM_LIN_IMM{const=zx x})
+ Signed: return (SEM_LIN_IMM{const=sx x})
+ | Unsigned: return (SEM_LIN_IMM{const=zx x})
end

val conv-reg conv sz r = do
reg <- return (semantic-register-of-mr is-mem r);
- expanded <- expand mktemp conv (var reg) reg.size sz;
- return expanded
+ expanded <- expand mktemp conv (var reg) reg.size sz;
+ return expanded
end

val conv-sum conv sz x =
@@ -351,26 +351,26 @@ val write-extend avx-encoded sz a b =
case a of
SEM_WRITE_MEM x:
#store x (SEM_LIN{size=sz,opnd1=b})
- segmented-store sz x b x.segment
+ segmented-store sz x b x.segment
| SEM_WRITE_VAR x: do
#if mode64 then
- # mov 32 (semantic-register-of EAX) (imm 100)
- #else
- # return void
- #;
+ # mov 32 (semantic-register-of EAX) (imm 100)
+ #else
+ # return void
+ #;
#if (is-avx-sse x.id.id) then
- # mov 32 (semantic-register-of EAX) (imm 101)
- #else
- # return void
- #;
+ # mov 32 (semantic-register-of EAX) (imm 101)
+ #else
+ # return void
+ #;
#if (avx-encoded) then
- # mov 32 (semantic-register-of EAX) (imm 102)
- #else
- # return void
- #;
- #mov 32 (semantic-register-of EAX) (imm (500 + sz));
+ # mov 32 (semantic-register-of EAX) (imm 102)
+ #else
+ # return void
+ #;
+ #mov 32 (semantic-register-of EAX) (imm (500 + sz));

- mov sz x.id b;
+ mov sz x.id b;

postproc-reg avx-encoded sz x.id

@@ -510,7 +510,7 @@ val undef-opnd opnd = do
sz <- sizeof1 opnd;
a <- lval sz opnd;
t <- mktemp;
- undef sz t;
+ undef sz t;
write sz a (var t)
end

@@ -2302,7 +2302,7 @@ end

val translate-block-single insn = do
ic <- query $ins_count;
- update@{ins_count=ic+1};
+ update@{tmp=0,ins_count=ic+1};

translate-x86 {features=insn.features,opnd-sz=insn.opnd-sz,addr-sz=insn.addr-sz,rep=insn.rep,repne=insn.repne,lock=insn.lock,insn=insn.insn,config=insn.config,length=insn.length}
end
--
2.1.4

0 comments on commit 15306ad

Please sign in to comment.