debugging

Why is my program going into both an if statement AND its corresponding else statement?

这一生的挚爱 提交于 2020-01-03 03:10:14
问题 In part of my program, I have the code: if(cameraName == L"AVT Prosilica GT2750") { mCamera = new camera_avtcam_ex_t(); } else if(cameraName == L"QImaging Retiga 2000R\\4000R") { mCamera = new camera_qcam_ex_t(); } When I have set up my program so that cameraName defaults to L"AVT Prosilica GT2750" (and my debugger will show this to be its value), it goes into the if statement and runs mCamera = new camera_avtcam_ex_t(); , but then when I step to the next executed line my debugger skips

How to print C-preprocessor variables like __LINE__ with mexErrMsgTxt() In Matlab MEX

ぃ、小莉子 提交于 2020-01-03 00:55:31
问题 For debugging Matlab-MEX, which can be quite a hassle, it would be nice to have better assertion capabilities. Following this question about mex-assertions, it is possible to define a preprocessor makro, that throws an error to Matlab and prints a string (can mostly replace mxAssert , which unfortunately crashes Matlab2011b). #define myassert( isOK,astr ) ( (isOK) ? (void)0 : (void) mexErrMsgTxt(astr) ) It would be much nicer to print the file, line number and caller function, from where

How to print C-preprocessor variables like __LINE__ with mexErrMsgTxt() In Matlab MEX

淺唱寂寞╮ 提交于 2020-01-03 00:55:10
问题 For debugging Matlab-MEX, which can be quite a hassle, it would be nice to have better assertion capabilities. Following this question about mex-assertions, it is possible to define a preprocessor makro, that throws an error to Matlab and prints a string (can mostly replace mxAssert , which unfortunately crashes Matlab2011b). #define myassert( isOK,astr ) ( (isOK) ? (void)0 : (void) mexErrMsgTxt(astr) ) It would be much nicer to print the file, line number and caller function, from where

Testing iPhone app with Valgrind

烂漫一生 提交于 2020-01-03 00:55:09
问题 I have terrific bug "object was modified after being freed", so I tend to take valgrind. After successfull installation from their svn, doing little trick from here: http://landonf.bikemonkey.org/code/iphone/iPhone_Simulator_Valgrind.20081224.html and changing path to valgrind with my one, I get "Debugger terminated." with gdb log: [Session started at 2010-08-03 10:47:25 +0500.] GNU gdb 6.3.50-20050815 (Apple version gdb-1469) (Wed May 5 04:36:56 UTC 2010) Copyright 2004 Free Software

Importing visionmedia debug in Angular 2 app with System.js and how to log messages?

本秂侑毒 提交于 2020-01-02 21:56:14
问题 I am working on a MEAN stack app with Angular 2 frontend. I have successfully used debug in the express app. However I am unable to cleanly import debug in app.components.ts or main.module.ts . Any idea on how to proceed? <script src="/node_modules/debug/debug.js"></script> Results in error: Uncaught ReferenceError: module is not defined <script>System.import('./node_modules/debug/debug.js');</script> Not good either: zone.js:101 GET http://localhost:8002/ms.js 404 (Not Found) Some dependency

Do I need to make an Ad Hoc Provisioning Profile to debug my app on my iPhone?

蹲街弑〆低调 提交于 2020-01-02 21:19:29
问题 I think I'm just cloudy on how debugging works on a real device - is that how to go about it? I've been reading through Apple's docs on creating provisioning profiles for distribution, but I'm not finding any information for simply debugging my app, which is running on my device, through Xcode. Can someone point me in the right direction? Edit (2/19/09): I'm getting conflicting answers on whether or not I need to create an ad-hoc provisioning profile to debug my app. If I don't need to create

See lots of clr!CLRSemaphore::Wait in call stack

纵饮孤独 提交于 2020-01-02 19:28:10
问题 We see lots of callstack like the below, may I know what's conditions \situation would happens this? OS Thread Id: 0x48654 (559) Current frame: ntdll!NtWaitForSingleObject+0xa Child-SP RetAddr Caller, Callee 00000020a76cf480 00007fffd4ea1118 KERNELBASE!WaitForSingleObjectEx+0x94, calling ntdll!NtWaitForSingleObject 00000020a76cf520 00007fffce50ce66 clr!CLRSemaphore::Wait+0x8a, calling kernel32!WaitForSingleObjectEx 00000020a76cf5e0 00007fffce50d247 clr!ThreadpoolMgr::UnfairSemaphore::Wait

Debug Nativescript on Visual Studio Code not working

筅森魡賤 提交于 2020-01-02 19:26:10
问题 I am able to use the cmd to run my nativescript project ( tns run android). I open the project in VSCode, and add the Configuration to debug it. I hit debug and it look like the debug try to run or something. (Look at the green bar under debug. However, nothing seem to run. I look at the debug console, nothing is print out. Please take a look at screenshot. Spent couple days on this issue and couldnt resolve it at all. VSCode Debug Issue 回答1: Thanks Nick Iliev, The problem actually is from

Can I call the werkzeug debugger in Django without needing to raise an exception or using assertions?

有些话、适合烂在心里 提交于 2020-01-02 17:57:20
问题 I'm currently using Werkzeug together with django-extensions and I'm able to call the werkzeug debugger by raising an exception or making a false assertion. Is it possible to just set a breakpoint for werkzeug like import pdb; pdb.set_trace() does? 回答1: If you are using Apache/mod_wsgi, all you need to do is modify your .wsgi file to include: from werkzeug.debug import DebuggedApplication and application = get_wsgi_application() application = DebuggedApplication(application, evalex=True) Then

How to debug windows service which fails in Init() method

若如初见. 提交于 2020-01-02 17:34:27
问题 I have a windows service which fails in Init() method and throws some exception , so only way for me to check what the error is by looking at the event log. I want to debug the windows service, but the problem is that i can attach debugger only when service is rnning, in my case it fails in Init() method only. Any idea ? 回答1: you can programatically attach the debugger as the first line in the function: Debugger.Launch (); after adding the using statement: using System.Diagnostics; 回答2: What