tagged [stack]

How to remove a stack item which is not on the top of the stack in C#

How to remove a stack item which is not on the top of the stack in C# Unfortunately an item can only be removed from the stack by "pop". The stack has no "remove" method or something similar, but I ha...

14 Apr at 16:32

e.printStackTrace equivalent in python

e.printStackTrace equivalent in python I know that `print(e)` (where e is an Exception) prints the occurred exception but, I was trying to find the python equivalent of Java's `e.printStackTrace()` th...

21 Oct at 13:45

Does ServiceStack ormlite has the concept of transient attribute?

Does ServiceStack ormlite has the concept of transient attribute? I am newbie to servicestack and ormlite. I am trying to have fields to be used for displaying / serialization purposes not for persist...

How does the stack work in assembly language?

How does the stack work in assembly language? I'm currently trying to understand how the stack works, so I've decided teach myself some [assembly language](http://en.wikipedia.org/wiki/Assembly_langua...

How to check if a Stack<T> is empty

How to check if a Stack is empty Is there some other way, except `Stack.Count() == 0`, to check if a `Stack` is empty? Coming from C++/Java background where "stack" classes generally have some sort of...

9 Sep at 15:55

stack.ToList() – order of elements?

stack.ToList() – order of elements? When using the `.ToList()` extension method on a `Stack`, is the result the same as popping each element and adding to a new list (reverse of what was pushed)? If s...

1 Oct at 07:50

Programmatically get C# Stack Trace

Programmatically get C# Stack Trace > [How to print the current Stack Trace in .NET without any exception?](https://stackoverflow.com/questions/531695/how-to-print-the-current-stack-trace-in-net-with...

15 Apr at 15:41

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

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, i...

How to store printStackTrace into a string

How to store printStackTrace into a string How can I get the `e.printStackTrace()` and store it into a `String` variable? I want to use the string generated by `e.printStackTrace()` later in my progra...

27 Jan at 04:3

StackOverflowException in .NET 4

StackOverflowException in .NET 4 The following code works fine until I upgrade to .NET 4 (x64) ``` namespace CrashME { class Program { private static volatile bool testCrash = false; priva...

25 Aug at 00:24

How to print full stack trace in exception?

How to print full stack trace in exception? For example, in one place... ...and in another place... ``` //--------------b try { // invoke code above } catch(MyCustomException we) { Debug.Writeline...

13 Jul at 05:23

How to get ParameterInfo Value?

How to get ParameterInfo Value? I am using the below code to get Calling Method name and its parameter inside a method. ``` var stackTrace = new StackTrace(); var methodName = stackTrace.GetFrame(1).G...

27 Feb at 10:26

Array of ValueType in C# goes to Heap or Stack?

Array of ValueType in C# goes to Heap or Stack? > [(C#) Arrays, heap and stack and value types](https://stackoverflow.com/questions/1113819/c-arrays-heap-and-stack-and-value-types) I am trying to st...

28 Jun at 21:59

Initializing Queue or Stack with default values?

Initializing Queue or Stack with default values? You can Initialize a list with pre-placed values: `List L1 = new List {1, 2, 3};` is there an equivalent of above for Queue? My idea was : `Queue Q1 = ...

1 Jan at 06:21

How do I get the executing object for a stackframe?

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 Syste...

20 May at 18:29

How do I allocate a std::string on the stack using glibc's string implementation?

How do I allocate a std::string on the stack using glibc's string implementation? My understanding is that the above code uses the default allocator to call new. So even though the std::string foo is ...

Java ArrayList how to add elements at the beginning

Java ArrayList how to add elements at the beginning I need to add elements to an `ArrayList` queue whatever, but when I call the function to add an element, I want it to add the element at the beginni...

18 Jun at 12:30

Stacktrace information preserving paths of original source

Stacktrace information preserving paths of original source I am using C#.net for application development. To log and debug exceptions, I use the stacktrace. I executed my application on another machin...

11 Mar at 23:7

C++ display stack trace on exception

C++ display stack trace on exception I want to have a way to report the stack trace to the user if an exception is thrown. What is the best way to do this? Does it take huge amounts of extra code? To ...

6 Jan at 22:50

How can I find the method that called the current method?

How can I find the method that called the current method? When logging in C#, how can I learn the name of the method that called the current method? I know all about `System.Reflection.MethodBase.GetC...

What are SP (stack) and LR in ARM?

What are SP (stack) and LR in ARM? I am reading definitions over and over again and I still not getting what are SP and LR in ARM? I understand PC (it shows next instruction's address), SP and LR prob...

18 Mar at 12:58

How get value of parameters in stacktrace

How get value of parameters in stacktrace I can get information about a parameter by StackTrace using something like this: I want know how i get the value of parameter. Example: If my method in stack ...

How do I track down the cause of a StackOverflowException in .NET?

How do I track down the cause of a StackOverflowException in .NET? I get a `StackOverflowException` when I run the following code: ``` private void MyButton_Click(object sender, EventArgs e) { MyButt...

Why Must I Initialize All Fields in my C# struct with a Non-Default Constructor?

Why Must I Initialize All Fields in my C# struct with a Non-Default Constructor? I would like to try this code: But it fails on compilation, I understand that stru

25 Apr at 14:32

Stack and heap in C#

Stack and heap in C# > [What and where are the stack and heap](https://stackoverflow.com/questions/79923/what-and-where-are-the-stack-and-heap) There is a difference in C# between the heap and stack....

24 Oct at 19:8