Questions tagged [callstack]

A stack that stores details of the functions called by a program in sequence, so that each function can return on completion to the code that called it.

A call stack is a stack data structure that stores information about the active subroutines of a computer program. This kind of stack is also known as an execution stack, control stack, run-time stack, or machine stack, and is often shortened to just "the stack".

A call stack is used for several related purposes, but the main reason for having one is to keep track of the point to which each active subroutine should return control when it finishes executing. An active subroutine is one that has been called but is yet to complete execution after which control should be handed back to the point of call. Such activations of subroutines may be nested to any level (recursive as a special case), hence the stack structure.

Source: Wikipedia (Call Stack)

For errors relating to overflowing the call stack use .

1119 questions
-2
votes
2 answers

Java, drawing the runtime stack

Can anyone help me draw the run time stack from the comment HERE for the following code? I attempted this, but was told it was incorrect, and my professor refused to explain this.... If anyone can give me an example, it will be easy to use that as…
andrsnn
  • 1,591
  • 5
  • 25
  • 43
-3
votes
1 answer

How is static value type field accessed and modified?

I noticed that static fields of value type are stored on the heap without boxing. For instance/non-static value type fields, I know that they are treated as parts of the object (containing the fields) on the heap so that the reference of that object…
J-A-S
  • 368
  • 1
  • 8
-3
votes
2 answers

3 way Boolean value with Java

I have 3 conditions based on my Boolean values. Condition 1: When the value is false, the user should get a blank form with a submit button Condition 2: When the user submits the form, the Boolean value is set to true and the form becomes a read…
Anan
  • 181
  • 1
  • 2
  • 14
-3
votes
1 answer

Intel 64 bits, strange RSP behavior: changes by 2 or 8, not always 0x8

I came accross a problem with debugging a 64 bit binary in Windows using IDA. Normally, after a push RSP value should be deducted by 8. But occasionally, from IDA I saw that RSP was only deducted by 2, and then 8 for the next Push. The codes…
Nathan L
  • 3
  • 3
-3
votes
2 answers

Share an instance over a call stack in C#

Check the functions below, please: public void DoJob() { CheckPrivilege(); DoJob2(); } public void DoJob2() { CheckPrivilege(); DoJob3(); } As you can see, if I call DoJob(), the CheckPrivilege() function runs twice. Sometimes I…
brtb
  • 2,201
  • 6
  • 34
  • 53
-3
votes
2 answers

How to properly use the IF Statement

Which one is correct and WHY in both examples we have a function that determines if a certain string is valid... (using some other function that's not defined here) private Validator = new Validator(); public Boolean IsValid(String foo) { if…
Fex Rex
  • 17
  • 6
-3
votes
1 answer

What is a cryptic call stack?

I have taken programming classes before but never had I heard about a cryptic call stack. What is it?
user1496542
  • 539
  • 2
  • 6
  • 14
-4
votes
2 answers

Program steps into wrong function

I have a child class with a bunch of functions that implement pure virtual functions in its parent class. When debugging, everything works the way it should except for one function. When I try to step into functionA() the execution instead enters…
Ash
  • 379
  • 1
  • 3
  • 14
-4
votes
1 answer

C++ Recursive Function the returns an array

I am trying to write a recursive function to solve the following problem: Write a function 'howSum(targetSum, numbers)' that takes in targetSum and an array of numbers as arguments. The function should return an array containing any combination of…
Thalia
  • 19
  • 2
1 2 3
74
75