Don't just delete text symbols.
authorRichard W.M. Jones <rjones@redhat.com>
Thu, 5 Jun 2008 21:50:29 +0000 (22:50 +0100)
committerRichard W.M. Jones <rjones@redhat.com>
Thu, 5 Jun 2008 21:50:29 +0000 (22:50 +0100)
.hgignore
lib/virt_mem.ml

index bbb00a3..3948230 100644 (file)
--- a/.hgignore
+++ b/.hgignore
@@ -21,4 +21,5 @@ gmon.out
 virt-mem-*.tar.gz
 lib/virt_mem_gettext.ml
 uname/virt-uname
-dmesg/virt-dmesg
\ No newline at end of file
+dmesg/virt-dmesg
+samples
\ No newline at end of file
index bcee669..4859840 100644 (file)
@@ -507,19 +507,19 @@ let start usage_msg =
              let names = List.filter_map (
                fun (name, sym_value) ->
                  let f c = tokens.(Char.code c) in
-                 let name' = String.replace_chars f name in
-                 (*printf "%S -> %S\n" name name';*)
+                 let name = String.replace_chars f name in
                  (* First character in uncompressed output is the symbol
-                  * type, eg. 'T'/'t' for text etc.  Since we will never
-                  * be using functions, and since some functions (eg.
-                  * con_start) overlap with data symbols, drop functions.
+                  * type, eg. 'T'/'t' for text etc.
                   *)
-                 let typ = name'.[0] in
-                 if typ = 't' || typ = 'T' then None
-                 else (
-                   let name' = String.sub name' 1 (String.length name' - 1) in
-                   Some (name', sym_value)
-                 )
+                 (* NOTE: Symbol names are NOT unique
+                  * (eg. 'con_start' is both a function and data in
+                  * some kernels).  XXX We need to handle this situation
+                  * better.
+                  *)
+                 (*let typ = name.[0] in*)
+                 let name = String.sub name 1 (String.length name - 1) in
+                 (*printf "%S -> %Lx\n" name sym_value;*)
+                 Some (name, sym_value)
              ) compressed_names in
 
              let lookup_ksym name =