Added --trace-read=<property> and --trace-write=<property> options.
These will log trace messages whenever a specific property value is read or written through the property manager. They do not cause FlightGear to poll bound values, so if a class variable that is bound is changed directly, no trace message will be displayed. These options are also useful in conjunction with a debugger. --trace-read will cause the private SimGear SGPropertyNode::trace_read method to be invoked, and --trace-write will cause the private SimGear SGPropertyNode::trace_write method to be invoked; in a debugger session, a user can set breakpoints on these methods then get a backtrace to see what specific points in the code are reading or writing properties.
This commit is contained in:
parent
2f66d01298
commit
18b1b4f7af
1 changed files with 10 additions and 2 deletions
|
@ -839,9 +839,17 @@ parse_option (const string& arg)
|
||||||
fgSetString(name.c_str(), value);
|
fgSetString(name.c_str(), value);
|
||||||
// SG_LOG(SG_GENERAL, SG_INFO, "Setting default value of property "
|
// SG_LOG(SG_GENERAL, SG_INFO, "Setting default value of property "
|
||||||
// << name << " to \"" << value << '"');
|
// << name << " to \"" << value << '"');
|
||||||
// $$$ begin - added VS Renganathan, 14 Oct 2K
|
} else if ( arg.find("--trace-read=") == 0) {
|
||||||
// for multi-window outside window imagery
|
string name = arg.substr(13);
|
||||||
|
SG_LOG(SG_GENERAL, SG_INFO, "Tracing reads for property " << name);
|
||||||
|
fgGetNode(name, true)->setAttribute(SGPropertyNode::TRACE_READ, true);
|
||||||
|
} else if ( arg.find("--trace-write=") == 0) {
|
||||||
|
string name = arg.substr(14);
|
||||||
|
SG_LOG(SG_GENERAL, SG_INFO, "Tracing writes for property " << name);
|
||||||
|
fgGetNode(name, true)->setAttribute(SGPropertyNode::TRACE_WRITE, true);
|
||||||
} else if ( arg.find( "--view-offset=" ) == 0 ) {
|
} else if ( arg.find( "--view-offset=" ) == 0 ) {
|
||||||
|
// $$$ begin - added VS Renganathan, 14 Oct 2K
|
||||||
|
// for multi-window outside window imagery
|
||||||
string woffset = arg.substr( 14 );
|
string woffset = arg.substr( 14 );
|
||||||
double default_view_offset = 0.0;
|
double default_view_offset = 0.0;
|
||||||
if ( woffset == "LEFT" ) {
|
if ( woffset == "LEFT" ) {
|
||||||
|
|
Loading…
Reference in a new issue