stack

Getting pdb-style caller information in python

Let's say I have the following method (in a class or a module, I don't think it matters): def someMethod(): pass I'd like to access the caller's state at the time this method is called. traceback.extract_stack just gives me some strings about the call stack. I'd like something like pdb in which I can set a breakpoint in someMeth...

Stack overflows from deep recursion in Java?

After some experience with functional languages, I'm starting to use recursion more in Java - But the language seems to have a relatively shallow call stack of about 1000. Is there a way to make the call stack bigger? Like can I make functions that are millions of calls deep, like in Erlang? I'm noticing this more and more when I do Pr...

Where is allocated variable reference, in stack or in the heap ?

Hi all members of stackoverflow, I have a question What happend when I declare a variable inside a method, for example. void myMethod() { Ship myShip = new Ship(); } Where is allocated myShip reference, in stack or in the heap ? I think in stack but I'm confused because I was reading in J2ME Game Programming book "Java classes ...

Can someone explain these few lines of MSIL? Why does it move a value off the evaluation stack to a local variable, only to move it back immediately and return it?

The following MSIL code loads a single argument (a string), calls a method, which returns bool, and then returns that bool value. What I don't understand is why it calls stloc.0 to store the method's return value in a local variable, then performs an explicit unconditional control transfer to the very next labeled line (seems unnecessar...

How can I increase the stack memory?

Duplicate of http://stackoverflow.com/questions/743545/how-to-allow-more-memory-and-avoid-stack-overflow-on-lots-of-recursion I'm writing a branch and bound algorithm which has at least 10000 levels by a recursive function,but it doesn't work due to a stack overflow error. here is a simple instance of my program in C++: void f(int k) {...

Technology Stack for Basic Web Application

I'm going to build a basic web application, a pretty normal application with a db. Tell me if this stack seems ok, some of the items I am not familiar with yet, i'm trying to establish a list of technologies/products that I will eventually need: Spring (note, NO EJBs) Hibernate Either Oracle or MySQL (not sure yet which) ActiveMQ Flash/...

Stack of elements

How do I insert elements of different data types into a single stack in Java? ...

Can i configure a ARM processor for Ascending Stack growth direction?

Hello, There has been one question here which talked about stack growth direction. To which Micahel Burr had replied saying in ARM processors stack growth direction can be configured - i.e. either descending(normal behaviour) stack grows towards zero address(lower address) in memory or descending,i.e. stack grows towards higher address ...

How can I cycle a USB device from C#?

I'd like to cycle (simulate unplug and re-inserting) a USB device (modem) after a certain event has fired. I found a sample on codeproject: http://www.codeproject.com/KB/system/usbeject.aspx That allows me to identify+eject the device via its non-volatile serial, but I need it to recycle, not just eject. I have read this: http...

How to prevent a stack overflow by monitoring the stack size?

Many C/C++/Fortran and other programmers would have come across "stack overflow" errors. My question is, Is there a tool, a program or a simple code snippet, that allow us to monitor or check the size of the stack while the program is running? This may be helpful to pinpoint where the stack is being accumulated and eventually causing ove...

which language / platform doesn't have a fixed stack size?

does some language or platform not have a fixed size of stack and therefore not easy to overflow? I remember using C on UNIX, the stack was difficult to overflow while back in the days of Win 3.1, the stack was very easy to overflow. ...

How does a virtual machine work?

I've been looking into how programming languages work, and some of them have a so-called virtual machines. I understand that this is some form of emulation of the programming language within another programming language, and that it works like how a compiled language would be executed, with a stack. Did I get that right? With the provis...

Stack issues when calling a DLL compiled with Visual C++ in GCC

I'm trying to call some functions in a DLL compiled with (I believe) Visual C++ from my program, which is compiled using GCC. To call the functions in the DLL, I do a LoadLibrary() on the DLL, and then a GetProcAddress() to get the address of a particular function, which I then call. This function returns a list of pointers to the funct...

How to get the stack size of an existing .NET thread

I want to find out the stack size of .NET thread pool threads in CLR 4.0. Any ideas? Nick ...

Resizing dynamic stack allocations in C++

Hi, I'm writing a small ray tracer using bounding volume hierarchies to accelerate ray tracing. Long story short, I have a binary tree and I might need to visit multiple leafs. Current I have a node with two children left and right, then during travel() if some condition, in this example intersect(), the children are visited: class Bo...

Is there a way to dump a stack trace without throwing an exception in java?

I am thinking of creating a debug tool for my Java application. I am wondering if it is possible to get a stack trace, just like Exception.printStackTrace() but without actually throwing an exception? My goal is to in any given method, dump a stack to see who the method caller is. Any replies or thoughts concerning this would be reall...

What are the possible causes of a stack overflow?

What are the possible causes of a stack overflow? ...

Call tree for embedded software

Does anyone know some tools to create a call tree for C application that will run on a microcontroller (Cortex-M3)? It could be generated from source code (not ideal), object code (prefered solution), or at runtime (acceptable). I've looked at gprof, but there's still a lot missing to get it to work on an embedded system. An added bonus...

.Net 3.5 CompactFramework Stack

All, I need a high speed stack on a .Net CF platform (ARM chip). Does anyone know if the standard (managed) queue classes work well enough for what I describe below? Anyone got an idea on how fast they are? If I do not used managed memory classes what should I use? The stack will need a maximum size (in megabytes ... 10 or 20 ... so mem...

Windows: avoid pushing full x86 context on stack

I have implemented a language under MS Windows that uses cactus stacks to implement parallel programs. The stack chunks are allocated on a per-function basis and are just the right size to handle local variables, expression temp pushes/pops, and calls to libraries (including stack space for the library routines to work in). Such stack ...