bpo-38960: DTrace build fix for FreeBSD. (GH-17451)

DTrace build fix for FreeBSD.

- allowing passing an extra flag as it need to define the arch size.
- casting some probe's arguments.
This commit is contained in:
David Carlier 2020-01-28 12:53:32 +00:00 committed by Petr Viktorin
parent 2cca8efe46
commit aabdeb766b
6 changed files with 9 additions and 10 deletions

View file

@ -5447,7 +5447,7 @@ dtrace_function_entry(PyFrameObject *f)
funcname = PyUnicode_AsUTF8(f->f_code->co_name);
lineno = PyCode_Addr2Line(f->f_code, f->f_lasti);
PyDTrace_FUNCTION_ENTRY(filename, funcname, lineno);
PyDTrace_FUNCTION_ENTRY((char *)filename, (char *)funcname, lineno);
}
static void
@ -5461,7 +5461,7 @@ dtrace_function_return(PyFrameObject *f)
funcname = PyUnicode_AsUTF8(f->f_code->co_name);
lineno = PyCode_Addr2Line(f->f_code, f->f_lasti);
PyDTrace_FUNCTION_RETURN(filename, funcname, lineno);
PyDTrace_FUNCTION_RETURN((char *)filename, (char *)funcname, lineno);
}
/* DTrace equivalent of maybe_call_line_trace. */
@ -5493,7 +5493,7 @@ maybe_dtrace_line(PyFrameObject *frame,
co_name = PyUnicode_AsUTF8(frame->f_code->co_name);
if (!co_name)
co_name = "?";
PyDTrace_LINE(co_filename, co_name, line);
PyDTrace_LINE((char *)co_filename, (char *)co_name, line);
}
*instr_prev = frame->f_lasti;
}

View file

@ -1762,14 +1762,14 @@ import_find_and_load(PyThreadState *tstate, PyObject *abs_name)
}
if (PyDTrace_IMPORT_FIND_LOAD_START_ENABLED())
PyDTrace_IMPORT_FIND_LOAD_START(PyUnicode_AsUTF8(abs_name));
PyDTrace_IMPORT_FIND_LOAD_START((char *)PyUnicode_AsUTF8(abs_name));
mod = _PyObject_CallMethodIdObjArgs(interp->importlib,
&PyId__find_and_load, abs_name,
interp->import_func, NULL);
if (PyDTrace_IMPORT_FIND_LOAD_DONE_ENABLED())
PyDTrace_IMPORT_FIND_LOAD_DONE(PyUnicode_AsUTF8(abs_name),
PyDTrace_IMPORT_FIND_LOAD_DONE((char *)PyUnicode_AsUTF8(abs_name),
mod != NULL);
if (import_time) {

View file

@ -204,7 +204,7 @@ PySys_Audit(const char *event, const char *argFormat, ...)
/* Dtrace USDT point */
if (dtrace) {
PyDTrace_AUDIT(event, (void *)eventArgs);
PyDTrace_AUDIT((char *)event, (void *)eventArgs);
}
/* Call interpreter hooks */