From 62c86a19510f666f70cc1bbc83cb521c42f3f3db Mon Sep 17 00:00:00 2001 From: Soren Sandmann Date: Sat, 26 Aug 2006 16:27:00 +0000 Subject: [PATCH] Demangle instead of strdup. 2006-08-22 Soren Sandmann * collector.c (unique_dup): Demangle instead of strdup. --- ChangeLog | 4 ++++ TODO | 18 ++++++++---------- collector.c | 3 ++- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 73f8ace..7293f0c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2006-08-22 Soren Sandmann + + * collector.c (unique_dup): Demangle instead of strdup. + 2006-08-21 Soren Sandmann * elfparser.[ch] diff --git a/TODO b/TODO index 938f51d..d85ebe7 100644 --- a/TODO +++ b/TODO @@ -35,8 +35,6 @@ Before 1.2: * "Expand all" is horrendously slow because update screenshot gets called for every "expanded" signal. -* Delete elf_parser_new() and rename elf_parser_new_from_file() - * See if we can make "In file " not be treated as a recursive function. Maybe simply treat each individual address in the file as a function. Or try to parse the machine code. Places that are called are likely @@ -47,8 +45,6 @@ Before 1.2: * crc32 checking probably doesn't belong in elfparser.c -* Add demangling again - * Rethink binparser. Maybe the default mode should be: - there is a current offset - you can move the cursor @@ -147,16 +143,11 @@ Before 1.2: - they will know how to delete the presentation names and themselves (through a virtual function) - they can contain markup etc. + - The unique_dup() scheme is somewhat confusing. - a more pragmatic approach might be to just walk the tree and save it. - plug all the leaks - - don't leak the presentation strings/objects - - maybe add stack_stash_set_free_func() or something - - perhaps think a little bit more about the presentation - object idea. Having pango markup available might be nice - as well ... Plus the unique_dup() scheme is somewhat - confusing. - loading and saving probably leak right now - rethink loading and saving. Goals @@ -614,6 +605,13 @@ Later: -=-=-=-=-=-=-=-=-=-=-=-=-=-=- ALREADY DONE -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +* plug all the leaks + - don't leak the presentation strings/objects + - maybe add stack_stash_set_free_func() or something +* Delete elf_parser_new() and rename elf_parser_new_from_file() + +* Add demangling again + * Restore filename => binfile cache. * It is apparently possible to get another timer interrupt in the middle diff --git a/collector.c b/collector.c index 22683c3..d81aeb3 100644 --- a/collector.c +++ b/collector.c @@ -22,6 +22,7 @@ #include "module/sysprof-module.h" #include "watch.h" #include "process.h" +#include "elfparser.h" #include #include @@ -272,7 +273,7 @@ unique_dup (GHashTable *unique_symbols, const char *sym) result = g_hash_table_lookup (unique_symbols, sym); if (!result) { - result = g_strdup (sym); + result = elf_demangle (sym); g_hash_table_insert (unique_symbols, (char *)sym, result); } -- 2.7.4