[hatari-devel] Re: Debugging m68k Linux with Hatari

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


Hi,

On perjantai 24 helmikuu 2012, Matthias Reis wrote:
> > On torstai 23 helmikuu 2012, Matthias Reis wrote:
> >> since the 'trace cpu_disasm' option can show the symbols assigned to
> >> certain PC values, is there an option to show only function calls?
> >> 
> >> This would definitely help to get a better overview of what's
> >> happening.
> > 
> > Trace of function calls which addresses one has loaded to the debugger?
> 
> Exactly.
> 
> > Currently nothing like that is supported, but I might add it, it sounds
> > useful.
> 
> I could also offer my help, if you need any.
> 
> > Do you have any proposals for command syntax & shortcut for enabling
> > this (after one has loaded the symbols)?
> 
> Maybe 'trace function_calls'? Or is that too long?

Attached briefly tested patch for:
	trace symbols

should be the most minimal way to implement that.


However, it has one problem, if you are or have collected profiling
data, you will still get output for every instruction...

IMHO the correct way to fix that would be to have the profile data
output as part of the disassembly output, having the profiling data
on separate line from instruction itself is IMHO very distracting.


(Having the symbol on separate line is OKish, because mostly symbols
are for function start points.)


	- Eero
diff -r 0a241b3444e2 src/debug/debugcpu.c
--- a/src/debug/debugcpu.c	Sun Feb 26 14:37:50 2012 +0100
+++ b/src/debug/debugcpu.c	Sun Feb 26 21:35:48 2012 +0200
@@ -517,7 +517,7 @@
 	{
 		Profile_CpuUpdate();
 	}
-	if (LOG_TRACE_LEVEL(TRACE_CPU_DISASM))
+	if (LOG_TRACE_LEVEL((TRACE_CPU_DISASM|TRACE_SYMBOLS)))
 	{
 		DebugCpu_ShowAddressInfo(M68000_GetPC());
 	}
@@ -548,7 +548,8 @@
 	bCpuProfiling = Profile_CpuStart();
 	nCpuActiveCBs = BreakCond_BreakPointCount(false);
 
-	if (nCpuActiveCBs || nCpuSteps || bCpuProfiling || bHistoryEnabled)
+	if (nCpuActiveCBs || nCpuSteps || bCpuProfiling || bHistoryEnabled
+	    || LOG_TRACE_LEVEL((TRACE_CPU_DISASM|TRACE_SYMBOLS)))
 		M68000_SetSpecial(SPCFLAG_DEBUGGER);
 	else
 		M68000_UnsetSpecial(SPCFLAG_DEBUGGER);
diff -r 0a241b3444e2 src/debug/log.c
--- a/src/debug/log.c	Sun Feb 26 14:37:50 2012 +0100
+++ b/src/debug/log.c	Sun Feb 26 21:35:48 2012 +0200
@@ -101,6 +101,8 @@
 	{ TRACE_DSP_STATE	 , "dsp_state" },
 	{ TRACE_DSP_ALL		 , "dsp_all" },
 
+	{ TRACE_SYMBOLS		 , "symbols" },
+
 	{ TRACE_ALL		 , "all" }
 };
 
diff -r 0a241b3444e2 src/debug/log.h
--- a/src/debug/log.h	Sun Feb 26 14:37:50 2012 +0100
+++ b/src/debug/log.h	Sun Feb 26 21:35:48 2012 +0200
@@ -119,6 +119,8 @@
 #define TRACE_DSP_STATE		 (1ll<<40)
 #define TRACE_DSP_INTERRUPT	 (1ll<<41)
 
+#define TRACE_SYMBOLS		 (1ll<<42)
+
 #define	TRACE_NONE		 (0)
 #define	TRACE_ALL		 (~0)
 


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