Lines Matching defs:tpoint
418 static int tracepoint_send_agent (struct tracepoint *tpoint);
1297 struct tracepoint *tpoint;
1326 struct tracepoint *tpoint;
1348 struct tracepoint *tpoint);
1357 struct tracepoint *tpoint);
1361 struct tracepoint *tpoint, int current_step);
1362 static void compile_tracepoint_condition (struct tracepoint *tpoint,
1367 struct tracepoint *tpoint,
1398 record_tracepoint_error (struct tracepoint *tpoint, const char *which,
1402 tpoint->number, paddress (tpoint->address), which, rtype);
1415 error_tracepoint = tpoint;
1791 struct tracepoint *tpoint, **tp_next;
1793 tpoint = XNEW (struct tracepoint);
1794 tpoint->number = num;
1795 tpoint->address = addr;
1796 tpoint->numactions = 0;
1797 tpoint->actions = NULL;
1798 tpoint->actions_str = NULL;
1799 tpoint->cond = NULL;
1800 tpoint->num_step_actions = 0;
1801 tpoint->step_actions = NULL;
1802 tpoint->step_actions_str = NULL;
1804 tpoint->type = trap_tracepoint;
1805 tpoint->orig_size = -1;
1806 tpoint->source_strings = NULL;
1807 tpoint->compiled_cond = 0;
1808 tpoint->handle = NULL;
1809 tpoint->next = NULL;
1813 multiple tracepoints at the same address as TPOINT's, and this
1814 guarantees TPOINT is inserted after all the tracepoints which are
1831 (*tp_next) != NULL && (*tp_next)->address <= tpoint->address;
1834 tpoint->next = *tp_next;
1835 *tp_next = tpoint;
1836 last_tracepoint = tpoint;
1840 return tpoint;
1850 struct tracepoint *tpoint;
1852 for (tpoint = tracepoints; tpoint; tpoint = tpoint->next)
1853 if (tpoint->number == id && tpoint->address == addr)
1854 return tpoint;
1859 /* Remove TPOINT from global list. */
1862 remove_tracepoint (struct tracepoint *tpoint)
1866 for (tp = tracepoints, tp_prev = NULL; tp && tp != tpoint;
1889 struct tracepoint *tpoint;
1892 tpoint = prev_tp->next;
1894 tpoint = tracepoints;
1895 for (; tpoint; tpoint = tpoint->next)
1896 if (tpoint->number == num)
1897 return tpoint;
1907 add_tracepoint_action (struct tracepoint *tpoint, const char *packet)
2007 tpoint->num_step_actions++;
2009 tpoint->step_actions
2010 = XRESIZEVEC (struct tracepoint_action *, tpoint->step_actions,
2011 tpoint->num_step_actions);
2012 tpoint->step_actions_str
2013 = XRESIZEVEC (char *, tpoint->step_actions_str,
2014 tpoint->num_step_actions);
2015 tpoint->step_actions[tpoint->num_step_actions - 1] = action;
2016 tpoint->step_actions_str[tpoint->num_step_actions - 1]
2021 tpoint->numactions++;
2022 tpoint->actions
2023 = XRESIZEVEC (struct tracepoint_action *, tpoint->actions,
2024 tpoint->numactions);
2025 tpoint->actions_str
2026 = XRESIZEVEC (char *, tpoint->actions_str, tpoint->numactions);
2027 tpoint->actions[tpoint->numactions - 1] = action;
2028 tpoint->actions_str[tpoint->numactions - 1]
2187 add_traceframe (struct tracepoint *tpoint)
2197 tframe->tpnum = tpoint->number;
2207 struct tracepoint *tpoint, int amt)
2219 gdb_assert (tframe->tpnum == tpoint->number);
2222 tpoint->traceframe_usage += amt;
2263 struct tracepoint *tpoint;
2272 tpoint = find_next_tracepoint_by_number (NULL, tframe->tpnum);
2273 return tpoint->address;
2421 struct tracepoint *tpoint;
2429 for (tpoint = tracepoints; tpoint; tpoint = tpoint->next)
2433 if (tpoint->handle == NULL)
2437 tpoint->number, paddress (tpoint->address));
2441 switch (tpoint->type)
2446 = (struct breakpoint *) tpoint->handle;
2454 = (struct fast_tracepoint_jump *) tpoint->handle;
2461 && prev_stpoint->address == tpoint->address)
2468 unprobe_marker_at (tpoint->address);
2469 prev_stpoint = tpoint;
2474 tpoint->handle = NULL;
2491 struct tracepoint *tpoint;
2510 tpoint = find_tracepoint (num, addr);
2515 if (tpoint)
2524 tpoint = add_tracepoint (num, addr);
2526 tpoint->enabled = (*packet == 'E');
2530 tpoint->step_count = count;
2533 tpoint->pass_count = count;
2540 tpoint->type = fast_tracepoint;
2543 tpoint->orig_size = count;
2547 tpoint->type = static_tracepoint;
2552 tpoint->cond = gdb_parse_agent_expr (&packet);
2569 tpoint->type == fast_tracepoint ? "fast "
2570 : tpoint->type == static_tracepoint ? "static " : "",
2571 tpoint->number, paddress (tpoint->address), tpoint->enabled,
2572 tpoint->step_count, tpoint->pass_count);
2574 else if (tpoint)
2575 add_tracepoint_action (tpoint, packet);
2603 if (tpoint->type != trap_tracepoint)
2608 if (tp->address == tpoint->address && tp->type == tpoint->type
2609 && tp->number != tpoint->number)
2613 /* TPOINT is installed at the same address as TP. */
2616 if (tpoint->type == fast_tracepoint)
2617 clone_fast_tracepoint (tpoint, tp);
2618 else if (tpoint->type == static_tracepoint)
2619 tpoint->handle = (void *) -1;
2623 if (use_agent && tpoint->type == fast_tracepoint
2627 if (tracepoint_send_agent (tpoint) == 0)
2632 remove_tracepoint (tpoint);
2637 download_tracepoint (tpoint);
2639 if (tpoint->type == trap_tracepoint || tp == NULL)
2641 install_tracepoint (tpoint, own_buf);
2643 remove_tracepoint (tpoint);
2660 struct tracepoint *tpoint;
2675 tpoint = find_tracepoint (num, addr);
2677 if (!tpoint)
2706 if (tpoint->source_strings)
2708 for (last = tpoint->source_strings; last->next; last = last->next)
2713 tpoint->source_strings = newlast;
3060 install_fast_tracepoint (struct tracepoint *tpoint, char *errbuf)
3072 if (tpoint->orig_size < target_get_min_fast_tracepoint_insn_len ())
3093 (tpoint->obj_addr_on_target, tpoint->address, collect,
3094 ipa_sym_addrs.addr_collecting, tpoint->orig_size, &jentry,
3096 &tpoint->adjusted_insn_addr, &tpoint->adjusted_insn_addr_end, errbuf);
3102 tpoint->handle = set_fast_tracepoint_jump (tpoint->address, fjump,
3105 if (tpoint->handle != NULL)
3107 tpoint->jump_pad = jump_entry;
3108 tpoint->jump_pad_end = jentry;
3109 tpoint->trampoline = trampoline;
3110 tpoint->trampoline_end = trampoline + trampoline_size;
3121 /* Install tracepoint TPOINT, and write reply message in OWN_BUF. */
3124 install_tracepoint (struct tracepoint *tpoint, char *own_buf)
3126 tpoint->handle = NULL;
3129 if (tpoint->type == trap_tracepoint)
3135 tpoint->handle = set_breakpoint_at (tpoint->address,
3138 else if (tpoint->type == fast_tracepoint || tpoint->type == static_tracepoint)
3144 tpoint->type == static_tracepoint ? "static" : "fast");
3148 if (tpoint->type == static_tracepoint
3157 if (tpoint->type == fast_tracepoint)
3158 install_fast_tracepoint (tpoint, own_buf);
3161 if (probe_marker_at (tpoint->address, own_buf) == 0)
3162 tpoint->handle = (void *) -1;
3169 if (tpoint->handle == NULL)
3178 static void download_tracepoint_1 (struct tracepoint *tpoint);
3183 struct tracepoint *tpoint, *prev_ftpoint, *prev_stpoint;
3204 /* No previous fast tpoint yet. */
3207 /* No previous static tpoint yet. */
3225 for (tpoint = tracepoints; tpoint; tpoint = tpoint->next)
3228 tpoint->hit_count = 0;
3229 tpoint->traceframe_usage = 0;
3231 if (tpoint->type == trap_tracepoint)
3237 tpoint->handle = set_breakpoint_at (tpoint->address,
3240 else if (tpoint->type == fast_tracepoint
3241 || tpoint->type == static_tracepoint)
3247 tpoint->type == static_tracepoint
3252 if (tpoint->type == fast_tracepoint)
3258 && prev_ftpoint->address == tpoint->address)
3261 tracepoint_send_agent (tpoint);
3263 download_tracepoint_1 (tpoint);
3265 clone_fast_tracepoint (tpoint, prev_ftpoint);
3274 installed = !tracepoint_send_agent (tpoint);
3277 download_tracepoint_1 (tpoint);
3278 installed = !install_fast_tracepoint (tpoint, packet);
3282 prev_ftpoint = tpoint;
3294 download_tracepoint_1 (tpoint);
3297 && prev_stpoint->address == tpoint->address)
3298 tpoint->handle = (void *) -1;
3301 if (probe_marker_at (tpoint->address, packet) == 0)
3303 tpoint->handle = (void *) -1;
3307 prev_stpoint = tpoint;
3313 tpptr = tpoint->obj_addr_on_target;
3315 if (tpoint == tracepoints)
3327 if (tpoint->handle == NULL)
3334 if (tpoint != NULL)
3407 tpoint object's memory or the jump pads here (we only do that
3692 struct tracepoint *tpoint;
3702 tpoint = find_tracepoint (num, addr);
3704 if (!tpoint)
3712 sprintf (own_buf, "V%" PRIu64 ":%" PRIu64 "", tpoint->hit_count,
3713 tpoint->traceframe_usage);
3727 response_tracepoint (char *packet, struct tracepoint *tpoint)
3731 sprintf (packet, "T%x:%s:%c:%" PRIx64 ":%" PRIx64, tpoint->number,
3732 paddress (tpoint->address),
3733 (tpoint->enabled ? 'E' : 'D'), tpoint->step_count,
3734 tpoint->pass_count);
3735 if (tpoint->type == fast_tracepoint)
3736 sprintf (packet + strlen (packet), ":F%x", tpoint->orig_size);
3737 else if (tpoint->type == static_tracepoint)
3740 if (tpoint->cond)
3742 buf = gdb_unparse_agent_expr (tpoint->cond);
3744 tpoint->cond->length, buf);
3756 response_action (char *packet, struct tracepoint *tpoint,
3760 (step ? 'S' : 'A'), tpoint->number, paddress (tpoint->address),
3769 struct tracepoint *tpoint, struct source_string *src)
3779 tpoint->number, paddress (tpoint->address),
4345 struct tracepoint *tpoint;
4383 tpoint = find_tracepoint (wstep->tp_number, wstep->tp_address);
4384 if (tpoint == NULL)
4402 stop_pc, tpoint, wstep->current_step);
4404 if (wstep->current_step >= tpoint->step_count)
4418 if (tpoint->pass_count > 0
4419 && tpoint->hit_count >= tpoint->pass_count
4421 stopping_tracepoint = tpoint;
4497 trace_debug ("lib stopped due to tpoint");
4531 struct tracepoint *tpoint;
4542 for (tpoint = tracepoints; tpoint; tpoint = tpoint->next)
4550 if (tpoint->enabled && stop_pc == tpoint->address
4551 && tpoint->type != static_tracepoint)
4555 tpoint->number, paddress (tpoint->address));
4558 if (!tpoint->cond
4560 ((struct tracepoint_hit_ctx *) &ctx, tpoint)))
4562 stop_pc, tpoint);
4573 else if (tpoint->step_count > 0)
4576 tpoint->number, tpoint->address);
4599 struct tracepoint *tpoint)
4605 tpoint->hit_count++;
4611 if (tpoint->pass_count > 0
4612 && tpoint->hit_count >= tpoint->pass_count
4613 && tpoint->step_count == 0
4615 stopping_tracepoint = tpoint;
4618 tpoint->number, paddress (tpoint->address), tpoint->hit_count);
4620 tframe = add_traceframe (tpoint);
4624 for (acti = 0; acti < tpoint->numactions; ++acti)
4628 tpoint->number, paddress (tpoint->address),
4629 tpoint->actions_str[acti]);
4632 do_action_at_tracepoint (ctx, stop_pc, tpoint, tframe,
4633 tpoint->actions[acti]);
4648 struct tracepoint *tpoint, int current_step)
4655 tpoint->number, paddress (tpoint->address),
4656 current_step, tpoint->step_count,
4657 tpoint->hit_count);
4659 tframe = add_traceframe (tpoint);
4663 for (acti = 0; acti < tpoint->num_step_actions; ++acti)
4666 tpoint->number, paddress (tpoint->address),
4667 tpoint->step_actions_str[acti]);
4669 do_action_at_tracepoint (ctx, stop_pc, tpoint, tframe,
4670 tpoint->step_actions[acti]);
4725 sctx->tpoint->address);
4746 struct tracepoint *tpoint,
4762 ax_ctx.tpoint = tpoint;
4785 regspace = add_traceframe_block (tframe, tpoint, 1 + regcache_size);
4807 stop_pc. Note that we can't use tpoint->address instead,
4830 ax_ctx.tpoint = tpoint;
4838 record_tracepoint_error (tpoint, "action expression", err);
4862 struct tracepoint *tpoint)
4882 if (tpoint->compiled_cond)
4885 err = ((condfn) (uintptr_t) (tpoint->compiled_cond)) (fctx->regs, &value);
4894 ax_ctx.tpoint = tpoint;
4896 err = gdb_eval_agent_expr (&ax_ctx, tpoint->cond, &value);
4900 record_tracepoint_error (tpoint, "condition", err);
4906 tpoint->number, paddress (tpoint->address),
4932 mspace = add_traceframe_block (ctx->tframe, ctx->tpoint, sp);
4990 mspace = add_traceframe_block (ctx->tframe, ctx->tpoint, sp);
5021 vspace = add_traceframe_block (ctx->tframe, ctx->tpoint,
5160 struct tracepoint *tpoint;
5180 tpoint = find_next_tracepoint_by_number (NULL, tframe->tpnum);
5181 if (tpoint != NULL)
5182 regcache_write_pc (regcache, tpoint->address);
5461 struct tracepoint *tpoint;
5463 for (tpoint = tracepoints; tpoint; tpoint = tpoint->next)
5464 if (tpoint->type == fast_tracepoint)
5465 if (tpoint->jump_pad <= pc && pc < tpoint->jump_pad_end)
5466 return tpoint;
5476 struct tracepoint *tpoint;
5478 for (tpoint = tracepoints; tpoint; tpoint = tpoint->next)
5480 if (tpoint->type == fast_tracepoint
5481 && tpoint->trampoline <= pc && pc < tpoint->trampoline_end)
5482 return tpoint;
5495 struct tracepoint *tpoint;
5497 for (tpoint = tracepoints; tpoint; tpoint = tpoint->next)
5498 if (tpoint->type == fast_tracepoint)
5499 if (tpoint->obj_addr_on_target == ipa_tpoint_obj)
5500 return tpoint;
5513 uintptr_t tpoint;
5552 struct tracepoint *tpoint;
5579 tpoint = NULL;
5610 tpoint = fast_tracepoint_from_jump_pad_address (stop_pc);
5611 if (tpoint == NULL)
5613 warning ("in jump pad, but no matching tpoint?");
5618 trace_debug ("in jump pad of tpoint (%d, %s); jump_pad(%s, %s); "
5620 tpoint->number, paddress (tpoint->address),
5621 paddress (tpoint->jump_pad),
5622 paddress (tpoint->jump_pad_end),
5623 paddress (tpoint->adjusted_insn_addr),
5624 paddress (tpoint->adjusted_insn_addr_end));
5629 if (tpoint->jump_pad <= stop_pc
5630 && stop_pc < tpoint->adjusted_insn_addr)
5638 tpoint = fast_tracepoint_from_trampoline_address (stop_pc);
5639 if (tpoint == NULL)
5641 warning ("in trampoline, but no matching tpoint?");
5646 trace_debug ("in trampoline of tpoint (%d, %s); trampoline(%s, %s)",
5647 tpoint->number, paddress (tpoint->address),
5648 paddress (tpoint->trampoline),
5649 paddress (tpoint->trampoline_end));
5693 tpoint
5694 = fast_tracepoint_from_ipa_tpoint_address (ipa_collecting_obj.tpoint);
5695 if (tpoint == NULL)
5698 "but tpoint %s not found?",
5699 paddress ((CORE_ADDR) ipa_collecting_obj.tpoint));
5711 status->tpoint_num = tpoint->number;
5712 status->tpoint_addr = tpoint->address;
5713 status->adjusted_insn_addr = tpoint->adjusted_insn_addr;
5714 status->adjusted_insn_addr_end = tpoint->adjusted_insn_addr_end;
5725 paddress (tpoint->adjusted_insn_addr));
5735 paddress (tpoint->adjusted_insn_addr),
5736 paddress (tpoint->adjusted_insn_addr_end));
5756 IP_AGENT_EXPORT_FUNC void gdb_collect (struct tracepoint *tpoint,
5764 gdb_collect (struct tracepoint *tpoint, unsigned char *regs)
5786 for (ctx.tpoint = tpoint;
5787 ctx.tpoint != NULL && ctx.tpoint->address == tpoint->address;
5788 ctx.tpoint = ctx.tpoint->next)
5790 if (!ctx.tpoint->enabled)
5795 if (ctx.tpoint->type != tpoint->type)
5799 if (ctx.tpoint->cond == NULL
5801 ctx.tpoint))
5804 ctx.tpoint->address, ctx.tpoint);
5894 compile_tracepoint_condition (struct tracepoint *tpoint,
5901 tpoint->number);
5908 err = compile_bytecodes (tpoint->cond);
5915 tpoint->compiled_cond = entry_point;
5918 tpoint->number);
5924 tpoint->compiled_cond = 0;
5928 tpoint->number, err);
5997 download_tracepoint_1 (struct tracepoint *tpoint)
6002 gdb_assert (tpoint->type == fast_tracepoint
6003 || tpoint->type == static_tracepoint);
6005 if (tpoint->cond != NULL && target_emit_ops () != NULL)
6011 if (tpoint->cond != NULL)
6018 compile_tracepoint_condition (tpoint, &jentry);
6026 target_tracepoint = *tpoint;
6028 tpptr = target_malloc (sizeof (*tpoint));
6029 tpoint->obj_addr_on_target = tpptr;
6042 if (tpoint->cond)
6045 download_agent_expr (tpoint->cond));
6047 if (tpoint->numactions)
6054 = target_malloc (sizeof (*tpoint->actions) * tpoint->numactions);
6060 for (i = 0; i < tpoint->numactions; i++)
6062 struct tracepoint_action *action = tpoint->actions[i];
6067 + i * sizeof (*tpoint->actions),
6079 /* Send a command to agent to download and install tracepoint TPOINT. */
6082 tracepoint_send_agent (struct tracepoint *tpoint)
6092 COPY_FIELD_TO_BUF (p, tpoint, number);
6093 COPY_FIELD_TO_BUF (p, tpoint, address);
6094 COPY_FIELD_TO_BUF (p, tpoint, type);
6095 COPY_FIELD_TO_BUF (p, tpoint, enabled);
6096 COPY_FIELD_TO_BUF (p, tpoint, step_count);
6097 COPY_FIELD_TO_BUF (p, tpoint, pass_count);
6098 COPY_FIELD_TO_BUF (p, tpoint, numactions);
6099 COPY_FIELD_TO_BUF (p, tpoint, hit_count);
6100 COPY_FIELD_TO_BUF (p, tpoint, traceframe_usage);
6101 COPY_FIELD_TO_BUF (p, tpoint, compiled_cond);
6102 COPY_FIELD_TO_BUF (p, tpoint, orig_size);
6105 p = agent_expr_send (p, tpoint->cond);
6108 for (i = 0; i < tpoint->numactions; i++)
6110 struct tracepoint_action *action = tpoint->actions[i];
6119 if (tpoint->type == fast_tracepoint)
6133 memcpy (&tpoint->obj_addr_on_target,
6136 if (tpoint->type == fast_tracepoint)
6143 (unsigned int) tpoint->obj_addr_on_target,
6151 tpoint->handle
6152 = set_fast_tracepoint_jump (tpoint->address, insn, fjump_size);
6159 download_tracepoint (struct tracepoint *tpoint)
6163 if (tpoint->type != fast_tracepoint
6164 && tpoint->type != static_tracepoint)
6167 download_tracepoint_1 (tpoint);
6169 /* Find the previous entry of TPOINT, which is fast tracepoint or
6172 for (tp = tracepoints; tp != tpoint; tp = tp->next)
6182 /* Insert TPOINT after TP_PREV in IPA. */
6190 /* tpoint->next = tp_prev->next */
6191 write_inferior_data_pointer (tpoint->obj_addr_on_target
6194 /* tp_prev->next = tpoint */
6197 tpoint->obj_addr_on_target);
6203 tpoint->obj_addr_on_target);
6428 struct tracepoint *tpoint;
6447 tpoint = find_next_tracepoint_by_number (NULL, ipa_tframe.tpnum);
6449 tframe = add_traceframe (tpoint);
6459 block = add_traceframe_block (tframe, tpoint,
6629 struct tracepoint *tpoint;
6631 for (tpoint = tracepoints; tpoint; tpoint = tpoint->next)
6633 if (tpoint->type != static_tracepoint)
6636 if (tpoint->address == (uintptr_t) mdata->location)
6637 return tpoint;
6653 struct tracepoint *tpoint;
6680 tpoint = ust_marker_to_static_tracepoint (mdata);
6681 if (tpoint == NULL)
6690 if (!tpoint->enabled)
6696 ctx.tpoint = tpoint;
6704 if (tpoint->cond == NULL
6706 tpoint))
6709 tpoint->address, tpoint);
6760 bufspace = add_traceframe_block (tframe, umd->tpoint,