Beispiel #1
0
  void visitFunc(Func * p)
  {
	int num_args=0;
		list<Decl_ptr>::iterator iter;
		for (iter=p->m_decl_list->begin(); iter!=p->m_decl_list->end(); iter++)
		{
			num_args += ((Decl *)(*iter))->m_symname_list->size();
		}

		emit_prologue(p->m_symname,m_st->scopesize(p->m_attribute.m_scope), num_args);


		p->visit_children(this);
		emit_epilogue();
  }
void
tracepoint_compile_condition (tracepoint_t *tpoint, gdb_addr_t *jump_entry)
{
    gdb_addr_t entry_point = *jump_entry;
    enum eval_result_type err;

    gdb_verbose ("Starting condition compilation for tracepoint %d",
                 tpoint->number);

    /* Initialize the global pointer to the code being built.  */
    current_insn_ptr = *jump_entry;

    emit_prologue ();

    err = agent_expr_compile_bytecodes (tpoint->cond,
                                        trace_state_variable_get_value_pself,
                                        trace_state_variable_set_value);

    if (err == expr_eval_no_error)
    {
        emit_epilogue ();

        /* Record the beginning of the compiled code.  */
        tpoint->compiled_cond = entry_point;

        gdb_verbose ("Condition compilation for tracepoint %d complete",
                     tpoint->number);
    }
    else
    {
        /* Leave the unfinished code in situ, but don't point to it.  */

        tpoint->compiled_cond = 0;

        gdb_verbose ("Condition compilation for tracepoint %d failed, error code %d",
                     tpoint->number, err);
    }

    /* Update the code pointer passed in.  Note that we do this even if
       the compile fails, so that we can look at the partial results
       instead of letting them be overwritten.  */
    *jump_entry = current_insn_ptr;

    /* Leave a gap, to aid dump decipherment.  */
    *jump_entry += 16;
}