mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-12-17 07:40:07 +08:00
[gdb/python] Use gdbpy_err_fetch::{type,value} as getters
Similar to gdbpy_err_fetch::value, add a getter gdbpy_err_fetch::type, and use both consistently to get gdbpy_err_fetch members m_error_value and m_error_type. Tested on aarch64-linux.
This commit is contained in:
@@ -675,16 +675,24 @@ public:
|
||||
|
||||
bool type_matches (PyObject *type) const
|
||||
{
|
||||
return PyErr_GivenExceptionMatches (m_error_type.get (), type);
|
||||
gdbpy_ref<> err_type = this->type ();
|
||||
return PyErr_GivenExceptionMatches (err_type.get (), type);
|
||||
}
|
||||
|
||||
/* Return a new reference to the exception value object. */
|
||||
|
||||
gdbpy_ref<> value ()
|
||||
gdbpy_ref<> value () const
|
||||
{
|
||||
return m_error_value;
|
||||
}
|
||||
|
||||
/* Return a new reference to the exception type object. */
|
||||
|
||||
gdbpy_ref<> type () const
|
||||
{
|
||||
return m_error_type;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
gdbpy_ref<> m_error_type, m_error_value, m_error_traceback;
|
||||
|
||||
Reference in New Issue
Block a user