Re: [hatari-devel] Hatari debugger builtin symbols / variables

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Hi,

On 07/18/2016 12:30 AM, Eero Tamminen wrote:
I did some refactoring for the debugger builtin symbol handling,
so that it's now easier to add new variables (code is in its own
file not part of the huge breakpoint code) and there's a new 'v'
debugger command to list these symbols/variables.

Any wishes for additional variables that it would be nice to
be supported by debugger directly / which values one would
want to see and/or use in breakpoints?

Attached is an example of adding one for screen refresh rate.


	- Eero
diff -r b573841d2ce1 src/debug/vars.c
--- a/src/debug/vars.c	Sat Aug 13 21:49:24 2016 +0300
+++ b/src/debug/vars.c	Sat Aug 13 21:58:45 2016 +0300
@@ -138,6 +138,11 @@
 	return Disasm_GetNextPC(M68000_GetPC());
 }
 
+static Uint32 GetScreenRefreshRate(void)
+{
+	return nScreenRefreshRate;
+}
+
 /* sorted by variable name so that this can be bisected */
 static const var_addr_t hatari_vars[] = {
 	{ "AesOpcode", (Uint32*)GetAesOpcode, VALUE_TYPE_FUNCTION32, 16, "$FFFF when not on AES trap" },
@@ -158,6 +163,7 @@
 	{ "LineCycles", (Uint32*)GetLineCycles, VALUE_TYPE_FUNCTION32, 0, "is always divisable by 4" },
 	{ "LineFOpcode", (Uint32*)GetLineFOpcode, VALUE_TYPE_FUNCTION32, 16, "$FFFF when not on Line-F opcode" },
 	{ "NextPC", (Uint32*)GetNextPC, VALUE_TYPE_FUNCTION32, 0, NULL },
+	{ "ScreenRefreshRate", (Uint32*)GetScreenRefreshRate, VALUE_TYPE_FUNCTION32, 0, "screen refresh rate (50/60/71Hz)" },
 	{ "TEXT", (Uint32*)DebugInfo_GetTEXT, VALUE_TYPE_FUNCTION32, 0, "invalid before Desktop is up" },
 	{ "TEXTEnd", (Uint32*)DebugInfo_GetTEXTEnd, VALUE_TYPE_FUNCTION32, 0, "invalid before Desktop is up" },
 	{ "VBL", (Uint32*)&nVBLs, VALUE_TYPE_VAR32, sizeof(nVBLs)*8, NULL },


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/