I'm constructing a garbage collector. I have a way of scanning the
stack precisely, but I need to be able to trace back through the stack
via %ebp. I kind of don't want to have to alter the compiler and add
the overhead by adding a pushl %ebp before each void *gc_alloc(/*void
*ebp,*/ size_t), so I was wondering if anyone out there had any not-
too-devilishly-voodoo-y solution to getting the current function's
base pointer. Maybe it's in the C standard, but I can't find it.
I can alter the compiler, to be sure, but I wanted to know if there
was some easier/lazier/more cost-efficient way of doing things.
-Gabe 2 2633
On Mar 2, 2:07 pm, "Gabe McArthur" <madeona...@gmail.comwrote:
I'm constructing a garbage collector. I have a way of scanning the
stack precisely, but I need to be able to trace back through the stack
via %ebp. I kind of don't want to have to alter the compiler and add
the overhead by adding a pushl %ebp before each void *gc_alloc(/*void
*ebp,*/ size_t), so I was wondering if anyone out there had any not-
too-devilishly-voodoo-y solution to getting the current function's
base pointer. Maybe it's in the C standard, but I can't find it.
I can alter the compiler, to be sure, but I wanted to know if there
was some easier/lazier/more cost-efficient way of doing things.
-Gabe
I guess you are using the GCC compiler because of the AT&T Gas syntax
you are using.
Try the gcc compiler newsgroup and ask about inline assembly.
Gabe McArthur wrote:
I'm constructing a garbage collector. I have a way of scanning the
stack precisely, but I need to be able to trace back through the stack
via %ebp. I kind of don't want to have to alter the compiler and add
the overhead by adding a pushl %ebp before each void *gc_alloc(/*void
*ebp,*/ size_t), so I was wondering if anyone out there had any not-
too-devilishly-voodoo-y solution to getting the current function's
base pointer. Maybe it's in the C standard, but I can't find it.
No, the C standard has no requirement for a stack, and certainly not
for a base pointer.
You'll probably need to use atleast inline assembler instructions.
A quick post to the gcc mailing-list ought to clear up your problem. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: hellrazor |
last post by:
Hi there,
First of all, I'm very much a C++ amateur (i.e., a newb). I'm having to
program a win32 system service for my employer, and I'm almost done with
the task, but I need help with...
|
by: Martin |
last post by:
I'd like to be able to get the name of an object instance from within
a call to a method of that same object. Is this at all possible?
The example below works by passing in the name of the object...
|
by: James Marshall |
last post by:
Does anyone know....
In JavaScript, is there any way to get a reference to a string variable
(not an object), like Perl's "\" operator? I want to be able to compare
two such references and know...
|
by: laredotornado |
last post by:
Hello, I am looking for a cross-browser way (Firefox 1+, IE 5.5+) to
have my Javascript function execute from the BODY's "onload" method,
but if there is already an onload method defined, I would...
|
by: Nathan Sokalski |
last post by:
I would like to be able to get the ContentType of a file programmatically
(for example, I want *.txt files to return "text/plain"). I could not find a
way to do this using VB.NET's classes, but I...
|
by: tshad |
last post by:
I have a page that I am getting a username and password as a random number
(2 letters, one number and 4 more letters)
I have 2 functions I call:
*************************************************...
|
by: banderson777 |
last post by:
Hello,
I'm a bit new at in-depth IE programming, and am having a bit of trouble with a couple of IE browser extensions (getting them to talk to each other).
The first one is a C++ Browser Helper...
|
by: rocketfire97 |
last post by:
I'm trying to call a COM object using C# but having no luck getting
values back for passed in ref objects.
I've tried the same call using VB.NET and can get data back. How would
I implement the...
|
by: Harlequin |
last post by:
I have a question concerning the need to trigger events within a "child" subform which is itself enbedded within a master "parent" form and which is accessible via a tab in the parent form. Becuase...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |