Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Native and Non-native code

325 views
Skip to first unread message

Arun T.

unread,
Jun 2, 2017, 9:30:30 AM6/2/17
to
Hello All,

Do you know exact difference between native and Non-native code.
One more thing, I am familiar with debugging native code using inspect but don't how to debug non-native code?

Thanks in advance!
Arun

Keith Dick

unread,
Jun 2, 2017, 3:33:59 PM6/2/17
to
Native code refers to an executable program that was compiled directly to the CPU instructions of the computer it is running on. In the case of NonStop systems today, that would be either the Itanium instructions for the H-series and J-series systems, or the x86 instructions for the L-series systems.

Non-native code refers to an executable program that was compiled to the CPU instructions of the original Tandem architecture of the late 1970s and 1980s. When such a program is run, it cannot execute directly on the CPU of the computer it is running on. The NonStop operating system includes an interpreter for that original Tandem architecture, which is used to run such non-native code. Non-native programs can be accelerated with a program provided in the NonStop operating system. The accelerator program reads the original Tandem architecture code of the program and produces code that emulates the operation of that original program using the CPU instructions of the computer the program is to be run on. This converted version of the program is stored in the same object file as the original non-native code, and when such an accelerated program is run, the operating system runs that accelerated version of the program rather than running the original Tandem architecture cod
e with the interpreter. (There are some ambiguous situations that can occur during execution of the accelerated program in which the accelerated code drops back to the interpreter for a few statements, but execution usually quickly resumes in the accelerated code.)

Native code executes the fastest. Interpreted non-native code runs the slowest. Accelerated code generally runs at a speed in between, closer to native code speed than to interpreted speed, but definitely not as fast as native code. For most typical transaction processing systems, the difference in speed is not very important, since most of the instructions executed when running a program are executed in the operating system and system library code, which is native code. Occasionally, you will encounter a program that does spend a larger proportion of its time executing in the user-written code, and in those cases, accelerating the program or converting it to native mode can make a large improvement in run time. However, there are non-performance reasons to prefer using native code. The original Tandem architecture has kind of modest limits on code space and data space, which users occasionally encounter. Native code has much larger code and data space available. Als
o, at least for the C and C++ languages, the native mode compilers do a better job of supporting the language standards than the non-native compilers do, which can make dealing with portable code go much easier.

Non-native code can be debugged with the original Inspect debugger. I believe the Visual Inspect debugger also still works for debugging non-native code. I think the operating system knows enough to activate Inspect or Visual Inspect when a debug event occurs in a non-native program, so you should get put into a debugger appropriate for debugging non-native code automatically. If you get put into native Inspect for a non-native program, I believe native Inspect has a switch command that you can use to transfer the debugging session from native Inspect to the original Inspect.

The commands for the original Inspect are mostly quite different from those of native Inspect. If you want to learn to use the original Inspect, the HPE online NonStop manual set includes one titled simply "Inspect Manual". Folks here can answer questions you might have about using the original Inspect, but it would be too much writing to try to teach you how to use the original Inspect in this post.

dave....@gmail.com

unread,
Jun 2, 2017, 5:22:04 PM6/2/17
to
You could use Visual Inspect which is the same presentation and command set regardless of the object type.

Arun T.

unread,
Jun 5, 2017, 4:59:04 AM6/5/17
to
Thanks a lot Keith
0 new messages