TraceEngine.cpp File Reference


Detailed Description

Contains the code for the CPU tracing engine.

This will become the debugging engine (interactive debugger) soon.

Id
TraceEngine.cpp,v 1.37 2008/03/26 19:15:05 iamcamiel Exp

X-1.37 Camiel Vanderhoeven 26-MAR-2008 Fix compiler warnings.

X-1.36 Camiel Vanderhoeven 25-MAR-2008 Comments.

X-1.35 Camiel Vanderhoeven 14-MAR-2008 1. More meaningful exceptions replace throwing (int) 1. 2. U64 macro replaces X64 macro.

X-1.34 Brian Wheeler 29-FEB-2008 Add BREAKPOINT INSTRUCTION command to IDB.

X-1.33 Brian Wheeler 12-JAN-2008 End run when Ctrl-C is received.

X-1.32 Camiel Vanderhoeven 02-JAN-2008 Avoid compiler warnings

X-1.31 Camiel Vanderhoeven 10-DEC-2007 Changes to make the TraceEngine work again after recent changes.

X-1.30 Brian Wheeler 6-DEC-2007 Bugfix in real_address.

X-1.29 Camiel Vanderhoeven 2-DEC-2007 Changed the way translation buffers work.

X-1.27 Camiel Vanderhoeven 1-DEC-2007 Moved inclusion of StdAfx.h outside conditional block; necessary for using precompiled headers in Visual C++.

X-1.26 Brian Wheeler 22-NOV-2007 Added LOADREG and LOADFPREG debugger commands.

X-1.25 Camiel Vanderhoeven 7-APR-2007 Added PCB to job context recognition.

X-1.24 Camiel Vanderhoeven 30-MAR-2007 Added old changelog comments.

X-1.23 Camiel Vanderhoeven 14-MAR-2007 a) bListing moved here from CAlphaCPU. b) Translation from virtual to physical address moved to an inline function (code to do this was duplicated many times...)

X-1.22 Camiel Vanderhoeven 14-MAR-2007 Added list_all method.

X-1.21 Camiel Vanderhoeven 12-MAR-2007 a) Added support for TranslationBuffer debugging. b) Changed format of calls to CTranslationBuffer::convert_address.

X-1.20 Camiel Vanderhoeven 9-MAR-2007 Use procname from the structure rather than getting it from memory to print this to the trace files.

X-1.19 Camiel Vanderhoeven 8-MAR-2007 a) get_fnc_name now requires CCPU * as an argument. b) When tracing, try to convert virtual addresses to physical ones through the translation buffers.

X-1.18 Camiel Vanderhoeven 7-MAR-2007 a) Limit write_printable_s to 100 characters. b) When tracing to an unknown (not in CSV file) function, treat all arguments as if they were strings. c) When dsplaying string arguments, try to translate a virtual address to a physical one through the translation buffer.

X-1.17 Camiel Vanderhoeven 7-MAR-2007 Fixed error in hiding functions (tracing).

X-1.16 Camiel Vanderhoeven 1-MAR-2007 Made a couple of arguments const char *.

X-1.15 Camiel Vanderhoeven 28-FEB-2007 Added support for lockstep-mechanism.

X-1.14 Camiel Vanderhoeven 26-FEB-2007 Fixed some unsigned integer comparisons.

X-1.13 Camiel Vanderhoeven 21-FEB-2007 Allow user to terminate execution from the serial port.

X-1.12 Camiel Vanderhoeven 18-FEB-2007 Added HASHING and DUMPREGS commands to the IDB.

X-1.11 Camiel Vanderhoeven 16-FEB-2007 a) Added the Interactive Debugger (IDB). b) Got rid of all ifdef _WIN32's arount printf statements.

X-1.10 Camiel Vanderhoeven 12-FEB-2007 Added comments.

X-1.9 Camiel Vanderhoeven 9-FEB-2007 Debugging flqags (booleans) moved here from CAlphaCPU.

X-1.8 Camiel Vanderhoeven 7-FEB-2007 Debugging functions are enabled only when compiling with -DIDB (Interactive Debugger, a future feature).

X-1.7 Camiel Vanderhoeven 3-FEB-2007 Fixed error in trace_dev. String is no longer interpreted by printf.

X-1.6 Camiel Vanderhoeven 3-FEB-2007 Printable function moved to StdAfx.h.

X-1.5 Brian Wheeler 3-FEB-2007 Formatting.

X-1.4 Brian Wheeler 3-FEB-2007 Add definition of _strdup for Linux' benefit.

X-1.3 Brian Wheeler 3-FEB-2007 Scanf and printf statements made compatible with Linux/GCC/glibc.

X-1.2 Brian Wheeler 3-FEB-2007 Includes are now case-correct (necessary on Linux)

X-1.1 Camiel Vanderhoeven 19-JAN-2007 Initial version in CVS.

Definition in file TraceEngine.cpp.

#include "StdAfx.h"
#include "TraceEngine.h"
#include "AlphaCPU.h"
#include "System.h"
#include "DPR.h"
#include "Flash.h"
#include "lockstep.h"
#include <signal.h>

Go to the source code of this file.

Data Structures

struct  sRegion

Functions

void write_printable_s (char *dest, const char *org)
 Convert a string to a new string that contains only printable characters.
u64 real_address (u64 address, CAlphaCPU *c, bool bIBOX)
 Get the physical address that matches a given virtual address.

Variables

CTraceEnginetrc
bool bTrace = false
bool bDisassemble = false
bool bHashing = false
bool bListing = false


Function Documentation

u64 real_address ( u64  address,
CAlphaCPU c,
bool  bIBOX 
) [inline]

Get the physical address that matches a given virtual address.

This never generates a CPU exception.

Definition at line 192 of file TraceEngine.cpp.

References ACCESS_READ, FAKE, NO_CHECK, U64, and CAlphaCPU::virt2phys().

Referenced by CTraceEngine::get_fnc_name(), CTraceEngine::trace(), CTraceEngine::trace_br(), and CTraceEngine::write_arglist().

void write_printable_s ( char *  dest,
const char *  org 
) [inline]

Convert a string to a new string that contains only printable characters.

The maximum length of the resulting string is 100 characters.

Parameters:
dest Destination string
org Source string

Definition at line 176 of file TraceEngine.cpp.

References printable().

Referenced by CTraceEngine::write_arglist().


Variable Documentation

bool bDisassemble = false

Definition at line 1635 of file TraceEngine.cpp.

Referenced by CAlphaCPU::listing(), and CTraceEngine::parse().

bool bHashing = false

Definition at line 1636 of file TraceEngine.cpp.

Referenced by CTraceEngine::parse().

bool bListing = false

Definition at line 1637 of file TraceEngine.cpp.

Referenced by CAlphaCPU::init(), CAlphaCPU::listing(), and CAlphaCPU::virt2phys().

bool bTrace = false

Definition at line 1634 of file TraceEngine.cpp.

Referenced by CTraceEngine::parse().

Definition at line 166 of file TraceEngine.cpp.

Referenced by main().


SourceForge.net Logo
Project space on SourceForge.net