Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit eb76b84

Browse files
committed
Added DebugStr method to drop into low-level debugger
1 parent 05cf7e0 commit eb76b84

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

Mac/Modules/macosmodule.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2929

3030
#include <Windows.h>
3131
#include <Files.h>
32+
#include <LowMem.h>
3233

3334
static PyObject *MacOS_Error; /* Exception MacOS.Error */
3435

@@ -532,6 +533,20 @@ MacOS_splash(PyObject *self, PyObject *args)
532533
return Py_None;
533534
}
534535

536+
static char DebugStr_doc[] = "Switch to low-level debugger with a message";
537+
538+
static PyObject *
539+
MacOS_DebugStr(PyObject *self, PyObject *args)
540+
{
541+
Str255 message;
542+
PyObject *object = 0;
543+
544+
if (!PyArg_ParseTuple(args, "O&|O", PyMac_GetStr255, message, &object))
545+
return NULL;
546+
DebugStr(message);
547+
Py_INCREF(Py_None);
548+
return Py_None;
549+
}
535550

536551
static char openrf_doc[] = "Open resource fork of a file";
537552

@@ -606,6 +621,7 @@ static PyMethodDef MacOS_Methods[] = {
606621
{"GetErrorString", MacOS_GetErrorString, 1},
607622
{"openrf", MacOS_openrf, 1, openrf_doc},
608623
{"splash", MacOS_splash, 1, splash_doc},
624+
{"DebugStr", MacOS_DebugStr, 1, DebugStr_doc},
609625
{NULL, NULL} /* Sentinel */
610626
};
611627

0 commit comments

Comments
 (0)