callstack

make a variable last for a call stack

筅森魡賤 提交于 2020-01-03 20:02:04
问题 I have a class that contains some fields. I need to compare instances of this class by value, so I defined GetHashCode and Equals accordingly. Because the class allows circular references, I need a mechanism to avoid infinite recursion (for a more detailed explanation see Value-equals and circular references: how to resolve infinite recursion?). I solved this problem by modifying my Equals method so that it keeps track of the comparisons done before: class Foo { public string Name { get; set;

make a variable last for a call stack

霸气de小男生 提交于 2020-01-03 20:01:03
问题 I have a class that contains some fields. I need to compare instances of this class by value, so I defined GetHashCode and Equals accordingly. Because the class allows circular references, I need a mechanism to avoid infinite recursion (for a more detailed explanation see Value-equals and circular references: how to resolve infinite recursion?). I solved this problem by modifying my Equals method so that it keeps track of the comparisons done before: class Foo { public string Name { get; set;

Searching call stacks in Visual Studio [duplicate]

旧街凉风 提交于 2020-01-03 17:35:11
问题 This question already has answers here : How to dump or search in call stacks of ALL threads in Visual Studio (2 answers) Closed 3 years ago . I am using Visual Studio to debug a large multithreaded C++ application. I am trying to find out what thread ran a function I am interested in. I have more than 40 threads, some with really lengthy call stacks. So, manually inspecting individual call stacks to see if they contain my function is really tedious. I was wondering if Visual Studio supports

Print callstack at runtime (XCode)

强颜欢笑 提交于 2020-01-02 08:04:08
问题 Is it possible? I have found solution for Visual Studio Print n levels of callstack? 回答1: To print a backtrace at runtime programmatically, you can use this function: #import <execinfo.h> void PrintBacktrace ( void ) { void *callstack[128]; int frameCount = backtrace(callstack, 128); char **frameStrings = backtrace_symbols(callstack, frameCount); if ( frameStrings != NULL ) { // Start with frame 1 because frame 0 is PrintBacktrace() for ( int i = 1; i < frameCount; i++ ) { printf("%s\n",

<Not Available> and [Thread Destroyed] details in Thread window for Visual Studio 2010

半世苍凉 提交于 2020-01-02 01:35:13
问题 I've been trying to debug some issues related with threads with one application. When I attach to the application I see a window like this one: What is this thread with a name "[Thread Destroyed]"? The app code is not writing this name for sure. What means that a Thread has the call stack not available. The "Acquisition Engine" thread is created inside the application and runs inside a loop until stopped. If the thread is stopped it exits the loop and it ends its life so it should be in the

Call Stack at Runtime

霸气de小男生 提交于 2020-01-01 05:52:20
问题 I want to access the call stack at runtime in a Native C++ application. I am not using the IDE. How do I display the call stack? Update: I have a function which is called from many points all over the application. It crashes on rare occasions. I was looking for a way to get name of the caller and log it. 回答1: I believe that this page has the answer you are looking for. You said Visual C so I assume you mean windows. 回答2: Have a look at StackWalk64. If you're used to doing this on .NET, then

Call Stack at Runtime

 ̄綄美尐妖づ 提交于 2020-01-01 05:52:08
问题 I want to access the call stack at runtime in a Native C++ application. I am not using the IDE. How do I display the call stack? Update: I have a function which is called from many points all over the application. It crashes on rare occasions. I was looking for a way to get name of the caller and log it. 回答1: I believe that this page has the answer you are looking for. You said Visual C so I assume you mean windows. 回答2: Have a look at StackWalk64. If you're used to doing this on .NET, then

How to print call stack in C/C++ more beautifully?

佐手、 提交于 2020-01-01 05:39:42
问题 I would like to print call stack with more information like in gdb. This is what I have so far. void to_print_callstack() { void *buffer[100]; int n = backtrace(buffer,10); char **str = backtrace_symbols(buffer, n); for (int i = 0; i < n; i++) { printf("%d: %s\n", i, str[i]); } } When it runs, I get something as below. 0: ./test-prog() [0x4466bf] 1: ./test-prog() [0x445e1d] 2: ./test-prog() [0x443fd5] 3: ./test-prog() [0x439a99] 4: ./test-prog() [0x43302f] 5: ./test-prog() [0x4322c9] 6: .

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

落花浮王杯 提交于 2020-01-01 02:42:06
问题 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>

Why are function parameters pushed earlier on call stack than the return address?

大兔子大兔子 提交于 2019-12-31 10:02:57
问题 From http://en.wikipedia.org/wiki/Stack_pointer#Structure I am wondering why the return address for a function is placed above the parameters for that function? It makes more sense to have Return Address pushed onto the stack before the Parameters for Drawline because the parameters are not required any more when the Return Address is popped for returning back to the calling function. What are the reasons for preferring the implementation shown in diagram above? 回答1: The return address is