From 0502658768df6c56c56f299ea86710cb7d711714 Mon Sep 17 00:00:00 2001 From: mike Date: Thu, 28 Jan 2016 18:23:12 -0800 Subject: [PATCH 01/14] Added comments for lineNumber targets --- include/hx/Debug.h | 2 ++ src/hx/Debug.cpp | 75 +++++++++++++++++++++++----------------------- 2 files changed, 40 insertions(+), 37 deletions(-) diff --git a/include/hx/Debug.h b/include/hx/Debug.h index 1a9e2bcc7..93753a65e 100644 --- a/include/hx/Debug.h +++ b/include/hx/Debug.h @@ -105,6 +105,7 @@ class StackFrame // The constructor automatically adds the StackFrame to the list of // stack frames for the current thread + //cs116 - modify to take column numbers inline StackFrame(const char *inClassName, const char *inFunctionName, #ifdef HXCPP_DEBUG_HASHES int inClassFunctionHash, @@ -157,6 +158,7 @@ class StackFrame // Current line number, changes during the lifetime of the stack frame. // Only updated if HXCPP_STACK_LINE is defined. + //cs116 - add coumn numbers (possibly first column number) int lineNumber; // These are only used if HXCPP_DEBUG_HASHES is defined diff --git a/src/hx/Debug.cpp b/src/hx/Debug.cpp index 9b250e478..7352fc353 100644 --- a/src/hx/Debug.cpp +++ b/src/hx/Debug.cpp @@ -121,7 +121,7 @@ static void setStaticHandler(Dynamic &inStore, Dynamic inValue) } // This is the thread number of the debugger thread, extracted from -// information about the thread that called +// information about the thread that called // __hxcpp_dbg_setEventNotificationHandler static unsigned int g_debugThreadNumber = -1; @@ -146,12 +146,12 @@ class Profiler : mT0(0) { mDumpFile = inDumpFile; - + // When a profiler exists, the profiler thread needs to exist gThreadMutex.Lock(); - + gThreadRefCount += 1; - + if (gThreadRefCount == 1) { #if defined(HX_WINDOWS) #ifndef HX_WINRT @@ -209,7 +209,7 @@ class Profiler results.reserve(mProfileStats.size()); int total = 0; - std::map::iterator iter = + std::map::iterator iter = mProfileStats.begin(); while (iter != mProfileStats.end()) { ProfileEntry &pe = iter->second; @@ -309,7 +309,7 @@ struct ProfileEntry return ((total > inRHS.total) || ((total == inRHS.total) && (self < inRHS.self))); } - + const char *fullName; int self; std::vector children; @@ -321,7 +321,7 @@ struct ProfileEntry { int millis = 1; - while (gThreadRefCount > 0) { + while (gThreadRefCount > 0) { #ifdef HX_WINDOWS #ifndef HX_WINRT Sleep(millis); @@ -408,7 +408,7 @@ class Telemetry // When a profiler exists, the profiler thread needs to exist gThreadMutex.Lock(); - + gThreadRefCount += 1; if (gThreadRefCount == 1) { #if defined(HX_WINDOWS) @@ -647,7 +647,7 @@ class Telemetry { int millis = 1; - while (gThreadRefCount > 0) { + while (gThreadRefCount > 0) { #ifdef HX_WINDOWS #ifndef HX_WINRT Sleep(millis); @@ -723,7 +723,7 @@ class CallStack static CallStack *GetCallerCallStack() { CallStack *stack = tlsCallStack; - + if (!stack) { int threadNumber = __hxcpp_GetCurrentThreadNumber(); @@ -741,7 +741,7 @@ class CallStack } static void RemoveCallStack(int threadNumber) -{ +{ gMutex.Lock(); CallStack *stack = gMap[threadNumber]; @@ -802,6 +802,7 @@ class CallStack #endif } + //cs116 - modify to set column number as well #ifdef HXCPP_STACK_LINE void SetLine(int inLine) { @@ -873,7 +874,7 @@ class CallStack CallStack *stack = CallStack::GetCallerCallStack(); int n = stack->mStackFrames.size() - (skipLast ? 1 : 0); - + for (int i = 0; i < n; i++) { // Reverse call stack to match exception stack @@ -928,7 +929,7 @@ class CallStack CallStack *stack = *stack_iter++; threadNumbers.push_back(stack->mThreadNumber); } - + gMutex.Unlock(); ::Array ret = Array_obj::__new(); @@ -967,7 +968,7 @@ class CallStack if (stack->mStackFrames.size() <= stackFrameNumber) { break; } - StackVariable *variable = + StackVariable *variable = stack->mStackFrames[stackFrameNumber]->variables; while (variable) { ret->push(String(variable->mHaxeName)); @@ -1017,7 +1018,7 @@ class CallStack if ((stackFrameNumber < 0) || (stackFrameNumber >= size)) { return markNonexistent; } - + const char *nameToFind = name.c_str(); StackVariable *sv = stack->mStackFrames[stackFrameNumber]->variables; @@ -1083,7 +1084,7 @@ class CallStack } sv = sv->mNext; } - + return markNonexistent; } @@ -1173,7 +1174,7 @@ class CallStack { CallStack *stack = GetCallerCallStack(); - std::vector::reverse_iterator iter = + std::vector::reverse_iterator iter = stack->mStackFrames.rbegin(); while (iter != stack->mStackFrames.rend()) { StackFrame *frame = *iter++; @@ -1254,7 +1255,7 @@ class CallStack CallStack *stack = hx::CallStack::GetCallerCallStack(); Telemetry *telemetry = stack->mTelemetry; if (telemetry) { - //printf("Telemetry %016lx allocating %s at %016lx of size %d\n", telemetry, type, obj, inSize); + //printf("Telemetry %016lx allocating %s at %016lx of size %d\n", telemetry, type, obj, inSize); telemetry->HXTAllocation(stack, obj, inSize, type); } } @@ -1324,7 +1325,7 @@ class CallStack { return mStackFrames[depth]->fullName; } - + // Wait for someone to call Continue() on this call stack. Really only // the thread that owns this call stack should call Wait(). @@ -1401,7 +1402,7 @@ class CallStack #define EXCEPTION_PRINT(...) \ printf(__VA_ARGS__) #endif - + int size = mExceptionStack.size(); for (int i = size - 1; i >= 0; i--) { @@ -1490,7 +1491,7 @@ class CallStack Dynamic ret = g_newStackFrameFunction (String(frame->fileName), String(frame->lineNumber), String(frame->className), String(frame->functionName)); - + // Don't do parameters for now // xxx figure them out later @@ -1557,9 +1558,9 @@ class Breakpoints gMutex.Lock(); int ret = gNextBreakpointNumber++; - + Breakpoints *newBreakpoints = new Breakpoints(gBreakpoints, ret, fileName, lineNumber); - + gBreakpoints->RemoveRef(); // Write memory barrier ensures that newBreakpoints values are updated @@ -1585,14 +1586,14 @@ class Breakpoints if (!className) { return -1; } - + gMutex.Lock(); int ret = gNextBreakpointNumber++; - + Breakpoints *newBreakpoints = new Breakpoints (gBreakpoints, ret, className, functionName); - + gBreakpoints->RemoveRef(); // Write memory barrier ensures that newBreakpoints values are updated @@ -1613,7 +1614,7 @@ class Breakpoints static void DeleteAll() { gMutex.Lock(); - + Breakpoints *newBreakpoints = new Breakpoints(); gBreakpoints->RemoveRef(); @@ -1634,7 +1635,7 @@ class Breakpoints static void Delete(int number) { gMutex.Lock(); - + if (gBreakpoints->HasBreakpoint(number)) { // Replace mBreakpoints with a copy and remove the breakpoint // from it @@ -1693,7 +1694,7 @@ class Breakpoints gStepThread = threadNumber; gStepType = stepType; gStepCount = stepCount; - + CallStack::StepOneThread(threadNumber, gStepLevel); } @@ -2064,7 +2065,7 @@ class Breakpoints /* static */ MyMutex Breakpoints::gMutex; /* static */ int Breakpoints::gNextBreakpointNumber; -/* static */ Breakpoints * volatile Breakpoints::gBreakpoints = +/* static */ Breakpoints * volatile Breakpoints::gBreakpoints = new Breakpoints(); /* static */ StepType Breakpoints::gStepType = STEP_NONE; /* static */ int Breakpoints::gStepLevel; @@ -2086,7 +2087,7 @@ void __hxcpp_dbg_setEventNotificationHandler(Dynamic handler) hx::g_eventNotificationHandler = handler; GCAddRoot(&(hx::g_eventNotificationHandler.mPtr)); } - + void __hxcpp_dbg_enableCurrentThreadDebugging(bool enable) { @@ -2098,7 +2099,7 @@ int __hxcpp_dbg_getCurrentThreadNumber() { return __hxcpp_GetCurrentThreadNumber(); } - + Array< ::String> __hxcpp_dbg_getFiles() { @@ -2212,7 +2213,7 @@ Dynamic __hxcpp_dbg_getStackVariableValue(int threadNumber, bool unsafe, Dynamic markNonexistent, Dynamic markThreadNotStopped) { - return hx::CallStack::GetVariableValue(threadNumber, stackFrameNumber, + return hx::CallStack::GetVariableValue(threadNumber, stackFrameNumber, name, unsafe, markNonexistent, markThreadNotStopped); } @@ -2296,7 +2297,7 @@ Dynamic __hxcpp_dbg_checkedThrow(Dynamic toThrow) #ifdef HX_WINRT //todo hx::CriticalErrorHandler(HX_CSTRING("Uncatchable Throw: " ), true); - + #else hx::CriticalErrorHandler(HX_CSTRING("Uncatchable Throw: " + toThrow->toString()), true); @@ -2330,7 +2331,7 @@ void hx::__hxcpp_register_stack_frame(hx::StackFrame *inFrame) hx::CallStack::PushCallerStackFrame(inFrame); } - + hx::StackFrame::~StackFrame() { hx::CallStack::PopCallerStackFrame(); @@ -2476,7 +2477,7 @@ int hx::Telemetry::ComputeCallStackId(hx::CallStack *stack) { int name_id = callstack.at(i++); //printf("Finding child with id=%d, asime now %#010x\n", name_id, asime); std::map::iterator lb = asime->children.lower_bound(name_id); - + if (lb != asime->children.end() && !(asime->children.key_comp()(name_id, lb->first))) { // key already exists asime = lb->second; @@ -2831,6 +2832,7 @@ void __hx_stack_set_last_exception() void __hxcpp_set_stack_frame_line(int inLine) { +//cs116 - modify to accept column numbers #ifdef HXCPP_STACK_LINE hx::CallStack::GetCallerCallStack()->SetLine(inLine); #endif @@ -2877,4 +2879,3 @@ void __hxcpp_set_debugger_info(const char **inAllClasses, const char **inFullPat __all_classes = inAllClasses; __all_files_fullpath = inFullPaths; } - From a48c3aa364a87c8775406f9c18c62173f2e08b3d Mon Sep 17 00:00:00 2001 From: mike Date: Mon, 1 Feb 2016 10:18:19 -0800 Subject: [PATCH 02/14] Added column functionality --- include/hx/Debug.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/hx/Debug.h b/include/hx/Debug.h index 93753a65e..f06df10f7 100644 --- a/include/hx/Debug.h +++ b/include/hx/Debug.h @@ -400,7 +400,7 @@ extern volatile bool gShouldCallHandleBreakpoints; #ifdef HXCPP_STACK_LINE // If the debugger is enabled, must check for a breakpoint at every line. #ifdef HXCPP_DEBUGGER -#define HX_STACK_LINE(number) \ +#define HX_STACK_LINE(number, column) \ __stackframe.lineNumber = number; \ /* This is incorrect - a read memory barrier is needed here. */ \ /* For now, just live with the exceedingly rare cases where */ \ @@ -409,7 +409,7 @@ extern volatile bool gShouldCallHandleBreakpoints; __hxcpp_on_line_changed(); \ } #else -#define HX_STACK_LINE(number) __stackframe.lineNumber = number; +#define HX_STACK_LINE(number, column) __stackframe.lineNumber = number; #endif // HXCPP_DEBUGGER #endif // HXCPP_STACK_LINE @@ -454,7 +454,7 @@ extern volatile bool gShouldCallHandleBreakpoints; #define HX_STACK_VAR(cpp_var, haxe_name) #endif #ifndef HX_STACK_LINE -#define HX_STACK_LINE(number) +#define HX_STACK_LINE(number, column) #endif #ifndef HX_STACK_CATCHABLE #define HX_STACK_CATCHABLE(T, n) From ad3f3c238ed2326a70ec35762bb5a2d51520c171 Mon Sep 17 00:00:00 2001 From: mike Date: Thu, 4 Feb 2016 11:52:09 -0800 Subject: [PATCH 03/14] Modified C functions to track column numbers --- include/hx/Debug.h | 8 +- src/hx/Debug.cpp | 11 +- src/hx/cppia/Cppia.cpp | 147 +++++++++--------- src/hx/cppia/Cppia.h | 7 +- src/hx/cppia/CppiaStream.h | 3 +- src/hx/cppia/sljit_src/sljitNativeTILEGX_64.c | 7 +- 6 files changed, 94 insertions(+), 89 deletions(-) diff --git a/include/hx/Debug.h b/include/hx/Debug.h index f06df10f7..b9f8c7310 100644 --- a/include/hx/Debug.h +++ b/include/hx/Debug.h @@ -55,7 +55,7 @@ void __hxcpp_execution_trace(int inLevel); // Used by debug breakpoints and execution trace HXCPP_EXTERN_CLASS_ATTRIBUTES -void __hxcpp_set_stack_frame_line(int); +void __hxcpp_set_stack_frame_line(int, int); HXCPP_EXTERN_CLASS_ATTRIBUTES void __hxcpp_on_line_changed(); @@ -155,11 +155,13 @@ class StackFrame const char *fullName; // this is className.functionName - used for profiler const char *fileName; int firstLineNumber; + int firstColumnNumber; // Current line number, changes during the lifetime of the stack frame. // Only updated if HXCPP_STACK_LINE is defined. //cs116 - add coumn numbers (possibly first column number) int lineNumber; + int columnNumber; // These are only used if HXCPP_DEBUG_HASHES is defined int fileHash; @@ -401,7 +403,7 @@ extern volatile bool gShouldCallHandleBreakpoints; // If the debugger is enabled, must check for a breakpoint at every line. #ifdef HXCPP_DEBUGGER #define HX_STACK_LINE(number, column) \ - __stackframe.lineNumber = number; \ + __stackframe.lineNumber = number; __stackframe.columnNumber = column; \ /* This is incorrect - a read memory barrier is needed here. */ \ /* For now, just live with the exceedingly rare cases where */ \ /* breakpoints are missed */ \ @@ -409,7 +411,7 @@ extern volatile bool gShouldCallHandleBreakpoints; __hxcpp_on_line_changed(); \ } #else -#define HX_STACK_LINE(number, column) __stackframe.lineNumber = number; +#define HX_STACK_LINE(number, column) __stackframe.lineNumber = number; __stackframe.columnNumber = column; #endif // HXCPP_DEBUGGER #endif // HXCPP_STACK_LINE diff --git a/src/hx/Debug.cpp b/src/hx/Debug.cpp index 7352fc353..a3c4e682c 100644 --- a/src/hx/Debug.cpp +++ b/src/hx/Debug.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include @@ -796,7 +797,7 @@ class CallStack { StackFrame *frame = mStackFrames[mStackFrames.size()-1]; #ifdef HXCPP_STACK_LINE - DBGLOG("%s::%s : %d\n", frame->className, frame->functionName, frame->lineNumber); + DBGLOG("%s::%s : %d.%d\n", frame->className, frame->functionName, frame->lineNumber, frame->columnNumber); #else DBGLOG("%s::%s\n", frame->className, frame->functionName); #endif @@ -804,9 +805,11 @@ class CallStack //cs116 - modify to set column number as well #ifdef HXCPP_STACK_LINE - void SetLine(int inLine) + void SetLine(int inLine, int inColumn) { + printf("Line: %d, Column: %d\n", inLine, inColumn); mStackFrames[mStackFrames.size()-1]->lineNumber = inLine; + mStackFrames[mStackFrames.size()-1]->columnNumber = inColumn; if (gShouldCallHandleBreakpoints) __hxcpp_on_line_changed(); } @@ -2830,11 +2833,11 @@ void __hx_stack_set_last_exception() #endif } -void __hxcpp_set_stack_frame_line(int inLine) +void __hxcpp_set_stack_frame_line(int inLine, int inColumn) { //cs116 - modify to accept column numbers #ifdef HXCPP_STACK_LINE - hx::CallStack::GetCallerCallStack()->SetLine(inLine); + hx::CallStack::GetCallerCallStack()->SetLine(inLine, inColumn); #endif } diff --git a/src/hx/cppia/Cppia.cpp b/src/hx/cppia/Cppia.cpp index c92ae61a3..46f45c015 100644 --- a/src/hx/cppia/Cppia.cpp +++ b/src/hx/cppia/Cppia.cpp @@ -260,7 +260,7 @@ struct CppiaDynamicExpr : public CppiaExpr compiler.move( inDest.offset(4), StarAddr(TempReg(),(4)) ); } break; - + default: genObject(compiler, inDest); } @@ -423,7 +423,7 @@ struct ScriptCallable : public CppiaDynamicExpr ExprType returnType; int argCount; int stackSize; - + std::vector args; std::vector hasDefault; std::vector initVals; @@ -576,7 +576,7 @@ struct ScriptCallable : public CppiaDynamicExpr } } } - + void genArgs(CppiaCompiler &compiler, CppiaExpr *inThis, Expressions &inArgs) { @@ -910,7 +910,7 @@ struct ScriptCallable : public CppiaDynamicExpr default: ctx->pushObject(0); } - + } } } @@ -958,7 +958,7 @@ struct ScriptCallable : public CppiaDynamicExpr } } - + bool pushDefault(CppiaCtx *ctx,int arg) { if (!hasDefault[arg]) @@ -1098,7 +1098,7 @@ void CppiaFunction::compile() class CppiaEnumBase : public EnumBase_obj { public: - CppiaClassInfo *classInfo; + CppiaClassInfo *classInfo; CppiaEnumBase(CppiaClassInfo *inInfo) : classInfo(inInfo) { } @@ -1117,7 +1117,7 @@ struct CppiaEnumConstructor int nameId; int typeId; }; - + std::vector args; CppiaClassInfo *classInfo; int nameId; @@ -1138,7 +1138,7 @@ struct CppiaEnumConstructor int typeId = inStream.getInt(); args.push_back( Arg(nameId,typeId) ); } - + } hx::Object *create( Array inArgs ) { @@ -1703,7 +1703,7 @@ struct CppiaClassInfo if (strcmp(f->name,"toString")) vtable.push_back( findInterfaceFunction(f->name) ); } - + } CppiaClassInfo *cls = cppia.types[inTypeId]->cppiaClass; @@ -1923,7 +1923,7 @@ struct CppiaClassInfo DBGLOG(" script member vars size = %d\n", extraData); - + for(int i=0;inameId)); @@ -1989,7 +1989,7 @@ struct CppiaClassInfo { TypeData *interface = cppia.types[id]; interfaceVTables[ interface->name.__s ] = vtable; - + CppiaClassInfo *cppiaInterface = interface->cppiaClass; if (!cppiaInterface) break; @@ -2151,7 +2151,7 @@ struct CppiaClassInfo nativeProperties.insert( var.name ); } } - + for(int i=0;ipointer; ctx->push( (hx::Object *) 0 ); // this AutoStack save(ctx,pointer); - + if (inPhase==0) { for(int i=0;i GetClassFields() { Array result = Array_obj::__new(); @@ -2530,7 +2530,7 @@ class CppiaClass : public hx::Class_obj Expressions none; return info->createInstance(CppiaCtx::getCurrent(),none,false); - } + } Dynamic ConstructArgs(hx::DynamicArray inArgs) { @@ -3241,7 +3241,7 @@ void convertResult(CppiaCompiler &compiler, const Addr &dest, ExprType destType, } compiler.move( dest, returnVal ); break; - + case etString: @@ -3263,7 +3263,7 @@ void convertResult(CppiaCompiler &compiler, const Addr &dest, ExprType destType, compiler.move32( dest,returnVal ); compiler.move( dest.offset(4),returnVal.offset(4) ); break; - + default: ; } } @@ -3354,7 +3354,7 @@ struct CallFunExpr : public CppiaExpr // AutoStack compiler.move(pointer, CtxMemberVal(offsetof(CppiaCtx,pointer) ) ); compiler.move(frame, CtxMemberVal(offsetof(CppiaCtx,frame) ) ); - + compiler.trace("gen args..."); // Push args function->genArgs(compiler,thisExpr,args); @@ -3827,7 +3827,7 @@ struct NewExpr : public CppiaDynamicExpr Array< Dynamic > argList = Array_obj::__new(n,n); for(int a=0;arunObject(ctx); - + return constructor(argList).mPtr; } else @@ -3838,7 +3838,7 @@ struct NewExpr : public CppiaDynamicExpr printf("Can't create non haxe type\n"); return 0; } - + }; template @@ -3880,7 +3880,7 @@ struct CallHaxe : public CppiaExpr { case sigInt: case sigFloat: case sigString: case sigObject: break; // Ok - case sigVoid: + case sigVoid: if (i==0) // return void ok break; // fallthough @@ -3982,7 +3982,7 @@ struct CallStatic : public CppiaExpr int classId; int fieldId; Expressions args; - + CallStatic(CppiaStream &stream) { classId = stream.getInt(); @@ -4024,7 +4024,7 @@ struct CallStatic : public CppiaExpr // TODO - optimise... if (!replace && type->name==HX_CSTRING("String") && field==HX_CSTRING("fromCharCode")) replace = new CallDynamicFunction(inModule, this, String::fromCharCode_dyn(), args ); - + //printf(" static call to %s::%s (%d)\n", type->name.__s, field.__s, type->cppiaClass!=0); if (replace) @@ -4046,7 +4046,7 @@ struct CallStatic : public CppiaExpr struct CallGetIndex : public CppiaIntExpr { CppiaExpr *thisExpr; - + CallGetIndex(CppiaExpr *inSrc, CppiaExpr *inThis) : CppiaIntExpr(inSrc) { thisExpr = inThis; @@ -4073,7 +4073,7 @@ struct CallSetField : public CppiaDynamicExpr CppiaExpr *nameExpr; CppiaExpr *valueExpr; CppiaExpr *isPropExpr; - + CallSetField(CppiaExpr *inSrc, CppiaExpr *inThis, CppiaExpr *inName, CppiaExpr *inValue, CppiaExpr *inProp) : CppiaDynamicExpr(inSrc) { @@ -4109,7 +4109,7 @@ struct CallGetField : public CppiaDynamicExpr CppiaExpr *thisExpr; CppiaExpr *nameExpr; CppiaExpr *isPropExpr; - + CallGetField(CppiaExpr *inSrc, CppiaExpr *inThis, CppiaExpr *inName, CppiaExpr *inProp) : CppiaDynamicExpr(inSrc) { thisExpr = inThis; @@ -4183,23 +4183,23 @@ struct CallMemberVTable : public CppiaExpr int runInt(CppiaCtx *ctx) { CALL_VTABLE_SETUP - return runContextConvertInt(ctx, returnType, vtable[slot]); + return runContextConvertInt(ctx, returnType, vtable[slot]); } - + Float runFloat(CppiaCtx *ctx) { CALL_VTABLE_SETUP - return runContextConvertFloat(ctx, returnType, vtable[slot]); + return runContextConvertFloat(ctx, returnType, vtable[slot]); } String runString(CppiaCtx *ctx) { CALL_VTABLE_SETUP - return runContextConvertString(ctx, returnType, vtable[slot]); + return runContextConvertString(ctx, returnType, vtable[slot]); } hx::Object *runObject(CppiaCtx *ctx) { CALL_VTABLE_SETUP - return runContextConvertObject(ctx, returnType, vtable[slot]); + return runContextConvertObject(ctx, returnType, vtable[slot]); } @@ -4250,7 +4250,7 @@ struct CallGlobal : public CppiaExpr { int fieldId; Expressions args; - + CallGlobal(CppiaStream &stream) { fieldId = stream.getInt(); @@ -4320,7 +4320,7 @@ struct FieldByName : public CppiaDynamicExpr CrementOp crement; hx::Class staticClass; - + FieldByName(CppiaExpr *inSrc, CppiaExpr *inObject, hx::Class inStaticClass, String inName, AssignOp inAssign, CrementOp inCrement, CppiaExpr *inValue) : CppiaDynamicExpr(inSrc) @@ -4417,7 +4417,7 @@ struct GetFieldByName : public CppiaDynamicExpr bool isInterface; bool isStatic; hx::Class staticClass; - + GetFieldByName(CppiaStream &stream,bool isThisObject,bool inIsStatic=false) { classId = stream.getInt(); @@ -4515,7 +4515,7 @@ struct GetFieldByName : public CppiaDynamicExpr { //if (isInterface) // instance = instance->__GetRealObject(); - + ScriptCallable **vtable = (ScriptCallable **)instance->__GetScriptVTable(); ScriptCallable *func = vtable[vtableSlot]; if (func==0) @@ -4527,7 +4527,7 @@ struct GetFieldByName : public CppiaDynamicExpr } return instance->__Field(name,HX_PROP_DYNAMIC).mPtr; } - + CppiaExpr *makeSetter(AssignOp inOp,CppiaExpr *inValue) { // delete this - remove markable? @@ -4560,7 +4560,7 @@ struct Call : public CppiaDynamicExpr { Expressions args; CppiaExpr *func; - + Call(CppiaStream &stream) { int argCount = stream.getInt(); @@ -4676,7 +4676,7 @@ struct Call : public CppiaDynamicExpr CtxMemberVal pointer(offsetof(CppiaCtx,pointer)); compiler.move(pointerSave, pointer); - + // TODO - shortcut for script->script @@ -4719,7 +4719,7 @@ struct CallMember : public CppiaExpr CppiaExpr *thisExpr; Expressions args; bool callSuperField; - + CallMember(CppiaStream &stream,MemberCallType inCall) { classId = stream.getInt(); @@ -4779,7 +4779,7 @@ struct CallMember : public CppiaExpr //printf(" linking call %s::%s\n", type->name.__s, field.__s); CppiaExpr *replace = 0; - + if (type->arrayType) { replace = createArrayBuiltin(this, type->arrayType, thisExpr, field, args); @@ -4885,7 +4885,7 @@ struct CallMember : public CppiaExpr -template +template struct MemReference : public CppiaExpr { int offset; @@ -4917,7 +4917,7 @@ struct MemReference : public CppiaExpr offset = 0; pointer = inPointer; } - + ExprType getType() { return (ExprType) ExprTypeOf::value; @@ -4929,7 +4929,7 @@ struct MemReference : public CppiaExpr object = object->link(inModule); if (REFMODE==locAbsolute) // Only for string/object? inModule.markable.push_back(this); - + return this; } @@ -5001,7 +5001,7 @@ CppiaExpr *createStaticAccess(CppiaExpr *inSrc,FieldStorage inType, void *inPtr) -template +template struct MemReferenceSetter : public CppiaExpr { int offset; @@ -5073,7 +5073,7 @@ struct MemReferenceSetter : public CppiaExpr }; -template +template CppiaExpr *MemReference::makeSetter(AssignOp op,CppiaExpr *value) { switch(op) @@ -5110,7 +5110,7 @@ CppiaExpr *MemReference::makeSetter(AssignOp op,CppiaExpr *value) -template +template struct MemReferenceCrement : public CppiaExpr { int offset; @@ -5176,7 +5176,7 @@ struct MemReferenceCrement : public CppiaExpr -template +template CppiaExpr *MemReference::makeCrement(CrementOp inOp) { switch(inOp) @@ -5204,7 +5204,7 @@ struct MemStackFloatSetter : public CppiaExpr AssignOp op; MemStackFloatSetter(const CppiaExpr *inSrc, int inOffset, AssignOp inOp, CppiaExpr *inValue) - : CppiaExpr(inSrc), offset(inOffset), op(inOp), value(inValue){ } + : CppiaExpr(inSrc), offset(inOffset), op(inOp), value(inValue){ } ExprType getType() { return etFloat; } inline Float doRun(CppiaCtx *ctx) @@ -5243,7 +5243,7 @@ struct MemStackFloatCrement : public CppiaExpr CrementOp op; MemStackFloatCrement(const CppiaExpr *inSrc, int inOffset, CrementOp inOp) - : CppiaExpr(inSrc), offset(inOffset), op(inOp) { } + : CppiaExpr(inSrc), offset(inOffset), op(inOp) { } ExprType getType() { return etFloat; } inline Float doRun(CppiaCtx *ctx) @@ -5308,7 +5308,7 @@ struct GetFieldByLinkage : public CppiaExpr int fieldId; int typeId; CppiaExpr *object; - + GetFieldByLinkage(CppiaStream &stream,bool inThisObject) { typeId = stream.getInt(); @@ -5518,6 +5518,7 @@ struct PosInfo : public CppiaExprWithValue { int fileId; int line; + int column; int classId; int methodId; @@ -5609,7 +5610,7 @@ struct ArrayDef : public CppiaDynamicExpr switch(arrayType) { case arrBool: - { + { Array result = Array_obj::__new(n,n); for(int i=0;i result = Array_obj::__new(n,n); for(int i=0;i result = Array_obj::__new(n,n); for(int i=0;i result = Array_obj::__new(n,n); for(int i=0;i result = Array_obj::__new(n,n); for(int i=0;i result = Array_obj::__new(n,n); for(int i=0;i void run(CppiaCtx *ctx,T &outValue) { @@ -6152,7 +6153,7 @@ struct TVars : public CppiaVoidExpr LinkExpressions(vars,inModule); return this; } - + void runVoid(CppiaCtx *ctx) { CppiaExpr **v = &vars[0]; @@ -6168,7 +6169,7 @@ struct ForExpr : public CppiaVoidExpr CppiaExpr *init; CppiaExpr *loop; - + ForExpr(CppiaStream &stream) { var.fromStream(stream); @@ -6219,7 +6220,7 @@ struct WhileExpr : public CppiaVoidExpr CppiaExpr *condition; CppiaExpr *loop; - + WhileExpr(CppiaStream &stream) { isWhileDo = stream.getInt(); @@ -6273,7 +6274,7 @@ struct SwitchExpr : public CppiaExpr std::vector cases; CppiaExpr *defaultCase; - + SwitchExpr(CppiaStream &stream) { caseCount = stream.getInt(); @@ -6398,7 +6399,7 @@ struct TryExpr : public CppiaVoidExpr CppiaExpr *body; std::vector catches; - + TryExpr(CppiaStream &stream) { catchCount = stream.getInt(); @@ -6938,7 +6939,7 @@ struct SpecialAdd : public CppiaExpr BCR_CHECK; return (lval + Dynamic(right->runObject(ctx))).mPtr; } - + return Dynamic(runString(ctx)).mPtr; } int runInt(CppiaCtx *ctx) @@ -6949,7 +6950,7 @@ struct SpecialAdd : public CppiaExpr BCR_CHECK; return (lval + Dynamic(right->runObject(ctx)))->__ToInt(); } - + left->runVoid(ctx); BCR_CHECK; right->runVoid(ctx); @@ -6963,7 +6964,7 @@ struct SpecialAdd : public CppiaExpr BCR_CHECK; return (lval + Dynamic(right->runObject(ctx)))->__ToDouble(); } - + left->runVoid(ctx); BCR_CHECK; right->runVoid(ctx); @@ -7153,7 +7154,7 @@ struct EnumField : public CppiaDynamicExpr #endif }; -struct CrementExpr : public CppiaExpr +struct CrementExpr : public CppiaExpr { CrementOp op; CppiaExpr *lvalue; @@ -7180,7 +7181,7 @@ struct CrementExpr : public CppiaExpr } }; -struct OpCompareBase : public CppiaBoolExpr +struct OpCompareBase : public CppiaBoolExpr { enum CompareType { compFloat, compInt, compString, compDynamic }; @@ -7226,7 +7227,7 @@ struct OpCompareBase : public CppiaBoolExpr }; template -struct OpCompare : public OpCompareBase +struct OpCompare : public OpCompareBase { COMPARE compare; @@ -7646,7 +7647,7 @@ void CppiaModule::link() { DBGLOG("Resolve registered - super\n"); HaxeNativeClass::link(); - + DBGLOG("Resolve typeIds\n"); for(int t=0;tlink(*this); @@ -7759,7 +7760,7 @@ bool LoadCppia(String inValue) { CppiaModule *cppiaPtr = new CppiaModule(); hx::Object **ptrPtr = new hx::Object*[1]; - *ptrPtr = new CppiaObject(cppiaPtr); + *ptrPtr = new CppiaObject(cppiaPtr); GCAddRoot(ptrPtr); @@ -7826,7 +7827,7 @@ bool LoadCppia(String inValue) tok = stream.getToken(); if (tok!="RESO") throw "no reso tag"; - + scriptResources[r].mName = cppia.strings[stream.getInt()]; scriptResources[r].mDataLength = stream.getInt(); } @@ -7845,7 +7846,7 @@ bool LoadCppia(String inValue) scriptResources[count].mDataLength = 0; scriptResources[count].mData = 0; scriptResources[count].mName = String(); - + RegisterResources(&scriptResources[0]); } else @@ -7984,5 +7985,3 @@ void __scriptable_load_cppia(String inCode) { hx::LoadCppia(inCode); } - - diff --git a/src/hx/cppia/Cppia.h b/src/hx/cppia/Cppia.h index 4f7df21d3..060e8ab86 100644 --- a/src/hx/cppia/Cppia.h +++ b/src/hx/cppia/Cppia.h @@ -100,6 +100,7 @@ enum VarLocation struct CppiaExpr { int line; + int column; const char *filename; const char *className; const char *functionName; @@ -323,7 +324,7 @@ struct CppiaVar Float floatVal; String stringVal; void *valPointer; - + CppiaVar(bool inIsStatic); CppiaVar(CppiaFunction *inDynamicFunction); @@ -411,7 +412,7 @@ class HaxeNativeInterface #ifdef HXCPP_STACK_LINE #define CPPIA_STACK_LINE(expr) \ - __hxcpp_set_stack_frame_line(expr->line); + __hxcpp_set_stack_frame_line(expr->line, expr->column); #else #define CPPIA_STACK_LINE(expr) #endif @@ -609,7 +610,7 @@ struct CrementPostDec inVal = Dynamic(Dynamic(inVal) + 1).mPtr; return result; } - + }; diff --git a/src/hx/cppia/CppiaStream.h b/src/hx/cppia/CppiaStream.h index 44336630f..d9993a73a 100644 --- a/src/hx/cppia/CppiaStream.h +++ b/src/hx/cppia/CppiaStream.h @@ -13,6 +13,7 @@ struct CppiaStream const char *data; const char *max; int line; + int column; int pos; CppiaStream(class CppiaModule *inModule,const char *inData, int inLen) @@ -197,5 +198,3 @@ struct CppiaStream }; } // end namespace hx - - diff --git a/src/hx/cppia/sljit_src/sljitNativeTILEGX_64.c b/src/hx/cppia/sljit_src/sljitNativeTILEGX_64.c index 1d6aa5a11..74f4a295e 100644 --- a/src/hx/cppia/sljit_src/sljitNativeTILEGX_64.c +++ b/src/hx/cppia/sljit_src/sljitNativeTILEGX_64.c @@ -120,12 +120,13 @@ SLJIT_API_FUNC_ATTRIBUTE SLJIT_CONST char *sljit_get_platform_name(void) typedef sljit_uw sljit_ins; struct jit_instr { - const struct tilegx_opcode* opcode; + const struct tilegx_opcode* opcode; tilegx_pipeline pipe; unsigned long input_registers; unsigned long output_registers; int operand_value[4]; int line; + int column; }; /* Opcode Helper Macros */ @@ -896,7 +897,7 @@ static sljit_si push_jr_buffer(struct sljit_compiler *compiler, tilegx_mnemonic inst_buf[inst_buf_index].output_registers = 0; inst_buf[inst_buf_index].line = line; inst_buf_index++; - + return flush_buffer(compiler); } @@ -1811,7 +1812,7 @@ static SLJIT_INLINE sljit_si emit_single_op(struct sljit_compiler *compiler, slj else { /* Rare ocasion. */ FAIL_IF(ADD(TMP_EREG2, reg_map[src1], ZERO)); - + overflow_ra = TMP_EREG2; } } From 0c68c0a80fa56e97545ee9bbde69f288717b8076 Mon Sep 17 00:00:00 2001 From: mike Date: Sat, 6 Feb 2016 01:54:44 -0800 Subject: [PATCH 04/14] More column stuff --- include/hx/Debug.h | 2 +- src/hx/Debug.cpp | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/include/hx/Debug.h b/include/hx/Debug.h index b9f8c7310..09ebd69ec 100644 --- a/include/hx/Debug.h +++ b/include/hx/Debug.h @@ -491,7 +491,7 @@ Array< ::String> __hxcpp_dbg_getFilesFullPath(); Array< ::String> __hxcpp_dbg_getClasses(); Array __hxcpp_dbg_getThreadInfos(); Dynamic __hxcpp_dbg_getThreadInfo(int threadNumber, bool unsafe); -int __hxcpp_dbg_addFileLineBreakpoint(String fileName, int lineNumber); +int __hxcpp_dbg_addFileLineBreakpoint(String fileName, int lineNumber, int columnNumber); int __hxcpp_dbg_addClassFunctionBreakpoint(String className, String functionName); void __hxcpp_dbg_deleteAllBreakpoints(); diff --git a/src/hx/Debug.cpp b/src/hx/Debug.cpp index a3c4e682c..7e99592f2 100644 --- a/src/hx/Debug.cpp +++ b/src/hx/Debug.cpp @@ -854,7 +854,7 @@ class CallStack gMutex.Unlock(); } - + //cs116 static void StepOneThread(int threadNumber, int &stackLevel) { gMutex.Lock(); @@ -1549,7 +1549,7 @@ class Breakpoints } #endif - static int Add(String inFileName, int lineNumber) + static int Add(String inFileName, int lineNumber, int columnNumber) { // Look up the filename constant const char *fileName = LookupFileName(inFileName); @@ -1562,7 +1562,7 @@ class Breakpoints int ret = gNextBreakpointNumber++; - Breakpoints *newBreakpoints = new Breakpoints(gBreakpoints, ret, fileName, lineNumber); + Breakpoints *newBreakpoints = new Breakpoints(gBreakpoints, ret, fileName, lineNumber, columnNumber); gBreakpoints->RemoveRef(); @@ -1839,6 +1839,7 @@ class Breakpoints { int number; int lineNumber; + int columnNumber; int hash; bool isFileLine; @@ -1858,7 +1859,7 @@ class Breakpoints // Copies breakpoints from toCopy and adds a new file:line breakpoint Breakpoints(const Breakpoints *toCopy, int number, - const char *fileName, int lineNumber) + const char *fileName, int lineNumber, int columnNumber) : mRefCount(1) { mBreakpointCount = toCopy->mBreakpointCount + 1; @@ -1870,6 +1871,7 @@ class Breakpoints mBreakpoints[toCopy->mBreakpointCount].isFileLine = true; mBreakpoints[toCopy->mBreakpointCount].fileOrClassName = fileName; mBreakpoints[toCopy->mBreakpointCount].lineNumber = lineNumber; + mBreakpoints[toCopy->mBreakpointCount].columnNumber = columnNumber; #ifdef HXCPP_DEBUG_HASHES mBreakpoints[toCopy->mBreakpointCount].hash = Hash(0, fileName); @@ -2156,9 +2158,9 @@ Dynamic __hxcpp_dbg_getThreadInfo(int threadNumber, bool unsafe) } -int __hxcpp_dbg_addFileLineBreakpoint(String fileName, int lineNumber) +int __hxcpp_dbg_addFileLineBreakpoint(String fileName, int lineNumber, int columnNumber) { - return hx::Breakpoints::Add(fileName, lineNumber); + return hx::Breakpoints::Add(fileName, lineNumber, columnNumber); } From 6aba1c971329e795ff1ce452c9811fec13616d8f Mon Sep 17 00:00:00 2001 From: mike Date: Sat, 6 Feb 2016 16:49:49 -0800 Subject: [PATCH 05/14] Added columnNumber conditional to FindFileLineBreakpoint() --- src/hx/Debug.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hx/Debug.cpp b/src/hx/Debug.cpp index 7e99592f2..4383b2e4f 100644 --- a/src/hx/Debug.cpp +++ b/src/hx/Debug.cpp @@ -1997,13 +1997,15 @@ class Breakpoints return false; } + //CS116 - We added columnNumber conditional. int FindFileLineBreakpoint(StackFrame *inFrame) { + printf("FindFileLineBreakpoint(), inFrame.columnNumber = %d\n", inFrame->columnNumber); for (int i = 0; i < mBreakpointCount; i++) { Breakpoint &breakpoint = mBreakpoints[i]; if (breakpoint.isFileLine && breakpoint.hash==inFrame->fileHash && - (breakpoint.lineNumber == inFrame->lineNumber) && + (breakpoint.lineNumber == inFrame->lineNumber) && (breakpoint.columnNumber == inFrame->columnNumber) && !strcmp(breakpoint.fileOrClassName.c_str(),inFrame->fileName) ) return breakpoint.number; } From b5bf06fa736de9f8adacd07ebad34ea6616594ec Mon Sep 17 00:00:00 2001 From: mike Date: Mon, 8 Feb 2016 11:24:06 -0800 Subject: [PATCH 06/14] Added column number print capability - Gave HX_STACK_FRAME macro column number --- include/hx/Debug.h | 18 +++++++++--------- src/hx/Debug.cpp | 11 +++++++---- src/hx/Lib.cpp | 23 +++++++++++------------ src/hx/gc/Immix.cpp | 33 ++++++++++++++++----------------- 4 files changed, 43 insertions(+), 42 deletions(-) diff --git a/include/hx/Debug.h b/include/hx/Debug.h index 09ebd69ec..8829dd911 100644 --- a/include/hx/Debug.h +++ b/include/hx/Debug.h @@ -112,7 +112,7 @@ class StackFrame #endif const char *inFullName, const char *inFileName #ifdef HXCPP_STACK_LINE - , int inLineNumber + , int inLineNumber, int inColumnNumber #endif #ifdef HXCPP_DEBUG_HASHES , int inFileHash @@ -351,19 +351,19 @@ extern volatile bool gShouldCallHandleBreakpoints; #ifdef HXCPP_DEBUG_HASHES #define HX_STACK_FRAME(className, functionName, classFunctionHash, fullName,fileName, \ - lineNumber, fileHash ) \ + lineNumber, columnNumber, fileHash ) \ hx::StackFrame __stackframe(className, functionName, classFunctionHash, fullName, \ - fileName, lineNumber, fileHash); + fileName, lineNumber, columnNumber, fileHash); #else #define HX_STACK_FRAME(className, functionName, classFunctionHash, fullName,fileName, \ - lineNumber, fileHash ) \ + lineNumber, columnNumber, fileHash ) \ hx::StackFrame __stackframe(className, functionName, fullName, \ - fileName, lineNumber); + fileName, lineNumber, columnNumber); #endif #else #define HX_STACK_FRAME(className, functionName, classFunctionHash, fullName,fileName, \ - lineNumber, fileHash ) \ + lineNumber, columnNumber, fileHash ) \ hx::StackFrame __stackframe(className, functionName, fullName, fileName); #endif @@ -444,7 +444,7 @@ extern volatile bool gShouldCallHandleBreakpoints; // Define any macros not defined already above #ifndef HX_STACK_FRAME -#define HX_STACK_FRAME(className, functionName, classFuncHash, fullName, fileName, lineNumber, fileHash ) +#define HX_STACK_FRAME(className, functionName, classFuncHash, fullName, fileName, lineNumber, columnNumber, fileHash ) #endif #ifndef HX_STACK_THIS #define HX_STACK_THIS(ptr) @@ -475,8 +475,8 @@ extern volatile bool gShouldCallHandleBreakpoints; // use debugging, you really should upgrade to a newer haxe compiler. #undef HX_STACK_PUSH -#define HX_STACK_PUSH(fullName, fileName, lineNumber) \ - HX_STACK_FRAME("", fullName, 0, fullName, fileName, lineNumber, 0) +#define HX_STACK_PUSH(fullName, fileName, lineNumber, columnNumber) \ + HX_STACK_FRAME("", fullName, 0, fullName, fileName, lineNumber, columnNumber, 0) #ifdef HXCPP_DEBUGGER diff --git a/src/hx/Debug.cpp b/src/hx/Debug.cpp index 4383b2e4f..2fd8b1fcc 100644 --- a/src/hx/Debug.cpp +++ b/src/hx/Debug.cpp @@ -1440,12 +1440,13 @@ class CallStack mCanStop = false; // Call the handler to announce the status. + //CS116 - Added column number to status int stackFrame = mStackFrames.size() - 1; StackFrame *frame = mStackFrames[stackFrame]; g_eventNotificationHandler (mThreadNumber, THREAD_STOPPED, stackFrame, String(frame->className), String(frame->functionName), - String(frame->fileName), frame->lineNumber); + String(frame->fileName), frame->lineNumber, frame->columnNumber); // Wait until the debugger thread sets mWaiting to false and signals // the semaphore @@ -1785,7 +1786,7 @@ class Breakpoints { // Check for class:function breakpoint if this is the // first line of the stack frame - if (frame->lineNumber == frame->firstLineNumber) + if ((frame->lineNumber == frame->firstLineNumber)) breakpointNumber = breakpoints->FindClassFunctionBreakpoint(frame); } @@ -2000,14 +2001,16 @@ class Breakpoints //CS116 - We added columnNumber conditional. int FindFileLineBreakpoint(StackFrame *inFrame) { - printf("FindFileLineBreakpoint(), inFrame.columnNumber = %d\n", inFrame->columnNumber); + //printf("FindFileLineBreakpoint(), inFrame.columnNumber = %d\n", inFrame->columnNumber); for (int i = 0; i < mBreakpointCount; i++) { Breakpoint &breakpoint = mBreakpoints[i]; if (breakpoint.isFileLine && breakpoint.hash==inFrame->fileHash && (breakpoint.lineNumber == inFrame->lineNumber) && (breakpoint.columnNumber == inFrame->columnNumber) && - !strcmp(breakpoint.fileOrClassName.c_str(),inFrame->fileName) ) + !strcmp(breakpoint.fileOrClassName.c_str(),inFrame->fileName) ) { + printf("Breakpoint reached at %s:%d:%d\n", inFrame->fileName, inFrame->lineNumber, inFrame->columnNumber); return breakpoint.number; + } } return -1; } diff --git a/src/hx/Lib.cpp b/src/hx/Lib.cpp index 9875ffbd7..d774fea72 100644 --- a/src/hx/Lib.cpp +++ b/src/hx/Lib.cpp @@ -71,7 +71,7 @@ Module hxLoadLibrary(String inLib) #else flags |= RTLD_NOW; #endif - + Module result = dlopen(inLib.__CStr(), flags); if (gLoadDebug) { @@ -113,7 +113,7 @@ typedef hx::Object * (*prim_4)(hx::Object *,hx::Object *,hx::Object *,hx::Object typedef hx::Object * (*prim_5)(hx::Object *,hx::Object *,hx::Object *,hx::Object *,hx::Object *); typedef hx::Object * (*prim_mult)(hx::Object **inArray,int inArgs); -typedef void *(*FundFunc)(); +typedef void *(*FundFunc)(); extern const char* EXTERN_CLASS_NAME; @@ -131,42 +131,42 @@ class ExternalPrimitive : public hx::Object Dynamic __run() { - HX_STACK_FRAME(EXTERN_CLASS_NAME, "cffi",0, functionName, __FILE__, __LINE__,0); + HX_STACK_FRAME(EXTERN_CLASS_NAME, "cffi",0, functionName, __FILE__, __LINE__, 5,0); if (mArgCount!=0) throw HX_INVALID_ARG_COUNT; if (mProc==0) hx::Throw( HX_NULL_FUNCTION_POINTER ); return ((prim_0)mProc)(); } Dynamic __run(D a) { - HX_STACK_FRAME(EXTERN_CLASS_NAME, "cffi",0, functionName, __FILE__, __LINE__,0); + HX_STACK_FRAME(EXTERN_CLASS_NAME, "cffi",0, functionName, __FILE__, __LINE__, 5, 0); if (mArgCount!=1) throw HX_INVALID_ARG_COUNT; if (mProc==0) hx::Throw( HX_NULL_FUNCTION_POINTER ); return ((prim_1)mProc)(a.GetPtr()); } Dynamic __run(D a,D b) { - HX_STACK_FRAME(EXTERN_CLASS_NAME, "cffi",0, functionName, __FILE__, __LINE__,0); + HX_STACK_FRAME(EXTERN_CLASS_NAME, "cffi",0, functionName, __FILE__, __LINE__, 5, 0); if (mArgCount!=2) throw HX_INVALID_ARG_COUNT; if (mProc==0) hx::Throw( HX_NULL_FUNCTION_POINTER ); return ((prim_2)mProc)(a.GetPtr(),b.GetPtr()); } Dynamic __run(D a,D b,D c) { - HX_STACK_FRAME(EXTERN_CLASS_NAME, "cffi",0, functionName, __FILE__, __LINE__,0); + HX_STACK_FRAME(EXTERN_CLASS_NAME, "cffi",0, functionName, __FILE__, __LINE__, 5, 0); if (mArgCount!=3) throw HX_INVALID_ARG_COUNT; if (mProc==0) hx::Throw( HX_NULL_FUNCTION_POINTER ); return ((prim_3)mProc)(a.GetPtr(),b.GetPtr(),c.GetPtr()); } Dynamic __run(D a,D b,D c,D d) { - HX_STACK_FRAME(EXTERN_CLASS_NAME, "cffi",0, functionName, __FILE__, __LINE__,0); + HX_STACK_FRAME(EXTERN_CLASS_NAME, "cffi",0, functionName, __FILE__, __LINE__, 5, 0); if (mArgCount!=4) throw HX_INVALID_ARG_COUNT; if (mProc==0) hx::Throw( HX_NULL_FUNCTION_POINTER ); return ((prim_4)mProc)(a.GetPtr(),b.GetPtr(),c.GetPtr(),d.GetPtr()); } Dynamic __run(D a,D b,D c,D d,D e) { - HX_STACK_FRAME(EXTERN_CLASS_NAME, "cffi",0, functionName, __FILE__, __LINE__,0); + HX_STACK_FRAME(EXTERN_CLASS_NAME, "cffi",0, functionName, __FILE__, __LINE__, 5, 0); if (mArgCount!=5) throw HX_INVALID_ARG_COUNT; if (mProc==0) hx::Throw( HX_NULL_FUNCTION_POINTER ); return ((prim_5)mProc)(a.GetPtr(),b.GetPtr(),c.GetPtr(),d.GetPtr(),e.GetPtr()); @@ -174,7 +174,7 @@ class ExternalPrimitive : public hx::Object Dynamic __Run(const Array &inArgs) { - HX_STACK_FRAME(EXTERN_CLASS_NAME, "cffi",0, functionName, __FILE__, __LINE__,0); + HX_STACK_FRAME(EXTERN_CLASS_NAME, "cffi",0, functionName, __FILE__, __LINE__, 5, 0); if (mArgCount!=-1 && mArgCount!=inArgs->length) throw HX_INVALID_ARG_COUNT; if (mProc==0) hx::Throw( HX_NULL_FUNCTION_POINTER ); @@ -502,7 +502,7 @@ void *__hxcpp_get_proc_address(String inLib, String full_name,bool inNdllProc,bo #endif #if defined(HX_WINRT) && defined(HXCPP_DEBUG_LINK) - gLoadDebug = true; + gLoadDebug = true; #elif defined(IPHONE) || defined(APPLETV) gLoadDebug = true; setenv("DYLD_PRINT_APIS","1",true); @@ -514,7 +514,7 @@ void *__hxcpp_get_proc_address(String inLib, String full_name,bool inNdllProc,bo if (!sgLibPathIsInit) { sgLibPathIsInit = true; - #ifndef HX_WINRT + #ifndef HX_WINRT sgLibPath.push_back("./"); #endif #ifdef HX_MACOS @@ -754,4 +754,3 @@ int __hxcpp_register_prim(const char *inName,void *inProc) proc = inProc; return 0; } - diff --git a/src/hx/gc/Immix.cpp b/src/hx/gc/Immix.cpp index 89229ac0c..0733cf631 100644 --- a/src/hx/gc/Immix.cpp +++ b/src/hx/gc/Immix.cpp @@ -377,7 +377,7 @@ union BlockData // First 2 bytes are not needed for row markers (first 2 rows are for flags) unsigned short mId; - // First 2 rows contain a byte-flag-per-row + // First 2 rows contain a byte-flag-per-row unsigned char mRowMarked[IMMIX_LINES]; // Row data as union - don't use first 2 rows unsigned char mRow[IMMIX_LINES][IMMIX_LINE_LEN]; @@ -407,7 +407,7 @@ static BlockDataStats sThreadBlockDataStats[MAX_MARK_THREADS]; #ifdef HXCPP_VISIT_ALLOCS static hx::VisitContext *sThreadVisitContext = 0; #endif - + namespace hx { void MarkerReleaseWorkerLocked(); } @@ -434,7 +434,7 @@ struct GroupInfo int free; int used; }; - + hx::QuickVec gAllocGroups; @@ -502,7 +502,7 @@ struct BlockDataInfo mUsedRows = 0; mPinned = false; ZERO_MEM(allocStart,sizeof(int)*IMMIX_LINES); - ZERO_MEM(mPtr->mRowMarked+IMMIX_HEADER_LINES, IMMIX_USEFUL_LINES); + ZERO_MEM(mPtr->mRowMarked+IMMIX_HEADER_LINES, IMMIX_USEFUL_LINES); mRanges[0].start = IMMIX_HEADER_LINES << IMMIX_LINE_BITS; mRanges[0].length = IMMIX_USEFUL_LINES << IMMIX_LINE_BITS; mMaxHoleSize = mRanges[0].length; @@ -515,7 +515,7 @@ struct BlockDataInfo void makeFull() { mUsedRows = IMMIX_USEFUL_LINES; - memset(mPtr->mRowMarked+IMMIX_HEADER_LINES, 1,IMMIX_USEFUL_LINES); + memset(mPtr->mRowMarked+IMMIX_HEADER_LINES, 1,IMMIX_USEFUL_LINES); mRanges[0].start = 0; mRanges[0].length = 0; mMaxHoleSize = mRanges[0].length; @@ -1338,7 +1338,7 @@ void MarkObjectAllocUnchecked(hx::Object *inPtr,hx::MarkContext *__inCtx) __inCtx->Trace(); } #endif - + #ifdef HXCPP_DEBUG // Recursive mark so stack stays intact.. if (gCollectTrace) @@ -1350,7 +1350,7 @@ void MarkObjectAllocUnchecked(hx::Object *inPtr,hx::MarkContext *__inCtx) // run the risk of stack overflow. Also, a parallel mark algorithm could be // done when the marking is stack based. //inPtr->__Mark(__inCtx); - + #if (HXCPP_GC_DEBUG_LEVEL>0) inPtr->__Mark(__inCtx); #else @@ -2054,7 +2054,7 @@ class GlobalAllocator if (inSize<<1 > mLargeAllocSpace) mLargeAllocSpace = inSize<<1; - unsigned int *result = inClear ? + unsigned int *result = inClear ? (unsigned int *)calloc(1,inSize + sizeof(int)*2) : (unsigned int *)malloc(inSize + sizeof(int)*2); if (!result) @@ -2098,7 +2098,7 @@ class GlobalAllocator } int rounded = (inDelta +3) & ~3; - + if (rounded<<1 > mLargeAllocSpace) mLargeAllocSpace = rounded<<1; } @@ -2492,7 +2492,7 @@ class GlobalAllocator GlobalAllocator *mAlloc; public: AdjustPointer(GlobalAllocator *inAlloc) : mAlloc(inAlloc) { } - + void visitObject(hx::Object **ioPtr) { if ( ((*(unsigned int **)ioPtr)[-1]) == IMMIX_OBJECT_HAS_MOVED ) @@ -2631,7 +2631,7 @@ class GlobalAllocator } #endif // } defined(HXCPP_VISIT_ALLOCS) - + void *GetIDObject(int inIndex) { AutoLock lock(*gSpecialObjectLock); @@ -2767,7 +2767,7 @@ class GlobalAllocator { ThreadPoolAutoLock l(sThreadPoolLock); int count = 0; - + // May be woken multiple times if sRunningThreads is set to 0 then 1 before we sleep sThreadSleeping[inId] = true; // Spurious wake? @@ -3039,7 +3039,7 @@ class GlobalAllocator sgAllocsSinceLastSpam = 0; #endif - HX_STACK_FRAME("GC", "collect", 0, "GC::collect", __FILE__, __LINE__,0) + HX_STACK_FRAME("GC", "collect", 0, "GC::collect", __FILE__, __LINE__, 5, 0) #ifdef SHOW_MEM_EVENTS int here = 0; GCLOG("=== Collect === %p\n",&here); @@ -3201,7 +3201,7 @@ class GlobalAllocator int mem = stats.rowsInUse< mLargeAllocSpace) @@ -3903,7 +3903,7 @@ void SetTopOfStack(int *inTop,bool inForce) void *InternalNew(int inSize,bool inIsObject) { //HX_STACK_FRAME("GC", "new", 0, "GC::new", "src/hx/GCInternal.cpp", __LINE__, 0) - HX_STACK_FRAME("GC", "new", 0, "GC::new", "src/hx/GCInternal.cpp", inSize, 0) + HX_STACK_FRAME("GC", "new", 0, "GC::new", "src/hx/GCInternal.cpp", inSize, 5, 0) #ifdef HXCPP_DEBUG if (sgSpamCollects && sgAllocsSinceLastSpam>=sgSpamCollects) @@ -3971,7 +3971,7 @@ void *InternalRealloc(void *inData,int inSize) if (inData==0) return hx::InternalNew(inSize,false); - HX_STACK_FRAME("GC", "realloc", 0, "GC::relloc", __FILE__ , __LINE__, 0) + HX_STACK_FRAME("GC", "realloc", 0, "GC::relloc", __FILE__ , __LINE__, 5, 0) #ifdef HXCPP_DEBUG if (sgSpamCollects && sgAllocsSinceLastSpam>=sgSpamCollects) @@ -4190,4 +4190,3 @@ unsigned int __hxcpp_obj_hash(Dynamic inObj) void DummyFunction(void *inPtr) { } - From 6f69cb1be17dc42fd8faed9bf19dc14219c20f88 Mon Sep 17 00:00:00 2001 From: mike Date: Mon, 8 Feb 2016 12:18:41 -0800 Subject: [PATCH 07/14] Modified FindFileLineBreakpoint to accept only line numbers --- src/hx/Debug.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/hx/Debug.cpp b/src/hx/Debug.cpp index 2fd8b1fcc..f4e2b1acc 100644 --- a/src/hx/Debug.cpp +++ b/src/hx/Debug.cpp @@ -2004,13 +2004,19 @@ class Breakpoints //printf("FindFileLineBreakpoint(), inFrame.columnNumber = %d\n", inFrame->columnNumber); for (int i = 0; i < mBreakpointCount; i++) { - Breakpoint &breakpoint = mBreakpoints[i]; - if (breakpoint.isFileLine && breakpoint.hash==inFrame->fileHash && - (breakpoint.lineNumber == inFrame->lineNumber) && (breakpoint.columnNumber == inFrame->columnNumber) && - !strcmp(breakpoint.fileOrClassName.c_str(),inFrame->fileName) ) { - printf("Breakpoint reached at %s:%d:%d\n", inFrame->fileName, inFrame->lineNumber, inFrame->columnNumber); - return breakpoint.number; - } + Breakpoint &breakpoint = mBreakpoints[i]; + bool hasCol = true; + if(breakpoint.columnNumber == -1) hasCol = false; + //Breakpoint &breakpoint = mBreakpoints[i]; + bool lineCondition = (breakpoint.isFileLine && breakpoint.hash==inFrame->fileHash && + (breakpoint.lineNumber == inFrame->lineNumber) && + !strcmp(breakpoint.fileOrClassName.c_str(),inFrame->fileName) ); + + if(hasCol && lineCondition && (breakpoint.columnNumber == inFrame->columnNumber)) { + return breakpoint.number; + }else if((!hasCol) && lineCondition) { + return breakpoint.number; + } } return -1; } From 1f324adc228bf39a427e8b900ba1cc164e6a59c8 Mon Sep 17 00:00:00 2001 From: mike Date: Mon, 15 Feb 2016 17:37:13 -0800 Subject: [PATCH 08/14] Column number print --- include/hx/Debug.h | 3 +++ src/hx/Anon.cpp | 3 +-- src/hx/Debug.cpp | 11 ++++++++--- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/include/hx/Debug.h b/include/hx/Debug.h index 8829dd911..2cb6dcecd 100644 --- a/include/hx/Debug.h +++ b/include/hx/Debug.h @@ -130,6 +130,8 @@ class StackFrame fullName(inFullName), fileName(inFileName), #ifdef HXCPP_STACK_LINE firstLineNumber(inLineNumber), + //CS116 + firstColumnNumber(inColumnNumber), #endif #ifdef HXCPP_STACK_VARS variables(0), @@ -138,6 +140,7 @@ class StackFrame { #ifdef HXCPP_STACK_LINE lineNumber = firstLineNumber; + columnNumber = firstColumnNumber; #endif __hxcpp_register_stack_frame(this); } diff --git a/src/hx/Anon.cpp b/src/hx/Anon.cpp index 9310e1078..c19e79705 100644 --- a/src/hx/Anon.cpp +++ b/src/hx/Anon.cpp @@ -139,6 +139,7 @@ Anon SourceInfo(String inFile, int inLine, String inClass, String inMethod) Anon result = Anon_obj::Create(); result->Add(HX_CSTRING("fileName"),inFile); result->Add(HX_CSTRING("lineNumber"),inLine); + //CS116 result->Add(HX_CSTRING("columnNumber"),inColumn); result->Add(HX_CSTRING("className"),inClass); result->Add(HX_CSTRING("methodName"),inMethod); return result; @@ -155,5 +156,3 @@ bool __hxcpp_anon_remove(Dynamic inObj,String inKey) return __string_hash_remove(*map,inKey); return false; } - - diff --git a/src/hx/Debug.cpp b/src/hx/Debug.cpp index f4e2b1acc..32f9a1778 100644 --- a/src/hx/Debug.cpp +++ b/src/hx/Debug.cpp @@ -39,6 +39,8 @@ using namespace Windows::System::Threading; const char* EXTERN_CLASS_NAME = "extern"; #endif +#define NO_COL_SPEC -1 + // These should implement write and read memory barrier, but since there are // no obvious portable implementations, they are currently left unimplemented static void write_memory_barrier() @@ -1494,6 +1496,7 @@ class CallStack { Dynamic ret = g_newStackFrameFunction (String(frame->fileName), String(frame->lineNumber), + String(frame->columnNumber), String(frame->className), String(frame->functionName)); // Don't do parameters for now @@ -1729,6 +1732,7 @@ class Breakpoints (gStepThread == stack->GetThreadNumber())) { if (gStepType == STEP_OVER) { if (stack->GetDepth() <= gStepLevel) { + //printf("Break immediate: stack->GetDepth=%d, gStepLevel=%d\n", stack->GetDepth(), gStepLevel); breakStatus = STATUS_STOPPED_BREAK_IMMEDIATE; } } @@ -1909,6 +1913,7 @@ class Breakpoints #endif } + // Copies breakpoints from toCopy except for number Breakpoints(const Breakpoints *toCopy, int number) : mRefCount(1) @@ -2001,12 +2006,12 @@ class Breakpoints //CS116 - We added columnNumber conditional. int FindFileLineBreakpoint(StackFrame *inFrame) { - //printf("FindFileLineBreakpoint(), inFrame.columnNumber = %d\n", inFrame->columnNumber); for (int i = 0; i < mBreakpointCount; i++) { Breakpoint &breakpoint = mBreakpoints[i]; - bool hasCol = true; - if(breakpoint.columnNumber == -1) hasCol = false; + bool hasCol = (breakpoint.columnNumber != NO_COL_SPEC); + if(hasCol) { + } //Breakpoint &breakpoint = mBreakpoints[i]; bool lineCondition = (breakpoint.isFileLine && breakpoint.hash==inFrame->fileHash && (breakpoint.lineNumber == inFrame->lineNumber) && From e5bab75e4a3a41ae94e58bc242543fdad2b20500 Mon Sep 17 00:00:00 2001 From: mike Date: Mon, 15 Feb 2016 21:49:42 -0800 Subject: [PATCH 09/14] Touchups --- src/hx/Debug.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/hx/Debug.cpp b/src/hx/Debug.cpp index 32f9a1778..5364b14e0 100644 --- a/src/hx/Debug.cpp +++ b/src/hx/Debug.cpp @@ -2010,8 +2010,6 @@ class Breakpoints { Breakpoint &breakpoint = mBreakpoints[i]; bool hasCol = (breakpoint.columnNumber != NO_COL_SPEC); - if(hasCol) { - } //Breakpoint &breakpoint = mBreakpoints[i]; bool lineCondition = (breakpoint.isFileLine && breakpoint.hash==inFrame->fileHash && (breakpoint.lineNumber == inFrame->lineNumber) && From eac16ebaab9bd20bf81bca29562ba2591041f2a2 Mon Sep 17 00:00:00 2001 From: mike Date: Thu, 18 Feb 2016 13:32:36 -0800 Subject: [PATCH 10/14] build.mod --- build.mod | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 build.mod diff --git a/build.mod b/build.mod new file mode 100644 index 000000000..5e40bfdad --- /dev/null +++ b/build.mod @@ -0,0 +1,7 @@ +cd tools/hxcpp +haxe compile.hxml +cd ../build +haxe compile.hxml +cd ../../project +neko build.n clean +neko build.n From a4bc997daef6eea55b3c3354a6ad2832ae0adb91 Mon Sep 17 00:00:00 2001 From: mike Date: Mon, 7 Mar 2016 09:56:49 -0800 Subject: [PATCH 11/14] Next line functionality --- include/hx/Debug.h | 4 +++ project/build.n | Bin 31213 -> 36093 bytes src/hx/Debug.cpp | 64 ++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 67 insertions(+), 1 deletion(-) diff --git a/include/hx/Debug.h b/include/hx/Debug.h index 2cb6dcecd..85c2237e3 100644 --- a/include/hx/Debug.h +++ b/include/hx/Debug.h @@ -502,6 +502,8 @@ void __hxcpp_dbg_deleteBreakpoint(int number); void __hxcpp_dbg_breakNow(bool wait); void __hxcpp_dbg_continueThreads(int threadNumber, int count); void __hxcpp_dbg_stepThread(int threadNumber, int stepType, int stepCount); +void __hxcpp_dbg_stepThreadLine(int threadNumber, int stepType); +void __hxcpp_dbg_setPrint(bool in); Array __hxcpp_dbg_getStackVariables(int threadNumber, int stackFrameNumber, bool unsafe, @@ -560,6 +562,8 @@ inline void __hxcpp_dbg_deleteBreakpoint(int) { } inline void __hxcpp_dbg_breakNow(bool) { } inline void __hxcpp_dbg_continueThreads(int, int) { } inline void __hxcpp_dbg_stepThread(int, int, int) { } +inline void __hxcpp_dbg_stepThreadLine(int, int) { } +void __hxcpp_dbg_setPrint(bool) { } inline Array __hxcpp_dbg_getStackVariables(int, int, bool, Dynamic) { return Array_obj< String>::__new(); } inline Dynamic __hxcpp_dbg_getStackVariableValue(int, int, String, bool, diff --git a/project/build.n b/project/build.n index f3e630a538dbd6172579a33ab6fb37f273351525..828a9304d7c5e94450bf05993ac656900268a4f6 100644 GIT binary patch delta 13063 zcmbVy3w+Z>w*Sm8k3MJ%4SkW&&^B#pOW%|hD*V#&D5d-erIZ2%5)zuUDQ!}cKnv>< zRD`M^ETf2s=&}|SMZuQ4?!7+hF1oIZYxmy0UU!$f3+$p%QBe`p_3=OF_e+|j?c&~l zKXme)^O`ef&di)i`RH@{?SovLVZq|1j1uxWf!~Fv`VJ&sUrn~ZSWRT&{%nH-vX zg!EQrk8@nPH01D_$%bVtznie$7DJd;x4=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j)rl0-Vd1I%(pq}W31l|~ zVo%Yslwmvf98DmZ;wx`Yhw=x7Qpnq#$(0()s2F7RAT*U?&Gi)MQ+2w4;nV`0NpbC+ z&Cm?$EQ;v?p;nTNjjcF`Jg{+Q+%!rJtV}K$+E|P8N$#c}$O|Za@5Pi~kfBXF^2(j_ zGs_Br6xjK2zED0rD+I&~dzT(eg(SNxbt>iZ>S8KGPm+KP-H%kJlz6(PW>FbE-2!~U zH!pNgwlKrJMtZ=E6D}itT~l!(xzJUI%b|LDJVU6eb+ZCj2&fxSB}LN}pWOR5$h3<3 zEooh>P3{T5xq0^o%m_3DKJ=hR&ZFm>@b z1=F}Wl`0^q-MI-%ZsORw({UYnqdQfa1&0TKG;9{8mwELv3P_bd3jX>8QBTq8_kCS- zj)y;zj!n}-Y+H2FKl1A3g62A2y+Y8mY)!{^25&zX$ttj$ zpU^miwtMh*BwoFm%(*)c+sKByi=*Kj7dvSUC~6hMy`>|gBu9|+v6`OmwBObODLKCI zj^||{`AI;Myxy&+njej7x~OI~kglMMrB`8b%zf9U>39C%oe$v)l^rqu`dk@37(O;` zDLDrRDf@}B1_S_nWVHX%Edg-FIC=Pf{Cc;NWbRGGlLXz>dlSjv r?o>j6k_b9l^7395wgE-beJq|WAS0j(0d)Z?7tk3%GX!*XU)=u!H@s?U diff --git a/src/hx/Debug.cpp b/src/hx/Debug.cpp index 5364b14e0..6aaf6aa16 100644 --- a/src/hx/Debug.cpp +++ b/src/hx/Debug.cpp @@ -722,6 +722,10 @@ class CallStack { public: + static void setPrint(bool in) { + printf("setPrint()\n"); + } + // Gets the call stack of the calling thread static CallStack *GetCallerCallStack() { @@ -870,8 +874,45 @@ class CallStack break; } } + } - gMutex.Unlock(); + static CallStack* getStack() { + std::list::iterator iter = gList.begin(); + CallStack *stack = *iter; + + return stack; + } + + static std::vector getStackFrames(CallStack* stack) { + return stack->mStackFrames; + } + + static void StepOneThreadLine(int threadNumber, int &stackLevel, int start_line) + { + gMutex.Lock(); + + std::list::iterator iter = gList.begin(); + CallStack* stack = *iter++; + + while (iter != gList.end()) { + + if (stack->mThreadNumber == threadNumber) { + stackLevel = stack->mStackFrames.size() - 1; + while(1) { + int current_line = stack->mStackFrames[stackLevel]->lineNumber; + // != to account for loops and lines not lesser value than + //starting line. + if((current_line != start_line)) { + break; + } + stack->Continue(1); + } + break; + } + stack = *iter++; + } + + gMutex.Unlock(); } static void GetCurrentCallStackAsStrings(Array result, bool skipLast) @@ -1705,6 +1746,19 @@ class Breakpoints CallStack::StepOneThread(threadNumber, gStepLevel); } + static void StepThreadLine(int threadNumber, StepType stepType) { + gStepThread = threadNumber; + gStepType = stepType; + gStepCount = 1; + + CallStack* stack = CallStack::getStack(); + std::vector frames = CallStack::getStackFrames(stack); + + int start_line = frames[frames.size()-1]->lineNumber; + + CallStack::StepOneThreadLine(threadNumber, gStepLevel, start_line); + } + // Note that HandleBreakpoints is called immediately after a read memory // barrier by the HX_STACK_LINE macro static void HandleBreakpoints() @@ -2215,6 +2269,14 @@ void __hxcpp_dbg_stepThread(int threadNumber, int stepType, int stepCount) stepCount); } +void __hxcpp_dbg_stepThreadLine(int threadNumber, int stepType) { + + hx::Breakpoints::StepThreadLine(threadNumber, (hx::StepType) stepType); +} + +void __hxcpp_dbg_setPrint(bool in) { + hx::CallStack::setPrint(in); +} Array __hxcpp_dbg_getStackVariables(int threadNumber, int stackFrameNumber, From 202c837bda6f24176a7c51debd5fd8993ffab854 Mon Sep 17 00:00:00 2001 From: mike Date: Tue, 8 Mar 2016 20:55:42 -0800 Subject: [PATCH 12/14] NextLine now accepts an arbitrary number of of lines. --- include/hx/Debug.h | 4 ++-- src/hx/Debug.cpp | 26 +++++++++++++++++--------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/include/hx/Debug.h b/include/hx/Debug.h index 85c2237e3..0eb54a65e 100644 --- a/include/hx/Debug.h +++ b/include/hx/Debug.h @@ -502,7 +502,7 @@ void __hxcpp_dbg_deleteBreakpoint(int number); void __hxcpp_dbg_breakNow(bool wait); void __hxcpp_dbg_continueThreads(int threadNumber, int count); void __hxcpp_dbg_stepThread(int threadNumber, int stepType, int stepCount); -void __hxcpp_dbg_stepThreadLine(int threadNumber, int stepType); +void __hxcpp_dbg_stepThreadLine(int threadNumber, int stepType, int stepCount); void __hxcpp_dbg_setPrint(bool in); Array __hxcpp_dbg_getStackVariables(int threadNumber, int stackFrameNumber, @@ -562,7 +562,7 @@ inline void __hxcpp_dbg_deleteBreakpoint(int) { } inline void __hxcpp_dbg_breakNow(bool) { } inline void __hxcpp_dbg_continueThreads(int, int) { } inline void __hxcpp_dbg_stepThread(int, int, int) { } -inline void __hxcpp_dbg_stepThreadLine(int, int) { } +inline void __hxcpp_dbg_stepThreadLine(int, int, int) { } void __hxcpp_dbg_setPrint(bool) { } inline Array __hxcpp_dbg_getStackVariables(int, int, bool, Dynamic) { return Array_obj< String>::__new(); } diff --git a/src/hx/Debug.cpp b/src/hx/Debug.cpp index 6aaf6aa16..41c8ffadf 100644 --- a/src/hx/Debug.cpp +++ b/src/hx/Debug.cpp @@ -723,7 +723,6 @@ class CallStack public: static void setPrint(bool in) { - printf("setPrint()\n"); } // Gets the call stack of the calling thread @@ -887,23 +886,32 @@ class CallStack return stack->mStackFrames; } - static void StepOneThreadLine(int threadNumber, int &stackLevel, int start_line) + static void StepOneThreadLine(int threadNumber, int &stackLevel, int start_line, int count) { gMutex.Lock(); std::list::iterator iter = gList.begin(); CallStack* stack = *iter++; + int prev_line = start_line; + int c = -1; + int current_line = -1; while (iter != gList.end()) { if (stack->mThreadNumber == threadNumber) { stackLevel = stack->mStackFrames.size() - 1; while(1) { - int current_line = stack->mStackFrames[stackLevel]->lineNumber; + prev_line = current_line; + current_line = stack->mStackFrames[stackLevel]->lineNumber; + if(current_line != prev_line) { + c++; + } // != to account for loops and lines not lesser value than //starting line. if((current_line != start_line)) { - break; + if(c == count) { + break; + } } stack->Continue(1); } @@ -911,7 +919,6 @@ class CallStack } stack = *iter++; } - gMutex.Unlock(); } @@ -1746,7 +1753,7 @@ class Breakpoints CallStack::StepOneThread(threadNumber, gStepLevel); } - static void StepThreadLine(int threadNumber, StepType stepType) { + static void StepThreadLine(int threadNumber, StepType stepType, int stepCount) { gStepThread = threadNumber; gStepType = stepType; gStepCount = 1; @@ -1756,7 +1763,7 @@ class Breakpoints int start_line = frames[frames.size()-1]->lineNumber; - CallStack::StepOneThreadLine(threadNumber, gStepLevel, start_line); + CallStack::StepOneThreadLine(threadNumber, gStepLevel, start_line, stepCount); } // Note that HandleBreakpoints is called immediately after a read memory @@ -2269,9 +2276,10 @@ void __hxcpp_dbg_stepThread(int threadNumber, int stepType, int stepCount) stepCount); } -void __hxcpp_dbg_stepThreadLine(int threadNumber, int stepType) { +void __hxcpp_dbg_stepThreadLine(int threadNumber, int stepType, int stepCount) { - hx::Breakpoints::StepThreadLine(threadNumber, (hx::StepType) stepType); + hx::Breakpoints::StepThreadLine(threadNumber, (hx::StepType) stepType, + stepCount); } void __hxcpp_dbg_setPrint(bool in) { From fc09b4c562bf44d44ddc02d2c72a3efd75fc0e36 Mon Sep 17 00:00:00 2001 From: mike Date: Thu, 10 Mar 2016 12:09:06 -0800 Subject: [PATCH 13/14] NextLine functionality --- include/hx/Debug.h | 2 ++ src/hx/Debug.cpp | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/hx/Debug.h b/include/hx/Debug.h index 0eb54a65e..209e6f5f4 100644 --- a/include/hx/Debug.h +++ b/include/hx/Debug.h @@ -504,6 +504,7 @@ void __hxcpp_dbg_continueThreads(int threadNumber, int count); void __hxcpp_dbg_stepThread(int threadNumber, int stepType, int stepCount); void __hxcpp_dbg_stepThreadLine(int threadNumber, int stepType, int stepCount); void __hxcpp_dbg_setPrint(bool in); +bool __hxcpp_dbg_getPrint(); Array __hxcpp_dbg_getStackVariables(int threadNumber, int stackFrameNumber, bool unsafe, @@ -564,6 +565,7 @@ inline void __hxcpp_dbg_continueThreads(int, int) { } inline void __hxcpp_dbg_stepThread(int, int, int) { } inline void __hxcpp_dbg_stepThreadLine(int, int, int) { } void __hxcpp_dbg_setPrint(bool) { } +bool __hxcpp_dbg_getPrint() { } inline Array __hxcpp_dbg_getStackVariables(int, int, bool, Dynamic) { return Array_obj< String>::__new(); } inline Dynamic __hxcpp_dbg_getStackVariableValue(int, int, String, bool, diff --git a/src/hx/Debug.cpp b/src/hx/Debug.cpp index 41c8ffadf..6e502eb68 100644 --- a/src/hx/Debug.cpp +++ b/src/hx/Debug.cpp @@ -1586,6 +1586,7 @@ class CallStack /* static */ MyMutex CallStack::gMutex; /* static */ std::map CallStack::gMap; /* static */ std::list CallStack::gList; +bool printStatus; #ifdef HXCPP_DEBUGGER class Breakpoints @@ -2283,7 +2284,11 @@ void __hxcpp_dbg_stepThreadLine(int threadNumber, int stepType, int stepCount) { } void __hxcpp_dbg_setPrint(bool in) { - hx::CallStack::setPrint(in); + hx::printStatus = in; +} + +bool __hxcpp_dbg_getPrint() { + return hx::printStatus; } Array __hxcpp_dbg_getStackVariables(int threadNumber, From f36fd284bd1443e5e8f44cbc0158d7052d01a7c1 Mon Sep 17 00:00:00 2001 From: mike Date: Fri, 11 Mar 2016 00:45:14 -0800 Subject: [PATCH 14/14] Fixed prompt --- include/hx/Debug.h | 4 ++++ src/hx/Debug.cpp | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/include/hx/Debug.h b/include/hx/Debug.h index 209e6f5f4..e86fe18d1 100644 --- a/include/hx/Debug.h +++ b/include/hx/Debug.h @@ -504,6 +504,8 @@ void __hxcpp_dbg_continueThreads(int threadNumber, int count); void __hxcpp_dbg_stepThread(int threadNumber, int stepType, int stepCount); void __hxcpp_dbg_stepThreadLine(int threadNumber, int stepType, int stepCount); void __hxcpp_dbg_setPrint(bool in); +bool __hxcpp_dbg_getPrintReady(); +void __hxcpp_dbg_setPrintReady(bool in); bool __hxcpp_dbg_getPrint(); Array __hxcpp_dbg_getStackVariables(int threadNumber, int stackFrameNumber, @@ -565,6 +567,8 @@ inline void __hxcpp_dbg_continueThreads(int, int) { } inline void __hxcpp_dbg_stepThread(int, int, int) { } inline void __hxcpp_dbg_stepThreadLine(int, int, int) { } void __hxcpp_dbg_setPrint(bool) { } +void __hxcpp_dbg_setPrintReady(bool) { } +bool __hxcpp_dbg_getPrintReady() { } bool __hxcpp_dbg_getPrint() { } inline Array __hxcpp_dbg_getStackVariables(int, int, bool, Dynamic) { return Array_obj< String>::__new(); } diff --git a/src/hx/Debug.cpp b/src/hx/Debug.cpp index 6e502eb68..a2e834e69 100644 --- a/src/hx/Debug.cpp +++ b/src/hx/Debug.cpp @@ -1587,6 +1587,7 @@ class CallStack /* static */ std::map CallStack::gMap; /* static */ std::list CallStack::gList; bool printStatus; +bool PrintReady; #ifdef HXCPP_DEBUGGER class Breakpoints @@ -2291,6 +2292,13 @@ bool __hxcpp_dbg_getPrint() { return hx::printStatus; } +void __hxcpp_dbg_setPrintReady(bool in) { + hx::PrintReady = in; +} + +bool __hxcpp_dbg_getPrintReady() { + return hx::PrintReady; +} Array __hxcpp_dbg_getStackVariables(int threadNumber, int stackFrameNumber, bool unsafe,