diff options
author | Xavier Pouyollon | 2015-09-22 12:52:14 +0000 |
---|---|---|
committer | Xavier Pouyollon | 2015-09-22 12:52:14 +0000 |
commit | e9de6a2ad65698306a5a79ba94d11652a39fd945 (patch) | |
tree | 71c66a65b1e933194b4a32539623f7b281b08be7 | |
parent | 96112b9de906827d5c00fd1995b1a9f3341620f0 (diff) | |
download | org.eclipse.tcf.agent-e9de6a2ad65698306a5a79ba94d11652a39fd945.tar.gz org.eclipse.tcf.agent-e9de6a2ad65698306a5a79ba94d11652a39fd945.tar.xz org.eclipse.tcf.agent-e9de6a2ad65698306a5a79ba94d11652a39fd945.zip |
Add hooks for linenumbers_elf.c
Signed-off-by: Xavier Pouyollon <xavier.pouyollon@windriver.com>
-rw-r--r-- | agent/tcf/services/linenumbers_elf-ext.h | 19 | ||||
-rw-r--r-- | agent/tcf/services/linenumbers_elf.c | 7 |
2 files changed, 26 insertions, 0 deletions
diff --git a/agent/tcf/services/linenumbers_elf-ext.h b/agent/tcf/services/linenumbers_elf-ext.h new file mode 100644 index 00000000..6545fddc --- /dev/null +++ b/agent/tcf/services/linenumbers_elf-ext.h @@ -0,0 +1,19 @@ +/******************************************************************************* + * Copyright (c) 2015 Wind River Systems, Inc. and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * and Eclipse Distribution License v1.0 which accompany this distribution. + * The Eclipse Public License is available at + * http://www.eclipse.org/legal/epl-v10.html + * and the Eclipse Distribution License is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + * You may elect to redistribute this code under either of these licenses. + * + * Contributors: + * Wind River Systems - initial API and implementation + *******************************************************************************/ + +#define ADDR_TO_LINE_HOOK do {} while(0) +#define LINE_TO_ADDR_HOOK_0 do {} while(0) +#define LINE_TO_ADDR_HOOK_1 do {} while(0) +#define LINE_TO_ADDR_HOOK_2 do {} while(0) diff --git a/agent/tcf/services/linenumbers_elf.c b/agent/tcf/services/linenumbers_elf.c index 05bd20db..4fd54886 100644 --- a/agent/tcf/services/linenumbers_elf.c +++ b/agent/tcf/services/linenumbers_elf.c @@ -45,6 +45,7 @@ #define LINENUMBERS_READER_PREFIX elf_reader_ #include <tcf/services/linenumbers_mux.h> #endif +#include <tcf/services/linenumbers_elf-ext.h> static int compare_path(Channel * chnl, Context * ctx, const char * file, const char * pwd, const char * dir, const char * name) { int i, j; @@ -246,6 +247,7 @@ int line_to_address(Context * ctx, const char * file_name, int line, int column, int err = 0; Channel * chnl = cache_channel(); static MemoryMap map; + LINE_TO_ADDR_HOOK_0; if (ctx == NULL) err = ERR_INV_CONTEXT; else if (ctx->exited) err = ERR_ALREADY_EXITED; @@ -278,6 +280,7 @@ int line_to_address(Context * ctx, const char * file_name, int line, int column, FileInfo * f = NULL; if (fnm == NULL) { fnm = canonic_path_map_file_name(file_name); + LINE_TO_ADDR_HOOK_1; h = calc_file_name_hash(fnm); } f = cache->mFileInfoHash[h % cache->mFileInfoHashSize]; @@ -285,6 +288,7 @@ int line_to_address(Context * ctx, const char * file_name, int line, int column, if (f->mNameHash == h && compare_path(chnl, ctx, fnm, f->mCompUnit->mDir, f->mDir, f->mName)) { CompUnit * unit = f->mCompUnit; unsigned j = f - unit->mFiles; + LINE_TO_ADDR_HOOK_2; unit_line_to_address(ctx, r, unit, j, line, column, client, args); } f = f->mNextInHash; @@ -356,7 +360,10 @@ int address_to_line(Context * ctx, ContextAddress addr0, ContextAddress addr1, L if (code_next != NULL) { if (state->mAddress < code_next->mAddress) { LineNumbersState * text_next = get_next_in_text(unit, state); + ADDR_TO_LINE_HOOK; + { call_client(ctx, unit, state, code_next, text_next, state->mAddress - range->mAddr + range_rt_addr, client, args); + } } assert(code_next > state); k = code_next - unit->mStates; |