diff options
author | Eugene Tarassov | 2012-10-20 00:27:21 +0000 |
---|---|---|
committer | Eugene Tarassov | 2012-10-20 00:27:21 +0000 |
commit | 845035bd0f4af38f466fdd50b4e81d025c61569c (patch) | |
tree | 74a540086d723e888d683e67769a9ebeb79de1dc /agent/tcf/services/tcf_elf.c | |
parent | 1570232e92b4de74303b24cf9fa1e58adfb2fdf4 (diff) | |
download | org.eclipse.tcf.agent-845035bd0f4af38f466fdd50b4e81d025c61569c.tar.gz org.eclipse.tcf.agent-845035bd0f4af38f466fdd50b4e81d025c61569c.tar.xz org.eclipse.tcf.agent-845035bd0f4af38f466fdd50b4e81d025c61569c.zip |
Revert "TCF Agent: added canonicalize_file_name() in ELF reader to avoid loading same file multiple times"
This reverts commit 1570232e92b4de74303b24cf9fa1e58adfb2fdf4.
The commit cause regressions
Diffstat (limited to 'agent/tcf/services/tcf_elf.c')
-rw-r--r-- | agent/tcf/services/tcf_elf.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/agent/tcf/services/tcf_elf.c b/agent/tcf/services/tcf_elf.c index b60b094a..17cc1cdc 100644 --- a/agent/tcf/services/tcf_elf.c +++ b/agent/tcf/services/tcf_elf.c @@ -124,8 +124,8 @@ static void elf_dispose(ELF_File * file) { release_error_report(file->error); loc_free(file->pheaders); loc_free(file->str_pool); - free(file->debug_info_file_name); - free(file->name); + loc_free(file->debug_info_file_name); + loc_free(file->name); loc_free(file); } @@ -354,12 +354,12 @@ static char * get_debug_info_file_name(ELF_File * file, int * error) { #if SERVICE_PathMap lnm = apply_path_map(NULL, NULL, lnm, PATH_MAP_TO_LOCAL); #endif - if (stat(lnm, &buf) == 0) return canonicalize_file_name(lnm); + if (stat(lnm, &buf) == 0) return loc_strdup(lnm); snprintf(fnm, sizeof(fnm), "%s.debug", file->name); #if SERVICE_PathMap lnm = apply_path_map(NULL, NULL, lnm, PATH_MAP_TO_LOCAL); #endif - if (stat(lnm, &buf) == 0) return canonicalize_file_name(lnm); + if (stat(lnm, &buf) == 0) return loc_strdup(lnm); } offs += desc_sz; while (offs % 4 != 0) offs++; @@ -380,15 +380,15 @@ static char * get_debug_info_file_name(ELF_File * file, int * error) { while (l > 0 && file->name[l - 1] != '/' && file->name[l - 1] != '\\') l--; if (strcmp(file->name + l, name) != 0) { snprintf(fnm, sizeof(fnm), "%.*s%s", l, file->name, name); - if (stat(fnm, &buf) == 0) return canonicalize_file_name(fnm); + if (stat(fnm, &buf) == 0) return loc_strdup(fnm); } snprintf(fnm, sizeof(fnm), "%.*s.debug/%s", l, file->name, name); - if (stat(fnm, &buf) == 0) return canonicalize_file_name(fnm); + if (stat(fnm, &buf) == 0) return loc_strdup(fnm); snprintf(fnm, sizeof(fnm), "/usr/lib/debug%.*s%s", l, file->name, name); #if SERVICE_PathMap lnm = apply_path_map(NULL, NULL, lnm, PATH_MAP_TO_LOCAL); #endif - if (stat(lnm, &buf) == 0) return canonicalize_file_name(lnm); + if (stat(lnm, &buf) == 0) return loc_strdup(lnm); } } } @@ -421,15 +421,15 @@ static ELF_File * create_elf_cache(const char * file_name) { trace(LOG_ELF, "Create ELF file cache %s", file_name); file = (ELF_File *)loc_alloc_zero(sizeof(ELF_File)); - file->name = canonicalize_file_name(file_name); + file->name = loc_strdup(file_name); file->fd = -1; - if (file->name == NULL || stat(file->name, &st) < 0) { + if (stat(file_name, &st) < 0) { error = errno; memset(&st, 0, sizeof(st)); } else if (st.st_ino == 0) { - st.st_ino = elf_ino(file->name); + st.st_ino = elf_ino(file_name); } file->dev = st.st_dev; |