Default Stack Size
-
hi I was getting storage overlays in my local variable when I noticed that the SP register was 0X4652E25F0 and my BP registers was 0X4C652E2A60 does that mean that my stack size is 144 bytes I have a table in the function itself that is 256 bytes to translate ASCII to EBCDIC beginthread stack size is 0
-
hi I was getting storage overlays in my local variable when I noticed that the SP register was 0X4652E25F0 and my BP registers was 0X4C652E2A60 does that mean that my stack size is 144 bytes I have a table in the function itself that is 256 bytes to translate ASCII to EBCDIC beginthread stack size is 0
Quote:
In addition, the stack_size argument can be 0, in which case the operating system uses the same value as the stack that's specified for the main thread.
Don't try to guess what the situation may be just by looking at registers. In most code BP is set as a base register from an offset of SP, but that does not imply any particular stack size.
-
Quote:
In addition, the stack_size argument can be 0, in which case the operating system uses the same value as the stack that's specified for the main thread.
Don't try to guess what the situation may be just by looking at registers. In most code BP is set as a base register from an offset of SP, but that does not imply any particular stack size.
-
ForNow wrote:
I guess it could be ...
... anything. Guessing is not generally a good strategy for fixing problems. You need to be sure what the problem is first. Maybe if you show the code where the problem occurs, and a few more details, we could make some useful suggestions.
-
Quote:
In addition, the stack_size argument can be 0, in which case the operating system uses the same value as the stack that's specified for the main thread.
Don't try to guess what the situation may be just by looking at registers. In most code BP is set as a base register from an offset of SP, but that does not imply any particular stack size.
if stepped thru the code in Assembler after the function prologue by subtracting BP - SP = stack size right ? I added code to a source file in Hercules cpu.c thing is its a makefile build which very confusing I was wondering if there isn't -F or /F flag for the stack size I guess it would default to some number my local variables and parameters would make the stack a little over 300 bytes, which is not too big I am trying to figure to determine where in the makefile is the compile for CPU.C Thanks
-
if stepped thru the code in Assembler after the function prologue by subtracting BP - SP = stack size right ? I added code to a source file in Hercules cpu.c thing is its a makefile build which very confusing I was wondering if there isn't -F or /F flag for the stack size I guess it would default to some number my local variables and parameters would make the stack a little over 300 bytes, which is not too big I am trying to figure to determine where in the makefile is the compile for CPU.C Thanks
I think we are talking at cross-purposes. What you are referring to is a function's frame size, which is a portion of the thread's stack. The frame will be created large enough for all the locally declared variables in that function, so you need to look at the source code to see why it is not large enough, or why it is being overwritten. The makefile may be using an inference rule for cpu.c, so you cannot always find a specific line which references it. But you should be able to find a reference to it somewhere in the Makefile (or any of its included subfiles). However, as I mentioned, you still need to diagnose the actual problem, and changing the stack size for the final application is unlikely to make any difference.
-
I think we are talking at cross-purposes. What you are referring to is a function's frame size, which is a portion of the thread's stack. The frame will be created large enough for all the locally declared variables in that function, so you need to look at the source code to see why it is not large enough, or why it is being overwritten. The makefile may be using an inference rule for cpu.c, so you cannot always find a specific line which references it. But you should be able to find a reference to it somewhere in the Makefile (or any of its included subfiles). However, as I mentioned, you still need to diagnose the actual problem, and changing the stack size for the final application is unlikely to make any difference.