callstack

C++ Stack Tracing issue

不问归期 提交于 2019-12-03 15:50:56
I am working on a class which I would like to use to log the current Call Stack on computers with Windows Vista/7. (Very similar to “Walking the callstack” http://www.codeproject.com/Articles/11132/Walking-the-callstack ). First I used RtlCaptureContext to get the current context record then I used StackWalk64 to get the individual stack frames. Now, I realized that the Program counter in STACKFRAME64.AddrPC actually changes for a specific code line whenever I close my program and start it again. For some reason I thought that the PC-Address for a specific code line would stay the same as long

Does CasperJs then() wait on emitted events in the previous function?

白昼怎懂夜的黑 提交于 2019-12-03 15:06:41
I am just curious how CasperJS handles events with regards to the call stack. Let's say we have some code: casper.on('foo', function() { this.wait(60000); this.echo('foo'); }); casper.start('http://www.stackoverflow.com', function() { this.echo('start'); this.emit('foo'); }); casper.then(function() { this.echo('done'); }); casper.run(); I know that then() will wait check against 3 flags : pendingWait, loadInProgress, and navigationRequested. Printing out the call stack shows the emit call to be in the function start(), so will start() not be considered finished until the event is finished? I.e

Treating Warnings as Errors

不问归期 提交于 2019-12-03 10:56:17
I have a php application that I have just re-factored. Unfortunately it spewing out warnings like: Warning: preg_match() expects parameter 2 to be string, object given in /home/yacoby/dev/netbeans/php/Zend/Db/Select.php on line 776 Which is impossible (or very hard work) to work out the issue as I don't have a callstack so can't tell which parts of my code are causing the warning and there is a lot of code. I need a method to either treat warnings like errors (In that the application dies and prints the stacktrace) or I need the stacktrace to be shown when printing errors. Is there a method to

What is the difference between Call Stack and Stack Trace?

為{幸葍}努か 提交于 2019-12-03 10:39:49
What is the difference between the terms "Call Stack" and "Stack Trace" ? A call stack is typically "the current stack of operations" - i.e. while it's running. A stack trace is typically a copy of the call stack which is logged at some sort of failure, e.g. an exception. In other words, while you're debugging you will look at the current call stack - but when you look at logs, you'll get a stack trace. At least, that's my interpretation of the terms :) Call stack is a data structure storing information about active subroutines in a running program. Stack trace is a representation of the call

“[Lightweight Function]” in the call stack

。_饼干妹妹 提交于 2019-12-03 10:09:39
I'm debugging a program (VS2008), and I was stepping through lines of code. I came across one line where a delegate function was being called, and I tried to step into it. However, rather than stepping into the method as I expected, the method was bypassed, with the debugger instead stepping into what I assume is a function called by the delegate. In the call stack, the line where I expected the delegate method to be is greyed out with the text [Lightweight Function] . What does the "Lightweight Function" part mean? Is there a way to step into this function? I believe a lightweight function

For C# logging, how do I obtain the call stack depth with minimal overhead?

左心房为你撑大大i 提交于 2019-12-03 07:28:28
问题 I have created a wrapper for Log4net (which I may be dropping in favor of NLog; I haven't decided yet), and I indent the logged messages result to give an idea of calling structure. For example: 2011-04-03 00:20:30,271 [CT] DEBUG - Merlinia.ProcessManager.CentralThread.ProcessAdminCommand - ProcStart - User Info Repository 2011-04-03 00:20:30,271 [CT] DEBUG - Merlinia.ProcessManager.CentralThread.StartOneProcess - User Info Repository 2011-04-03 00:20:30,411 [CT] DEBUG - Merlinia

How can I see the exception call stack in SharePoint 2010?

南楼画角 提交于 2019-12-03 07:22:40
I am trying to port a SharePoint 2007 site collection feature to 2010. During the feature activation, SharePoint shows the "yellow screen of death" stating "The current custom error settings for this application prevent the details of the application error from being viewed.". AFAIK I have configured everything that is need to see the error: in c:\inetpub\wwwroot\wss\VirtualDirectories\80\web.config I have set <system.web> <customErrors mode="Off" /> <compilation debug="true" /> <SharePoint> <SafeMode CallStack="true" /> (other attributes/tags ommited for brevity) This was enough for

confusion about function call stack

主宰稳场 提交于 2019-12-03 07:19:31
According to Wiki: the caller pushes the return address onto the stack, and the called subroutine, when it finishes, pops the return address off the call stack and transfers control to that address. Pic from Wiki: I don't quite understand this. Say I have a C program as follows: #include <stdio.h> int foo(int x) { return x+1; } void spam() { int a = 1; //local variable int b = foo(a); //subroutine called int c = b; //local variable } int main() { spam(); return 0; } And I think the call stack should be something like a drawing as follows: <None> means none local variables or params _|

How can I navigate the call stack in Visual Studio using just the keyboard?

做~自己de王妃 提交于 2019-12-03 05:01:33
My current solution is to hit Alt D , W , C , which navigates via the menus to the call stack, and then I can use the arrows to navigate. But once I press Enter on a particular frame, I have to repeat again. Is there a more fluid way to navigate the call stack with just my keyboard? ReSharper oriented answers are OK for me if you have one! I use the VS2010 default keyboard mapping scheme and by pressing Ctrl + Alt + C brings up the call stack window in which I can use the arrow keys to navigate. The macro name is Debug.CallStack Here is a dorky AutoHotkey script that will navigate up and down

How can I rethrow an exception in Javascript, but preserve the stack?

流过昼夜 提交于 2019-12-03 04:52:22
问题 In Javascript, suppose I want to perform some cleanup when an exception happens, but let the exception continue to propagate up the stack, eg: try { enterAwesomeMode(); doRiskyStuff(); // might throw an exception } catch (e) { leaveAwesomeMode(); throw e; } doMoreStuff(); leaveAwesomeMode(); The problem with this code is that catching and rethrowing the exception causes the stack trace information up to that point to be lost, so that if the exception is subsequently caught again, higher up on