Questions tagged [stack-frame]

Use stackframe for questions related to debugging unterminated function calls.

A stackframe is a list of functions that have been invoked but have not yet returned a value

References

291 questions
18
votes
5 answers

Function Prologue and Epilogue in C

I know data in nested function calls go to the Stack.The stack itself implements a step-by-step method for storing and retrieving data from the stack as the functions get called or returns.The name of these methods is most known as Prologue and…
user1843665
  • 353
  • 2
  • 3
  • 7
17
votes
1 answer

Why does GCC drop the frame pointer on 64-bit?

What's the rationale behind dropping the frame pointer on 64-bit architectures by default? I'm well aware that it can be enabled but why does GCC disable it in the first place while having it enabled for 32-bit? After all, 64-bit has more registers…
asdf
  • 249
  • 3
  • 10
17
votes
1 answer

exception call stack truncated without any re-throwing

I have an unusual case where I have a very simple Exception getting thrown and caught in the same method. It isn’t re-thrown (the usual kind of problem naïve programmers have). And yet its StackFrame contains only one the current method. Here’s…
Todd
  • 530
  • 4
  • 14
17
votes
4 answers

how to expand size of Java stack trace to see bottom of stack? (triggering a stack overflow)

In Java, is there any way to view the complete, untruncated stack trace (e.g. by increasing the number of frames recorded), or otherwise get at the bottom of a stack trace? Normally the stack trace is truncated from the top at 1024 frames worth,…
Urban Vagabond
  • 7,282
  • 3
  • 28
  • 31
16
votes
3 answers

How do I get the executing object for a stackframe?

When using reflection it is possible to obtain the call stack (apart from that it can be a crude approximation due to JIT optimizations) using System.Diagnostics.StackTrace and examine the StackFrame objects contained. How can I get a reference to…
Cecil Has a Name
  • 4,962
  • 1
  • 29
  • 31
14
votes
1 answer

GetFileLineNumber() returns 0, even though I'm using a debug build

I'm using VS2010 to develop my project. In my codebase, I use the stackframe's GetFileLineNumber() function. At runtime, however, it always returns 0. This happens even though I am running a debug build. I have also confirmed that the generated pdb…
Stephen Gross
  • 5,274
  • 12
  • 41
  • 59
12
votes
2 answers

How does the compiler allocate memory for conditionally declared automatic variables in C++?

Say I have a function where depending on some runtime condition an expensive automatic object is created or a cheap automatic object is created: void foo() { if (runtimeCondition) { int x = 0; } else { SuperLargeObject y; …
TwistedBlizzard
  • 931
  • 2
  • 9
12
votes
3 answers

Is there a simple way to obtain all the local variables in the current stack frame in C# (or CIL)

Following my previous question, in which I wanted to dump all the variables in the stack (from the current and all the previous frame) that can be seen here: Is there a way to examine the stack variables at runtime in C#? I was suggested to…
cloudraven
  • 2,484
  • 1
  • 24
  • 49
12
votes
4 answers

How do called functions return to their caller, after being called?

I read that when a function call is made by a program, the called function must know how to return to its caller. My question is: How does the called function know how to return to its caller? Is there a mechanism working behind the scenes through…
haccks
  • 104,019
  • 25
  • 176
  • 264
9
votes
2 answers

Is the gcc insane optimisation level (-O3) not insane enough?

As part of answering another question, I wanted to show that the insane level of optimisation of gcc (-O3) would basically strip out any variables that weren't used in main. The code was: #include int main (void) { char bing[71]; int…
paxdiablo
  • 854,327
  • 234
  • 1,573
  • 1,953
8
votes
2 answers

Spring insight crashes with "Imbalanced frame stack"

I want to use spring insight to trace my spring mvc webapp. When starting up the tc server 2.5 developer edition, my application comes up but I see following message in the console: 20.10.2011 09:24:24…
powerMicha
  • 2,753
  • 1
  • 24
  • 31
8
votes
1 answer

Delphi 64 bit debugging using runtime libs has wrong stack frame active

I ran into a Win64 debugging problem where it looks like we are "missing" debug info. So I did some research and re-created all my .dproj files for our flagship product. This helped, as I got my "missing" blue balls back. But now I run into a new…
H.Hasenack
  • 1,094
  • 8
  • 27
8
votes
1 answer

EBP, ESP and stack frame in assembly

I have a few questions about EBP, ESP and stack frame in following code. Why did we subtract 28 from esp? We have two local variables x and y in main. So why didn't we subtract 8? And don't we put values to stack from right (or top) to left (or…
Figen Güngör
  • 12,169
  • 14
  • 66
  • 108
7
votes
2 answers

What's the Difference Between Stack Pointer and Frame Pointer in Assembly ARM

I was wondering if someone could please explain to me what's the difference between the Stack Pointer and the Frame Pointer in Assembly ARM
7
votes
3 answers

Stack / base pointers in assembly

I know this topic has been covered ad nauseam here, and other places on the internet - but hopefully the question is a simple one as I try to get my head around assembly... So if i understand correctly the ebp (base pointer) will point to the top…
malangi
  • 2,692
  • 4
  • 28
  • 42
1
2
3
19 20