Channels ▼


Testing Testers

Source Code Accompanies This Article. Download It Now.

Dr. Dobb's Journal February 1997: Instrumentation Techniques

Dr. Dobb's Journal February 1997

Instrumentation Techniques

Instrumentation, in the context of this article, is the process of adding extra code to monitor a program's behavior. Sometimes object code in the executable image itself is changed; at other times, program flow is diverted by patching entry points to external functions.

Source-code instrumentation adds extra instructions at the source-code level. NuMega's BoundsChecker (with technology licensed from ParaSoft) uses this approach and calls it CTI ("compile time instrumentation," a slight misnomer in my view).

Compile-time instrumentation modifies the actual translation process and adds extra object code that never had a source code representation. This is what Borland's C++ compiler does for the benefit of CodeGuard.

Link-time instrumentation uses the properties of the (static) link process to intercept calls to selected library functions and replace them with calls to equivalent, but instrumented versions of them. CodeGuard uses this technique.

Object-code instrumentation takes a ready-to-run executable module and inserts additional code into it, based on an object-code-level analysis of the program flow. Pure Software's Purify is the prime example of this instrumentation technique.

Run-time instrumentation, finally, defers instrumentation to the time when the executable program image is loaded into memory, and only then modifies entry points or uses notifications (including processor exceptions) to get control at critical points. BoundsChecker uses this mode of instrumentation.

-- R.v.d.W.

Copyright © 1997, Dr. Dobb's Journal

Related Reading

More Insights

Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.