Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Tarassov2016-04-13 16:59:26 +0000
committerEugene Tarassov2016-04-13 16:59:26 +0000
commit1404fd798dc224290ebc3c52f1558269fdf32812 (patch)
tree4e5820d0a0a1db331768e7fec8cf9fb796adcfd6
parent51c1af2890de2e2d0c02d40f94ef4b2085d6e00b (diff)
downloadorg.eclipse.tcf.agent-1404fd798dc224290ebc3c52f1558269fdf32812.tar.gz
org.eclipse.tcf.agent-1404fd798dc224290ebc3c52f1558269fdf32812.tar.xz
org.eclipse.tcf.agent-1404fd798dc224290ebc3c52f1558269fdf32812.zip
TCF Agent: check if DWARF expression call-back client_op != NULL
-rw-r--r--agent/tcf/services/symbols_elf.c11
-rw-r--r--agent/tcf/services/vm.c5
2 files changed, 5 insertions, 11 deletions
diff --git a/agent/tcf/services/symbols_elf.c b/agent/tcf/services/symbols_elf.c
index 205dfa8a..4a9772df 100644
--- a/agent/tcf/services/symbols_elf.c
+++ b/agent/tcf/services/symbols_elf.c
@@ -3542,15 +3542,6 @@ int get_symbol_children(const Symbol * sym, Symbol *** children, int * count) {
return 0;
}
-static void dwarf_location_operation(uint8_t op) {
- str_fmt_exception(ERR_UNSUPPORTED, "Unsupported location expression op 0x%02x", op);
-}
-
-static int dwarf_location_callback(LocationExpressionState * state) {
- state->client_op = dwarf_location_operation;
- return evaluate_vm_expression(state);
-}
-
static LocationExpressionCommand * add_location_command(LocationInfo * l, int op) {
LocationCommands * cmds = &l->value_cmds;
LocationExpressionCommand * cmd = NULL;
@@ -3592,7 +3583,7 @@ static void add_dwarf_location_command(LocationInfo * l, PropertyValue * v) {
cmd->args.loc.code_size = info->expr_size;
cmd->args.loc.reg_id_scope = v->mObject->mCompUnit->mRegIdScope;
cmd->args.loc.addr_size = v->mObject->mCompUnit->mDesc.mAddressSize;
- cmd->args.loc.func = dwarf_location_callback;
+ cmd->args.loc.func = evaluate_vm_expression;
}
static void add_member_location_command(LocationInfo * info, ObjectInfo * obj) {
diff --git a/agent/tcf/services/vm.c b/agent/tcf/services/vm.c
index 60343f8e..3bd6f5d2 100644
--- a/agent/tcf/services/vm.c
+++ b/agent/tcf/services/vm.c
@@ -805,7 +805,7 @@ static void evaluate_expression(void) {
case OP_call4:
case OP_call_ref:
default:
- {
+ if (state->client_op != NULL) {
LocationExpressionState * s = state;
Trap trap;
get_state(s);
@@ -816,6 +816,9 @@ static void evaluate_expression(void) {
set_state(s);
if (trap.error) exception(trap.error);
}
+ else {
+ str_fmt_exception(ERR_UNSUPPORTED, "Unsupported location expression op 0x%02x", op);
+ }
}
}
}

Back to the top