<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_frame_pointers(frame=None):
 """ Obtain writable pointers to ``frame.f_trace`` and ``frame.f_lineno``. Very dangerous. Unlikely to be portable between python implementations. This is hard in general because the ``PyFrameObject`` can have a variable size depending on the build configuration. We can get it reliably because we can determine the offset to ``f_tstate`` by searching for the value of that pointer. """

    if frame is None:
        frame = sys._getframe(2)
    frame = id(frame)

    # http://hg.python.org/cpython/file/3aa530c2db06/Include/frameobject.h#l28
    F_TRACE_OFFSET = 6
    Ppy_object = ctypes.POINTER(ctypes.py_object)
    trace = Ppy_object.from_address(frame+(F_CODE_IDX+F_TRACE_OFFSET)*svp)

    LASTI_OFFSET = F_TRACE_OFFSET + 4

    lasti_addr  = LASTI_OFFSET
    lineno_addr = LASTI_OFFSET + ctypes.sizeof(ctypes.c_int)

    f_lineno = ctypes.c_int.from_address(lineno_addr)
    f_lasti = ctypes.c_int.from_address(lasti_addr)

    return trace, f_lineno, f_lasti