/* * With the GSOFF_ declarations above, we can use SR_ATTRIBUTE_ macros that * expand to PyGetSetDef literals with the right values. There is also * SR_ATTRIBUTE_type_R variant that allows you to name the attribute different * than the C struct member. */ static PyGetSetDef frame_getset[] = { SR_ATTRIBUTE_STRING(function_name, "Function name (string)" ), SR_ATTRIBUTE_STRING(function_type, "Function type (string)" ), SR_ATTRIBUTE_UINT32(number, "Frame number (positive integer)" ), SR_ATTRIBUTE_STRING(source_file, "Source file name (string)" ), SR_ATTRIBUTE_UINT32(source_line, "Source line number (positive integer)" ), SR_ATTRIBUTE_BOOL (signal_handler_called, "True if the frame is signal handler (bool)"), SR_ATTRIBUTE_UINT64(address, "Address of the current instruction (long)" ), SR_ATTRIBUTE_STRING(library_name, "Executable file name (string)" ), { NULL }, }; PyTypeObject sr_py_gdb_frame_type = { PyObject_HEAD_INIT(NULL) 0, "satyr.GdbFrame", /* tp_name */ sizeof(struct sr_py_gdb_frame), /* tp_basicsize */ 0, /* tp_itemsize */ sr_py_gdb_frame_free, /* tp_dealloc */ NULL, /* tp_print */ NULL, /* tp_getattr */
GSOFF_MEMBER(function_offset), GSOFF_MEMBER(function_length), GSOFF_MEMBER(module_name), GSOFF_MEMBER(from_address), GSOFF_MEMBER(from_function_name), GSOFF_MEMBER(from_function_offset), GSOFF_MEMBER(from_function_length), GSOFF_MEMBER(from_module_name), GSOFF_MEMBER(special_stack) GSOFF_END static PyGetSetDef frame_getset[] = { SR_ATTRIBUTE_BOOL (reliable, "True if the the frame is guaranteed to be real (bool)"), SR_ATTRIBUTE_UINT64(address, "Address of the current instruction (long)" ), SR_ATTRIBUTE_STRING(function_name, "Function name (string)" ), SR_ATTRIBUTE_UINT64(function_offset, "Function offset (long)" ), SR_ATTRIBUTE_UINT64(function_length, "Function length (long)" ), SR_ATTRIBUTE_STRING(module_name, "Module owning the function (string)" ), SR_ATTRIBUTE_UINT64(from_address, "Address of the caller's instruction (long)" ), SR_ATTRIBUTE_STRING(from_function_name, "Caller function name (string)" ), SR_ATTRIBUTE_UINT64(from_function_offset, "Caller function offset (long)" ), SR_ATTRIBUTE_UINT64(from_function_length, "Caller function length (long)" ), SR_ATTRIBUTE_STRING(from_module_name, "Module owning the caller function (string)" ), SR_ATTRIBUTE_STRING(special_stack, "Identifier of x86_64 kernel stack (string)" ), { NULL }, }; PyTypeObject sr_py_koops_frame_type =