1/* 2 * Copyright (c) 2001-2005 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 233 unchanged lines hidden (view full) --- 242// 243// C-linkage functions for invoking from gdb 244// 245///////////////////////////////////////////// 246 247// 248// Dump trace buffer to specified file (cout if NULL) 249// |
250void 251dumpTrace(const char *filename) 252{ 253 if (filename != NULL) { 254 ofstream out(filename); 255 Trace::theLog.dump(out); 256 out.close(); 257 } --- 5 unchanged lines hidden (view full) --- 263 264// 265// Turn on/off trace output to cerr. Typically used when trace output 266// is only going to circular buffer, but you want to see what's being 267// sent there as you step through some code in gdb. This uses the 268// same facility as the "trace to file" feature, and will print error 269// messages rather than clobbering an existing ostream pointer. 270// |
271void 272echoTrace(bool on) 273{ 274 if (on) { 275 if (Trace::dprintf_stream != NULL) { 276 cerr << "Already echoing trace to a file... go do a 'tail -f'" 277 << " on that file instead." << endl; 278 } else { 279 Trace::dprintf_stream = &cerr; 280 } 281 } else { 282 if (Trace::dprintf_stream != &cerr) { 283 cerr << "Not echoing trace to cerr." << endl; 284 } else { 285 Trace::dprintf_stream = NULL; 286 } 287 } 288} 289 |
290void 291printTraceFlags() 292{ 293 using namespace Trace; 294 for (int i = 0; i < numFlagStrings; ++i) 295 if (flags[i]) 296 cprintf("%s\n", flagStrings[i]); 297} --- 32 unchanged lines hidden (view full) --- 330 331 cprintf("flag %s was %s\n", string, value ? "set" : "cleared"); 332 return; 333 } 334 335 cprintf("could not find flag %s\n", string); 336} 337 |
338void 339setTraceFlag(const char *string) 340{ 341 tweakTraceFlag(string, true); 342} 343 |
344void 345clearTraceFlag(const char *string) 346{ 347 tweakTraceFlag(string, false); 348} |