memory watch and monitoring

S

SM Ryan

(e-mail address removed) wrote:
# Programming interfaces are available that provide notifications if a
# piece of memory was accessed.
# Do you need them for debugging and safety checks?

They are frequently used for debugging. If a variable changes unexpected,
you can do stuff to the page it's in and have a debugger check when the
hardware reference the page.

# - http://tcl.tk/man/tcl8.5/TclLib/TraceVar.htm

This is a very different creature than when you trace variables in a
compiled language like C. Tcl is an interpretter, and setting and
referencing of a variable is handled by a function. So variable traces
are added without using anything in the underlying hardware. It makes
the implementation cheaper, so Tcl traces are a frequent programming
technique.

# How do you think about the chances that this kind of functionality can
# be added to the standard API for memory management?

Not in ANSI C because ANSI C has to run on CPUs without the required
hardware. You can define an interface for VM functions and then
provide some implementations for say Windows and Linux. Whether anybody
but you will ever use it depends on issues other than technical merit.
 
M

Markus.Elfring

# How do you think about the chances that this kind of functionality can
# be added to the standard API for memory management?

Not in ANSI C because ANSI C has to run on CPUs without the required
hardware. You can define an interface for VM functions and then
provide some implementations for say Windows and Linux. Whether anybody
but you will ever use it depends on issues other than technical merit.

I imagine variants of "memget" and "memset" functions to add
traceability.
Is a standard option possible to receive notifications or callbacks?

Regards,
Markus
 
W

Walter Roberson

I imagine variants of "memget" and "memset" functions to add
traceability.
Is a standard option possible to receive notifications or callbacks?

There is no similar standard option right now.

If you are proposing that there -should- be a standard option along
those lines, you should expect that the committees would not seriously
consider adding it unless a clear software-only implementation is
possible. As the checks would have to be active during -every-
instruction, unless there is a hardware assist (which the committees
are unlikely to accept) the checks would have to be compiled in...
and thus not dynamically configurable.
 
S

SM Ryan

# I imagine variants of "memget" and "memset" functions to add
# traceability.
# Is a standard option possible to receive notifications or callbacks?

If you're defining a new interface/library, is will do whatever you want
it to do. There are variety of callback or signalling mechanisms you can
study.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top