Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreutarass2011-03-15 21:40:40 +0000
committereutarass2011-03-15 21:40:40 +0000
commit9d4dd5905d208e8414345f246d184b3151264975 (patch)
tree97e82fa02d41cd9fef435e97372424844703be2c /services/symbols_proxy.c
parent1d9f536db21d46d0dc19a7e34567de2bc4763881 (diff)
downloadorg.eclipse.tcf.agent-9d4dd5905d208e8414345f246d184b3151264975.tar.gz
org.eclipse.tcf.agent-9d4dd5905d208e8414345f246d184b3151264975.tar.xz
org.eclipse.tcf.agent-9d4dd5905d208e8414345f246d184b3151264975.zip
TCF Agent:
1. Added handling of AT_ranges attribute for functions and lexical blocks. 2. Changed symbol IDs to start with '@' - it allows to easily distinguish symbol IDs and improves symbol cache performance
Diffstat (limited to 'services/symbols_proxy.c')
-rw-r--r--services/symbols_proxy.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/services/symbols_proxy.c b/services/symbols_proxy.c
index 14e6800b..49e7f929 100644
--- a/services/symbols_proxy.c
+++ b/services/symbols_proxy.c
@@ -641,8 +641,15 @@ const char * symbol2id(const Symbol * sym) {
int id2symbol(const char * id, Symbol ** sym) {
LINK * l;
SymInfoCache * s = NULL;
- unsigned h = hash_sym_id(id);
- SymbolsCache * syms = get_symbols_cache();
+ unsigned h = 0;
+ SymbolsCache * syms = NULL;
+ if (id == NULL || id[0] != '@') {
+ /* Cacheable symbol IDs should start with '@' */
+ errno = ERR_INV_CONTEXT;
+ return -1;
+ }
+ h = hash_sym_id(id);
+ syms = get_symbols_cache();
for (l = syms->link_sym[h].next; l != syms->link_sym + h; l = l->next) {
SymInfoCache * x = syms2sym(l);
if (strcmp(x->id, id) == 0) {

Back to the top