From a42a14f01c5df9f46d6b09a2700d517a28f8619f Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 1 Jan 1970 00:00:00 +0000 Subject: [PATCH] Don't just delete text symbols. --- .hgignore | 3 ++- lib/virt_mem.ml | 22 +++++++++++----------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/.hgignore b/.hgignore index bbb00a3..3948230 100644 --- 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 diff --git a/lib/virt_mem.ml b/lib/virt_mem.ml index bcee669..4859840 100644 --- a/lib/virt_mem.ml +++ b/lib/virt_mem.ml @@ -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 = -- 1.8.3.1