From: Richard W.M. Jones <"Richard W.M. Jones "> Date: Thu, 17 Jul 2008 17:01:10 +0000 (+0100) Subject: bitmatch -> bitstring X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=8eb1c2c4f71819108ceea4731f4dad75775ce6ae;p=virt-mem.git bitmatch -> bitstring --- diff --git a/configure.ac b/configure.ac index d3e54b2..0a8b569 100644 --- a/configure.ac +++ b/configure.ac @@ -62,9 +62,9 @@ if test "x$pkg_xml_light" != "xyes"; then AC_MSG_ERROR([Cannot find required OCaml package 'xml-light']) fi -AC_CHECK_OCAML_PKG(bitmatch) -if test "x$pkg_bitmatch" != "xyes"; then - AC_MSG_ERROR([Cannot find required OCaml package 'bitmatch']) +AC_CHECK_OCAML_PKG(bitstring) +if test "x$pkg_bitstring" != "xyes"; then + AC_MSG_ERROR([Cannot find required OCaml package 'bitstring']) fi dnl Check for optional OCaml packages. @@ -75,7 +75,7 @@ AC_SUBST(pkg_unix) AC_SUBST(pkg_extlib) AC_SUBST(pkg_libvirt) AC_SUBST(pkg_xml_light) -AC_SUBST(pkg_bitmatch) +AC_SUBST(pkg_bitstring) AC_SUBST(pkg_gettext) AC_SUBST(pkg_csv) diff --git a/dmesg/Makefile.in b/dmesg/Makefile.in index a598ba9..987a97f 100644 --- a/dmesg/Makefile.in +++ b/dmesg/Makefile.in @@ -23,20 +23,20 @@ INSTALL = @INSTALL@ MKDIR_P = @MKDIR_P@ bindir = @bindir@ -SYNTAX = -syntax bitmatch.syntax +SYNTAX = -syntax bitstring.syntax -OCAMLCPACKAGES = -package unix,bigarray,extlib,libvirt,xml-light,bitmatch.syntax -I ../lib +OCAMLCPACKAGES = -package unix,bigarray,extlib,libvirt,xml-light,bitstring.syntax -I ../lib ifneq ($(pkg_gettext),no) OCAMLCPACKAGES += -package gettext-stub endif OCAMLCFLAGS = @OCAMLCFLAGS@ $(SYNTAX) -OCAMLCLIBS = -linkpkg bitmatch.cma ../lib/virt_mem.cma +OCAMLCLIBS = -linkpkg ../lib/virt_mem.cma OCAMLOPTFLAGS = @OCAMLOPTFLAGS@ $(SYNTAX) OCAMLOPTPACKAGES = $(OCAMLCPACKAGES) -OCAMLOPTLIBS = -linkpkg bitmatch.cmxa ../lib/virt_mem.cmxa +OCAMLOPTLIBS = -linkpkg ../lib/virt_mem.cmxa OCAMLDOCFLAGS = -html -sort $(OCAMLCPACKAGES) $(SYNTAX) diff --git a/lib/Makefile.in b/lib/Makefile.in index 373e452..21ccfde 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -26,20 +26,20 @@ OCAMLLIB = @OCAMLLIB@ CC = @CC@ CFLAGS = @CFLAGS@ -Wall -Werror -I$(OCAMLLIB) -I@top_srcdir@ -SYNTAX = -syntax bitmatch.syntax +SYNTAX = -syntax bitstring.syntax -OCAMLCPACKAGES = -package unix,bigarray,extlib,libvirt,xml-light,bitmatch.syntax +OCAMLCPACKAGES = -package unix,bigarray,extlib,libvirt,xml-light,bitstring.syntax ifneq ($(pkg_gettext),no) OCAMLCPACKAGES += -package gettext-stub endif OCAMLCFLAGS = @OCAMLCFLAGS@ $(SYNTAX) -OCAMLCLIBS = -linkpkg bitmatch.cma +OCAMLCLIBS = -linkpkg OCAMLOPTFLAGS = @OCAMLOPTFLAGS@ $(SYNTAX) OCAMLOPTPACKAGES = $(OCAMLCPACKAGES) -OCAMLOPTLIBS = -linkpkg bitmatch.cmxa +OCAMLOPTLIBS = -linkpkg OCAMLDOCFLAGS = -html -sort $(OCAMLCPACKAGES) $(SYNTAX) diff --git a/lib/virt_mem.ml b/lib/virt_mem.ml index 61d5968..fcefa3c 100644 --- a/lib/virt_mem.ml +++ b/lib/virt_mem.ml @@ -188,9 +188,9 @@ Options:") cmd summary description in let set_endian = function | "auto" -> def_endian := None | "le" | "little" | "littleendian" | "intel" -> - def_endian := Some Bitmatch.LittleEndian + def_endian := Some Bitstring.LittleEndian | "be" | "big" | "bigendian" | "motorola" -> - def_endian := Some Bitmatch.BigEndian + def_endian := Some Bitstring.BigEndian | str -> failwith (sprintf (f_"set_endian: %s: unknown endianness") str) in @@ -627,7 +627,7 @@ Use 'virt-mem --help' for more help or read the manual page virt-mem(1)"); (* Load the whole symbol table as a bitstring. *) let ksymtab = - Bitmatch.bitstring_of_string + Bitstring.bitstring_of_string (MMap.get_bytes mem ksymtab_addr (Int64.to_int ksymtab_size)) in diff --git a/lib/virt_mem_mmap.ml b/lib/virt_mem_mmap.ml index 963e10d..3b84a26 100644 --- a/lib/virt_mem_mmap.ml +++ b/lib/virt_mem_mmap.ml @@ -33,7 +33,7 @@ open Virt_mem_utils type ('a,'b) t = { mappings : mapping list; wordsize : wordsize option; - endian : Bitmatch.endian option; + endian : Bitstring.endian option; } and mapping = { start : addr; @@ -213,9 +213,9 @@ and string_of_addr t addr = let bits = bits_of_wordsize (get_wordsize t) in let e = get_endian t in let bs = BITSTRING { addr : bits : endian (e) } in - Bitmatch.string_of_bitstring bs + Bitstring.string_of_bitstring bs *) -(* XXX bitmatch is missing 'construct_int64_le_unsigned' so we +(* XXX bitstring is missing 'construct_int64_le_unsigned' so we * have to force this to 32 bits for the moment. *) and string_of_addr t addr = @@ -223,12 +223,12 @@ and string_of_addr t addr = assert (bits = 32); let e = get_endian t in let bs = BITSTRING { Int64.to_int32 addr : 32 : endian (e) } in - Bitmatch.string_of_bitstring bs + Bitstring.string_of_bitstring bs and addr_of_string t str = let bits = bits_of_wordsize (get_wordsize t) in let e = get_endian t in - let bs = Bitmatch.bitstring_of_string str in + let bs = Bitstring.bitstring_of_string str in bitmatch bs with | { addr : bits : endian (e) } -> addr | { _ } -> invalid_arg "addr_of_string" @@ -287,7 +287,7 @@ let get_bytes t addr len = let get_int32 t addr = let e = get_endian t in let str = get_bytes t addr 4 in - let bs = Bitmatch.bitstring_of_string str in + let bs = Bitstring.bitstring_of_string str in bitmatch bs with | { addr : 32 : endian (e) } -> addr | { _ } -> invalid_arg "follow_pointer" @@ -295,7 +295,7 @@ let get_int32 t addr = let get_int64 t addr = let e = get_endian t in let str = get_bytes t addr 8 in - let bs = Bitmatch.bitstring_of_string str in + let bs = Bitstring.bitstring_of_string str in bitmatch bs with | { addr : 64 : endian (e) } -> addr | { _ } -> invalid_arg "follow_pointer" @@ -373,7 +373,7 @@ let follow_pointer t addr = let e = get_endian t in let bits = bits_of_wordsize ws in let str = get_bytes t addr (bytes_of_wordsize ws) in - let bs = Bitmatch.bitstring_of_string str in + let bs = Bitstring.bitstring_of_string str in bitmatch bs with | { addr : bits : endian (e) } -> addr | { _ } -> invalid_arg "follow_pointer" diff --git a/lib/virt_mem_mmap.mli b/lib/virt_mem_mmap.mli index 0ed9176..594f0cf 100644 --- a/lib/virt_mem_mmap.mli +++ b/lib/virt_mem_mmap.mli @@ -34,7 +34,7 @@ val set_wordsize : ([`NoWordsize], 'b) t -> Virt_mem_utils.wordsize -> (** Set the natural wordsize of the memory map. This is used for matching pointers within the map and can be set only once. *) -val set_endian : ('a, [`NoEndian]) t -> Bitmatch.endian -> +val set_endian : ('a, [`NoEndian]) t -> Bitstring.endian -> ('a, [`Endian]) t (** Set the natural endianness of the memory map. This is used for matching pointers within the map and can be set only once. *) @@ -42,7 +42,7 @@ val set_endian : ('a, [`NoEndian]) t -> Bitmatch.endian -> val get_wordsize : ([`Wordsize], 'b) t -> Virt_mem_utils.wordsize (** Return the wordsize previously set for this memory map. *) -val get_endian : ('a, [`Endian]) t -> Bitmatch.endian +val get_endian : ('a, [`Endian]) t -> Bitstring.endian (** Return the endianness previously set for this memory map. *) val of_file : Unix.file_descr -> addr -> ([`NoWordsize], [`NoEndian]) t diff --git a/lib/virt_mem_utils.ml b/lib/virt_mem_utils.ml index 6ac7083..2beb131 100644 --- a/lib/virt_mem_utils.ml +++ b/lib/virt_mem_utils.ml @@ -57,9 +57,9 @@ let architecture_of_string = function str) let endian_of_architecture = function - | I386 | X86_64 -> Bitmatch.LittleEndian - | IA64 -> Bitmatch.LittleEndian (* XXX usually? *) - | PPC | PPC64 | SPARC | SPARC64 -> Bitmatch.BigEndian + | I386 | X86_64 -> Bitstring.LittleEndian + | IA64 -> Bitstring.LittleEndian (* XXX usually? *) + | PPC | PPC64 | SPARC | SPARC64 -> Bitstring.BigEndian type wordsize = | W32 | W64 diff --git a/mem/Makefile.in b/mem/Makefile.in index 4792802..af8ab0b 100644 --- a/mem/Makefile.in +++ b/mem/Makefile.in @@ -23,20 +23,20 @@ INSTALL = @INSTALL@ MKDIR_P = @MKDIR_P@ bindir = @bindir@ -SYNTAX = -syntax bitmatch.syntax +SYNTAX = -syntax bitstring.syntax -OCAMLCPACKAGES = -package unix,bigarray,extlib,libvirt,xml-light,bitmatch.syntax -I ../lib +OCAMLCPACKAGES = -package unix,bigarray,extlib,libvirt,xml-light,bitstring.syntax -I ../lib ifneq ($(pkg_gettext),no) OCAMLCPACKAGES += -package gettext-stub endif OCAMLCFLAGS = @OCAMLCFLAGS@ $(SYNTAX) -OCAMLCLIBS = -linkpkg bitmatch.cma ../lib/virt_mem.cma +OCAMLCLIBS = -linkpkg bitstring.cma ../lib/virt_mem.cma OCAMLOPTFLAGS = @OCAMLOPTFLAGS@ $(SYNTAX) OCAMLOPTPACKAGES = $(OCAMLCPACKAGES) -OCAMLOPTLIBS = -linkpkg bitmatch.cmxa ../lib/virt_mem.cmxa +OCAMLOPTLIBS = -linkpkg bitstring.cmxa ../lib/virt_mem.cmxa OCAMLDOCFLAGS = -html -sort $(OCAMLCPACKAGES) $(SYNTAX) diff --git a/po/Makefile.in b/po/Makefile.in index 8098c3d..1828a68 100644 --- a/po/Makefile.in +++ b/po/Makefile.in @@ -23,7 +23,7 @@ LINGUAS = $(shell cat LINGUAS) SOURCES = POTFILES OCAML_GETTEXT = @OCAML_GETTEXT@ -OCAML_GETTEXT_EXTRACT_OPTIONS = --extract-default-option "-I +camlp4 pa_o.cmo -I $$(ocamlc -where)/bitmatch bitmatch.cma bitmatch_persistent.cma pa_bitmatch.cmo" +OCAML_GETTEXT_EXTRACT_OPTIONS = --extract-default-option "-I +camlp4 pa_o.cmo -I $$(ocamlc -where)/bitstring bitstring.cma bitstring_persistent.cma pa_bitstring.cmo" OCAML_GETTEXT_COMPILE_OPTIONS = OCAML_GETTEXT_INSTALL_OPTIONS = OCAML_GETTEXT_MERGE_OPTIONS = diff --git a/po/virt-mem.pot b/po/virt-mem.pot index 2f7c2e4..86be02f 100644 --- a/po/virt-mem.pot +++ b/po/virt-mem.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2008-07-15 15:49+0000\n" +"POT-Creation-Date: 2008-07-17 17:00+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/ps/Makefile.in b/ps/Makefile.in index 3db43fe..2620b77 100644 --- a/ps/Makefile.in +++ b/ps/Makefile.in @@ -23,20 +23,20 @@ INSTALL = @INSTALL@ MKDIR_P = @MKDIR_P@ bindir = @bindir@ -SYNTAX = -syntax bitmatch.syntax +SYNTAX = -syntax bitstring.syntax -OCAMLCPACKAGES = -package unix,bigarray,extlib,libvirt,xml-light,bitmatch.syntax -I ../lib +OCAMLCPACKAGES = -package unix,bigarray,extlib,libvirt,xml-light,bitstring.syntax -I ../lib ifneq ($(pkg_gettext),no) OCAMLCPACKAGES += -package gettext-stub endif OCAMLCFLAGS = @OCAMLCFLAGS@ $(SYNTAX) -OCAMLCLIBS = -linkpkg bitmatch.cma ../lib/virt_mem.cma +OCAMLCLIBS = -linkpkg ../lib/virt_mem.cma OCAMLOPTFLAGS = @OCAMLOPTFLAGS@ $(SYNTAX) OCAMLOPTPACKAGES = $(OCAMLCPACKAGES) -OCAMLOPTLIBS = -linkpkg bitmatch.cmxa ../lib/virt_mem.cmxa +OCAMLOPTLIBS = -linkpkg ../lib/virt_mem.cmxa OCAMLDOCFLAGS = -html -sort $(OCAMLCPACKAGES) $(SYNTAX) diff --git a/uname/Makefile.in b/uname/Makefile.in index dfcd48b..298c70b 100644 --- a/uname/Makefile.in +++ b/uname/Makefile.in @@ -23,20 +23,20 @@ INSTALL = @INSTALL@ MKDIR_P = @MKDIR_P@ bindir = @bindir@ -SYNTAX = -syntax bitmatch.syntax +SYNTAX = -syntax bitstring.syntax -OCAMLCPACKAGES = -package unix,bigarray,extlib,libvirt,xml-light,bitmatch.syntax -I ../lib +OCAMLCPACKAGES = -package unix,bigarray,extlib,libvirt,xml-light,bitstring.syntax -I ../lib ifneq ($(pkg_gettext),no) OCAMLCPACKAGES += -package gettext-stub endif OCAMLCFLAGS = @OCAMLCFLAGS@ $(SYNTAX) -OCAMLCLIBS = -linkpkg bitmatch.cma ../lib/virt_mem.cma +OCAMLCLIBS = -linkpkg ../lib/virt_mem.cma OCAMLOPTFLAGS = @OCAMLOPTFLAGS@ $(SYNTAX) OCAMLOPTPACKAGES = $(OCAMLCPACKAGES) -OCAMLOPTLIBS = -linkpkg bitmatch.cmxa ../lib/virt_mem.cmxa +OCAMLOPTLIBS = -linkpkg ../lib/virt_mem.cmxa OCAMLDOCFLAGS = -html -sort $(OCAMLCPACKAGES) $(SYNTAX) diff --git a/uname/virt_uname.ml b/uname/virt_uname.ml index e90b5a6..6004bb8 100644 --- a/uname/virt_uname.ml +++ b/uname/virt_uname.ml @@ -64,7 +64,7 @@ let run debug images = try let addr = lookup_ksym "init_uts_ns" in - let bs = Bitmatch.bitstring_of_string (get_bytes mem addr (65*6+4)) in + let bs = Bitstring.bitstring_of_string (get_bytes mem addr (65*6+4)) in (bitmatch bs with | { _ : 32 : int; (* the kref, atomic_t, always 32 bits *) new_utsname : -1 : bitstring } -> @@ -81,7 +81,7 @@ let run debug images = let addr = lookup_ksym "system_utsname" in let bs = - Bitmatch.bitstring_of_string (get_bytes mem addr (65*6)) in + Bitstring.bitstring_of_string (get_bytes mem addr (65*6)) in print_new_utsname name bs with Not_found ->