mirror of
https://github.com/cemu-project/idapython.git
synced 2024-11-24 01:59:18 +01:00
idd.i: added dbg_get_name() to get the current debugger's name
This commit is contained in:
parent
ff7ab3f1dc
commit
69e35391a5
20
swig/dbg.i
20
swig/dbg.i
@ -15,7 +15,7 @@ typedef struct
|
||||
|
||||
%{
|
||||
//<code(py_dbg)>
|
||||
PyObject *meminfo_vec_t_to_py(meminfo_vec_t &areas);
|
||||
static PyObject *meminfo_vec_t_to_py(meminfo_vec_t &areas);
|
||||
//</code(py_dbg)>
|
||||
%}
|
||||
|
||||
@ -23,7 +23,7 @@ PyObject *meminfo_vec_t_to_py(meminfo_vec_t &areas);
|
||||
|
||||
//<inline(py_dbg)>
|
||||
//-------------------------------------------------------------------------
|
||||
PyObject *py_get_manual_regions()
|
||||
static PyObject *py_get_manual_regions()
|
||||
{
|
||||
meminfo_vec_t areas;
|
||||
get_manual_regions(&areas);
|
||||
@ -31,7 +31,7 @@ PyObject *py_get_manual_regions()
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
PyObject *refresh_debugger_memory()
|
||||
static PyObject *refresh_debugger_memory()
|
||||
{
|
||||
invalidate_dbgmem_config();
|
||||
invalidate_dbgmem_contents(BADADDR, BADADDR);
|
||||
@ -42,7 +42,7 @@ PyObject *refresh_debugger_memory()
|
||||
//</inline(py_dbg)>
|
||||
|
||||
int idaapi DBG_Callback(void *ud, int notification_code, va_list va);
|
||||
class DBG_Hooks
|
||||
class DBG_Hooks
|
||||
{
|
||||
public:
|
||||
virtual ~DBG_Hooks() {};
|
||||
@ -72,8 +72,8 @@ public:
|
||||
virtual void dbg_thread_start(pid_t pid,
|
||||
thid_t tid,
|
||||
ea_t ea) { };
|
||||
virtual void dbg_thread_exit(pid_t pid,
|
||||
thid_t tid,
|
||||
virtual void dbg_thread_exit(pid_t pid,
|
||||
thid_t tid,
|
||||
ea_t ea,
|
||||
int exit_code) { };
|
||||
virtual void dbg_library_load(pid_t pid,
|
||||
@ -100,7 +100,7 @@ public:
|
||||
virtual void dbg_suspend_process(void) { };
|
||||
virtual int dbg_bpt(thid_t tid, ea_t breakpoint_ea) { return 0; };
|
||||
virtual int dbg_trace(thid_t tid, ea_t ip) { return 0; };
|
||||
virtual void dbg_request_error(ui_notification_t failed_command,
|
||||
virtual void dbg_request_error(ui_notification_t failed_command,
|
||||
dbg_notification_t failed_dbg_notification) { };
|
||||
virtual void dbg_step_into(void) { };
|
||||
virtual void dbg_step_over(void) { };
|
||||
@ -250,9 +250,9 @@ int idaapi DBG_Callback(void *ud, int notification_code, va_list va)
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
catch (Swig::DirectorException &)
|
||||
{
|
||||
msg("Exception in IDP Hook function:\n");
|
||||
catch (Swig::DirectorException &)
|
||||
{
|
||||
msg("Exception in IDP Hook function:\n");
|
||||
if (PyErr_Occurred())
|
||||
{
|
||||
PyErr_Print();
|
||||
|
23
swig/idd.i
23
swig/idd.i
@ -12,7 +12,7 @@
|
||||
//<code(py_idd)>
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
bool dbg_can_query()
|
||||
static bool dbg_can_query()
|
||||
{
|
||||
// Reject the request only if no debugger is set
|
||||
// or the debugger cannot be queried while not in suspended state
|
||||
@ -20,12 +20,12 @@ bool dbg_can_query()
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
PyObject *meminfo_vec_t_to_py(meminfo_vec_t &areas)
|
||||
static PyObject *meminfo_vec_t_to_py(meminfo_vec_t &areas)
|
||||
{
|
||||
PyObject *py_list = PyList_New(areas.size());
|
||||
meminfo_vec_t::const_iterator it, it_end(areas.end());
|
||||
Py_ssize_t i = 0;
|
||||
for (it=areas.begin();it!=it_end;++it, ++i)
|
||||
for ( it=areas.begin(); it!=it_end; ++it, ++i )
|
||||
{
|
||||
const memory_info_t &mi = *it;
|
||||
// startEA endEA name sclass sbase bitness perm
|
||||
@ -162,7 +162,7 @@ PyObject *py_appcall(
|
||||
PyObject *py_fields,
|
||||
PyObject *arg_list)
|
||||
{
|
||||
if (!PyList_Check(arg_list))
|
||||
if ( !PyList_Check(arg_list) )
|
||||
return NULL;
|
||||
|
||||
const char *type = py_type == Py_None ? NULL : PyString_AS_STRING(py_type);
|
||||
@ -174,7 +174,7 @@ PyObject *py_appcall(
|
||||
Py_ssize_t nargs = PyList_Size(arg_list);
|
||||
idc_args.resize(nargs);
|
||||
bool ok = true;
|
||||
for (Py_ssize_t i=0;i<nargs;i++)
|
||||
for ( Py_ssize_t i=0; i<nargs; i++ )
|
||||
{
|
||||
// Get argument
|
||||
PyObject *py_item = PyList_GetItem(arg_list, i);
|
||||
@ -185,7 +185,7 @@ PyObject *py_appcall(
|
||||
msg("obj[%d]->%s\n", int(i), s.c_str());
|
||||
}
|
||||
// Convert it
|
||||
if (pyvar_to_idcvar(py_item, &idc_args[i], &sn) < CIP_OK)
|
||||
if ( pyvar_to_idcvar(py_item, &idc_args[i], &sn) < CIP_OK )
|
||||
{
|
||||
ok = false;
|
||||
break;
|
||||
@ -193,7 +193,7 @@ PyObject *py_appcall(
|
||||
}
|
||||
|
||||
// Set exception message
|
||||
if (!ok)
|
||||
if ( !ok )
|
||||
{
|
||||
PyErr_SetString(PyExc_ValueError, "PyAppCall: Failed to convert Python values to IDC values");
|
||||
return NULL;
|
||||
@ -300,7 +300,14 @@ PyObject *dbg_read_memory(PyObject *py_ea, PyObject *py_sz);
|
||||
PyObject *dbg_get_thread_sreg_base(PyObject *py_tid, PyObject *py_sreg_value);
|
||||
PyObject *dbg_get_registers();
|
||||
PyObject *dbg_get_memory_info();
|
||||
bool dbg_can_query();
|
||||
static PyObject *dbg_get_name()
|
||||
{
|
||||
if ( dbg == NULL )
|
||||
Py_RETURN_NONE;
|
||||
return PyString_FromString(dbg->name);
|
||||
}
|
||||
|
||||
static bool dbg_can_query();
|
||||
PyObject *py_appcall(
|
||||
ea_t func_ea,
|
||||
thid_t tid,
|
||||
|
Loading…
Reference in New Issue
Block a user