コード例 #1
0
ファイル: log.c プロジェクト: BackupTheBerlios/dgd-httpd-svn
string get_logging_item()
{
	string t, program;
	mixed *a;
	int i;

	a = explode(previous_program(1), "/");
	program = a[sizeof(a)-1] + ".c";
	i = sizeof(call_trace());
	a = call_trace()[i-4];
	t = program + "->" + a[TRACE_FUNCTION] + "() (" + a[TRACE_LINE] + ")";
	return t;
}
コード例 #2
0
ファイル: argcheck.c プロジェクト: Shea690901/gurbalib
static void argcheck(mixed arg, int num, varargs string type) {
  mixed **trace;

  if(!arg) {
    trace = call_trace();
    error( MAGIC_ERROR_ARGCHECK + (string) num + " to " + 
      trace[sizeof(trace)-2][2] + ( type ? " (needs " + type + ")" : "" ) 
    );
  }
}
コード例 #3
0
nomask static string previous_function()
{
    mixed t;
    int i;
    
    t = call_trace();
    i = sizeof(t) - 3;
    
    if(i < 0)
        i=0;
        
    t = t[i][TRACE_FUNCTION];
    
    return t;
}
コード例 #4
0
ファイル: trace_data.cpp プロジェクト: mer-tools/sp-rtrace
/**
 * Stores trace data for the list of events.
 *
 * @param[in] events
 * @param[in] frames
 * @param[in] nframes
 */
void TraceData::storeTrace(std::list<CallEvent*>& events, sp_rtrace_btframe_t* frames, int nframes)
{
	if (events.empty()) return;

	sp_rtrace_ftrace_t trace = {nframes, NULL, NULL};
	if (nframes) {
		trace.frames = new pointer_t[nframes];
		trace.resolved_names = new char*[nframes];

		for (int i = 0; i < nframes; i++) {
			trace.frames[i] = frames[i].addr;
			trace.resolved_names[i] = frames[i].name;
		}
	}

	CallTrace::ptr_t call_trace(new CallTrace(trace));
	for (std::list<CallEvent*>::iterator iter = events.begin(); iter != events.end(); iter++) {
		(*iter)->setTrace(call_trace);
	}
}
コード例 #5
0
ファイル: _dispatcher.c プロジェクト: esc/numba
static int
call_trace_protected(Py_tracefunc func, PyObject *obj,
                     PyThreadState *tstate, PyFrameObject *frame,
                     int what, PyObject *arg)
{
    PyObject *type, *value, *traceback;
    int err;
    PyErr_Fetch(&type, &value, &traceback);
    err = call_trace(func, obj, tstate, frame, what, arg);
    if (err == 0)
    {
        PyErr_Restore(type, value, traceback);
        return 0;
    }
    else
    {
        Py_XDECREF(type);
        Py_XDECREF(value);
        Py_XDECREF(traceback);
        return -1;
    }
}