op_sim_debug()

Abstract

Determines if the simulation is currently in debug mode.

Syntax

op_sim_debug ()
Argument Type Description
no arguments

Return Type

Boolean

Boolean value indicating if the simulation is currently running under the OPNET debugger. This value is OPC_TRUE if in debug mode, OPC_FALSE if not in debug mode.

Example

/* obtain the arriving packet */
pkptr = op_pk_get (INSTRM_MAC);

/* if in debug mode, print out the arriving packet */
if (op_sim_debug () == OPC_TRUE)
	{
	printf ("-----------------------------------------------\n");
	printf ("Time (%g): Module (LLC): Packet Arriving\n", op_sim_time ());
	printf ("-----------------------------------------------\n");

	op_pk_print (pkptr);
	}

Details

A simulation is in debug mode when it is executed with the debug environment attribute enabled, as shown in the example command line below:

%example.sim -debug

Purpose

Provides a mechanism to determine if the simulation has been executed with the debug flag enabled. This KP is usually invoked in the conditional clause of an if statement, to bracket a group of statements which should only be executed if the simulation is in debug mode. Typically the bracketed statements will print out optional debugging and tracing information to the standard output device, which is useful whenever the simulation is being analyzed for bugs or possible low-level behavioral enhancements.

Errors

  • No errors are trapped.

Reference

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · Documentation compiled and provided by Beijing ZNetLink Technology Co., Ltd.

交流群 · QQ Group:OPNET/智网妙算网络仿真交流群(群号 486383494)

原文档 © 2017 Riverbed Technology · 本站为公益翻译,由 AI 辅助完成,请仔细甄别

Original documentation © 2017 Riverbed Technology. Community translation, AI-assisted. Contact: jiazequn@znetlink.com