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
7
votes
5 answers

Stack Frame Question: Java vs C++

Q1. In Java, all objects, arrays and class variables are stored on the heap? Is the same true for C++? Is data segment a part of Heap? What about the following code in C++? class MyClass{ private: static int counter; …
pankajt
  • 7,642
  • 12
  • 39
  • 60
6
votes
4 answers

Get the name of the first argument in an extension method?

string thing = "etc"; thing = thing.GetName(); //now thing == "thing" Is this even possible? public static string GetName(this object obj) { return ... POOF! //should == "thing" }
Benjamin
  • 3,134
  • 6
  • 36
  • 57
6
votes
1 answer

Access local variables of overridden parent method

How can I access the local variables of a super class method in an overridden method in the subclass? class Foo(object): def foo_method(self): x = 3 class Bar(Foo): def foo_method(self): super().foo_method() …
Alejandro
  • 623
  • 6
  • 16
6
votes
3 answers

Size taken by stack frame

Java stack create new frame for every method call, But does this frame takes memory on the stack? To clarify on my question : public void oneWay() { System.out.println("start"); get1(); } private void get1() { System.out.println("get1"); …
codingenious
  • 8,385
  • 12
  • 60
  • 90
6
votes
4 answers

Determining which code line threw the exception

In dotNet a line throws an exception and is caught, how can I figure out which line in which file threw the exception? Seems relatively straightforward, but I can't figure it out...
Matt
  • 25,943
  • 66
  • 198
  • 303
6
votes
1 answer

Print the values of the parameters up the stack trace

Printing the stack trace is not so difficult when using System.Diagnostics. I am wondering if it is possible to print the VALUES of the parameters passed to each method up the stack trace, and if not why not. Here is my preliminary code: public…
user420667
  • 6,552
  • 15
  • 51
  • 83
5
votes
3 answers

How does Smalltalk manipulate call stack frames (thisContext)?

The Smalltalk object thisContext look strange and marvelous. I can't understand what it is and how it works. And even how it enables continuations. For C's call-stack, I can easily imagine how is it implemented and working. But for this... I can't.…
eonil
  • 83,476
  • 81
  • 317
  • 516
5
votes
1 answer

How does stackalloc work?

Hello i am trying to figure out how does stackalloc work.So coming from C/C++ from my knowledge (limited) you can not allocate memory on the stack dynamically like in here: C/C++ example: void Allocate(int length){ int vector[length]; …
Bercovici Adrian
  • 8,794
  • 17
  • 73
  • 152
5
votes
1 answer

Resolve a variable name given only a stack frame object

I'm trying to find out if it's possible to resolve variables in stack frames (as returned by inspect.currentframe()). In other words, I'm looking for a function def resolve_variable(variable_name, frame_object): return…
Aran-Fey
  • 39,665
  • 11
  • 104
  • 149
5
votes
0 answers

What is the difference between stack frame and execution frame?

I'm having trouble understanding the differences between stack frames and execution frames, mostly with respect to the traceback and inspect modules (in Python 3). I thought they were the same but the docs imply they are not as methods of the…
Michael B
  • 269
  • 1
  • 3
  • 10
5
votes
1 answer

What does EBP+8 in this case in OllyDbg and Assembler mean?

I am just learning Assembler and debugging skills in OllyDbg in order to learn how to use undocumented functions. Now I am having the following problem: I have the following code part (from OllyDbg): MOV EDI,EDI PUSH EBP MOV EBP,ESP MOV EAX, DWORD…
Chuck Bartovski
  • 95
  • 1
  • 2
  • 7
5
votes
1 answer

when to release function stack data in python?

I have a question about this on testing the following code: 1, def file_close_test(): f = open('/tmp/test', 'w+') if __name__ == '__main__': file_close_test() # wait to see whether file closed. import time time.sleep(30) 2, def…
yancl
  • 263
  • 1
  • 7
4
votes
0 answers

Why one of the frame in stack is not be used in Go assembly?

The Go code is here: package main func add(a, b int) int { sum := 0 sum = a + b return sum } func main() { println(add(1, 2)) } The Go version is $ go version go version go1.19.1 darwin/amd64 I use the following command to get…
spongecaptain
  • 121
  • 1
  • 11
4
votes
1 answer

push return values in stack frame

I'm wondering if it makes sense to push the return value of a function in its the stack-frame. I know return values are mostly stored in registers (eax for gcc), but is it for performance only? Thanks!
ms123
  • 581
  • 4
  • 12
4
votes
2 answers

C/C++ build a generic stack frame to call different callback functions

I'm refactoring a C++ application that refers to a bunch a multiple callback functions, each having a different number of arguments and I would like to know if there's a generic way to build a dedicated argument stack frame before calling each of…
Obsidian
  • 3,719
  • 8
  • 17
  • 30
1 2
3
19 20