Added some missing API for address resolving within a module, and looking
up a seciton offset address (SBAddress) within a module that returns a
symbol context (SBSymbolContext). Also added a SBSymbolContextList in
preparation for adding find/lookup APIs that can return multiple results.
Added a lookup example code that shows how to do address lookups.
llvm-svn: 113599
diff --git a/lldb/source/Core/Timer.cpp b/lldb/source/Core/Timer.cpp
index 542cbe4..a5420c1 100644
--- a/lldb/source/Core/Timer.cpp
+++ b/lldb/source/Core/Timer.cpp
@@ -20,6 +20,7 @@
using namespace lldb_private;
#define TIMER_INDENT_AMOUNT 2
+static bool g_quiet = true;
uint32_t Timer::g_depth = 0;
uint32_t Timer::g_display_depth = 0;
FILE * Timer::g_file = NULL;
@@ -78,16 +79,19 @@
{
if (g_depth++ < g_display_depth)
{
- // Indent
- ::fprintf (g_file, "%*s", g_depth * TIMER_INDENT_AMOUNT, "");
- // Print formatted string
- va_list args;
- va_start (args, format);
- ::vfprintf (g_file, format, args);
- va_end (args);
+ if (g_quiet == false)
+ {
+ // Indent
+ ::fprintf (g_file, "%*s", g_depth * TIMER_INDENT_AMOUNT, "");
+ // Print formatted string
+ va_list args;
+ va_start (args, format);
+ ::vfprintf (g_file, format, args);
+ va_end (args);
- // Newline
- ::fprintf (g_file, "\n");
+ // Newline
+ ::fprintf (g_file, "\n");
+ }
TimeValue start_time(TimeValue::Now());
m_total_start = start_time;
m_timer_start = start_time;
@@ -133,11 +137,16 @@
const uint64_t timer_nsec_uint = GetTimerElapsedNanoSeconds();
const double total_nsec = total_nsec_uint;
const double timer_nsec = timer_nsec_uint;
- ::fprintf (g_file,
- "%*s%.9f sec (%.9f sec)\n",
- (g_depth - 1) *TIMER_INDENT_AMOUNT, "",
- total_nsec / 1000000000.0,
- timer_nsec / 1000000000.0);
+
+ if (g_quiet == false)
+ {
+
+ ::fprintf (g_file,
+ "%*s%.9f sec (%.9f sec)\n",
+ (g_depth - 1) *TIMER_INDENT_AMOUNT, "",
+ total_nsec / 1000000000.0,
+ timer_nsec / 1000000000.0);
+ }
// Keep total results for each category so we can dump results.
Mutex::Locker locker (GetCategoryMutex());