WinDBG/Exts/CodeAnalyzer/gdbplus/gdb-7.7/gdb/python/py-ref.c
/* Return register name for register, none for other  */
Return register name for register, none for other
Return register name for register none for other
static PyObject *
object_ref_get_register_name (PyObject *self, void *closure)
{
	object_ref *obj_ref = (object_ref *) self;
	if (obj_ref->ref.storage_type == ENUM_REGISTER)
	{
		const char* reg_name;
		if (!obj_ref->ref.where.reg.name)
		{
			struct gdbarch *gdbarch = get_current_arch();
			reg_name = gdbarch_register_name (gdbarch, obj_ref->ref.where.reg.reg_num);
		}
		else
			reg_name = obj_ref->ref.where.reg.name;
		return PyString_FromString (reg_name);
	}
	else
	{
		Py_INCREF (Py_None);
		return Py_None;
	}
}
static PyObject * object_ref_get_register_name ( PyObject * self , void * closure ) { object_ref * obj_ref = ( object_ref * ) self ; if ( obj_ref -> ref . storage_type == ENUM_REGISTER ) { const char * reg_name ; if ( ! obj_ref -> ref . where . reg . name ) { struct gdbarch * gdbarch = get_current_arch ( ) ; reg_name = gdbarch_register_name ( gdbarch , obj_ref -> ref . where . reg . reg_num ) ; } else reg_name = obj_ref -> ref . where . reg . name ; return PyString_FromString ( reg_name ) ; } else { Py_INCREF ( Py_None ) ; return Py_None ; } }
Return register name for register, none for other
Return register name for register none for other