From 81c22f6104a391f4b3c9f072cf8cfd47b746367d Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Wed, 19 Oct 2011 18:09:39 +0000 Subject: [PATCH] Moved lldb::user_id_t values to be 64 bit. This was going to be needed for process IDs, and thread IDs, but was mainly needed for for the UserID's for Types so that DWARF with debug map can work flawlessly. With DWARF in .o files the type ID was the DIE offset in the DWARF for the .o file which is not unique across all .o files, so now the SymbolFileDWARFDebugMap class will make the .o file index part (the high 32 bits) of the unique type identifier so it can uniquely identify the types. llvm-svn: 142534 --- lldb/include/lldb/Symbol/Symbol.h | 21 +- lldb/include/lldb/Target/Process.h | 12 +- lldb/include/lldb/lldb-defines.h | 2 +- lldb/include/lldb/lldb-types.h | 2 +- lldb/lldb.xcodeproj/project.pbxproj | 2 +- lldb/source/API/SBBlock.cpp | 2 +- lldb/source/API/SBDebugger.cpp | 2 +- lldb/source/API/SBFunction.cpp | 6 +- lldb/source/API/SBProcess.cpp | 6 +- lldb/source/API/SBThread.cpp | 2 +- lldb/source/Commands/CommandObjectProcess.cpp | 16 +- lldb/source/Commands/CommandObjectTarget.cpp | 4 +- lldb/source/Commands/CommandObjectThread.cpp | 14 +- lldb/source/Core/Address.cpp | 2 +- lldb/source/Core/Debugger.cpp | 6 +- lldb/source/Core/Section.cpp | 2 +- lldb/source/Core/UserID.cpp | 2 +- .../Interpreter/ScriptInterpreterPython.cpp | 6 +- .../Process/MacOSX-Kernel/ProcessKDP.cpp | 16 +- .../Process/MacOSX-Kernel/ThreadKDP.cpp | 2 +- .../gdb-remote/GDBRemoteRegisterContext.cpp | 14 +- .../Process/gdb-remote/ProcessGDBRemote.cpp | 34 ++-- .../Process/gdb-remote/ThreadGDBRemote.cpp | 2 +- .../SymbolFile/DWARF/SymbolFileDWARF.cpp | 183 ++++++++++-------- .../SymbolFile/DWARF/SymbolFileDWARF.h | 17 +- .../DWARF/SymbolFileDWARFDebugMap.cpp | 48 ++++- .../DWARF/SymbolFileDWARFDebugMap.h | 10 + lldb/source/Symbol/Block.cpp | 8 +- lldb/source/Symbol/CompileUnit.cpp | 2 +- lldb/source/Symbol/Function.cpp | 4 +- lldb/source/Symbol/Symbol.cpp | 32 ++- lldb/source/Symbol/SymbolContext.cpp | 6 +- lldb/source/Symbol/Type.cpp | 2 +- lldb/source/Target/Process.cpp | 32 +-- lldb/source/Target/StackID.cpp | 2 +- lldb/source/Target/Target.cpp | 6 +- lldb/source/Target/Thread.cpp | 24 +-- lldb/source/Target/ThreadList.cpp | 12 +- lldb/source/Target/ThreadPlan.cpp | 2 +- lldb/source/Target/ThreadPlanBase.cpp | 6 +- lldb/source/Target/ThreadPlanCallFunction.cpp | 4 +- lldb/source/Target/ThreadPlanRunToAddress.cpp | 2 +- .../Target/ThreadPlanStepOverBreakpoint.cpp | 2 +- 43 files changed, 347 insertions(+), 234 deletions(-) diff --git a/lldb/include/lldb/Symbol/Symbol.h b/lldb/include/lldb/Symbol/Symbol.h index 60b7052ac9f4..d8898e97cf39 100644 --- a/lldb/include/lldb/Symbol/Symbol.h +++ b/lldb/include/lldb/Symbol/Symbol.h @@ -19,7 +19,6 @@ namespace lldb_private { class Symbol : - public UserID, // Used to uniquely identify this symbol in its symbol table public SymbolContextScope { public: @@ -28,7 +27,7 @@ public: // and sorting requirements. Symbol(); - Symbol (lldb::user_id_t symID, + Symbol (uint32_t symID, const char *name, bool name_is_mangled, lldb::SymbolType type, @@ -41,7 +40,7 @@ public: uint32_t size, uint32_t flags); - Symbol (lldb::user_id_t symID, + Symbol (uint32_t symID, const char *name, bool name_is_mangled, lldb::SymbolType type, @@ -57,6 +56,9 @@ public: const Symbol& operator= (const Symbol& rhs); + void + Clear(); + bool Compare (const ConstString& name, lldb::SymbolType type) const; @@ -78,6 +80,18 @@ public: const ConstString & GetName () { return m_mangled.GetName(); } + uint32_t + GetID() const + { + return m_uid; + } + + void + SetID(uint32_t uid) + { + m_uid = uid; + } + Mangled& GetMangled () { return m_mangled; } @@ -188,6 +202,7 @@ public: protected: + uint32_t m_uid; // User ID (usually the original symbol table index) Mangled m_mangled; // uniqued symbol name/mangled name pair lldb::SymbolType m_type; // symbol type uint16_t m_type_data; // data specific to m_type diff --git a/lldb/include/lldb/Target/Process.h b/lldb/include/lldb/Target/Process.h index 35ddb603dba1..b2e63c0c95d7 100644 --- a/lldb/include/lldb/Target/Process.h +++ b/lldb/include/lldb/Target/Process.h @@ -245,8 +245,8 @@ public: m_executable (), m_arguments (), m_environment (), - m_uid (LLDB_INVALID_UID), - m_gid (LLDB_INVALID_UID), + m_uid (UINT32_MAX), + m_gid (UINT32_MAX), m_arch(), m_pid (LLDB_INVALID_PROCESS_ID) { @@ -258,8 +258,8 @@ public: m_executable (name, false), m_arguments (), m_environment(), - m_uid (LLDB_INVALID_UID), - m_gid (LLDB_INVALID_UID), + m_uid (UINT32_MAX), + m_gid (UINT32_MAX), m_arch (arch), m_pid (pid) { @@ -271,8 +271,8 @@ public: m_executable.Clear(); m_arguments.Clear(); m_environment.Clear(); - m_uid = LLDB_INVALID_UID; - m_gid = LLDB_INVALID_UID; + m_uid = UINT32_MAX; + m_gid = UINT32_MAX; m_arch.Clear(); m_pid = LLDB_INVALID_PROCESS_ID; } diff --git a/lldb/include/lldb/lldb-defines.h b/lldb/include/lldb/lldb-defines.h index d9db639be44c..58462cffc09f 100644 --- a/lldb/include/lldb/lldb-defines.h +++ b/lldb/include/lldb/lldb-defines.h @@ -72,7 +72,7 @@ #define LLDB_INVALID_IVAR_OFFSET UINT32_MAX #define LLDB_INVALID_IMAGE_TOKEN UINT32_MAX #define LLDB_INVALID_REGNUM UINT32_MAX -#define LLDB_INVALID_UID UINT32_MAX +#define LLDB_INVALID_UID UINT64_MAX #define LLDB_INVALID_PROCESS_ID 0 #define LLDB_INVALID_THREAD_ID 0 #define LLDB_INVALID_FRAME_ID UINT32_MAX diff --git a/lldb/include/lldb/lldb-types.h b/lldb/include/lldb/lldb-types.h index e6997ad8c234..827beb1a2b07 100644 --- a/lldb/include/lldb/lldb-types.h +++ b/lldb/include/lldb/lldb-types.h @@ -96,7 +96,7 @@ const lldb::thread_t lldb_invalid_host_thread_const = { NULL, 0 } ; namespace lldb { typedef uint64_t addr_t; - typedef uint32_t user_id_t; + typedef uint64_t user_id_t; typedef int32_t pid_t; typedef uint32_t tid_t; typedef int32_t break_id_t; diff --git a/lldb/lldb.xcodeproj/project.pbxproj b/lldb/lldb.xcodeproj/project.pbxproj index 666ee999feb2..912919423086 100644 --- a/lldb/lldb.xcodeproj/project.pbxproj +++ b/lldb/lldb.xcodeproj/project.pbxproj @@ -3581,7 +3581,7 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; ARCHS = "$(ARCHS_STANDARD_64_BIT)"; - DEBUG_INFORMATION_FORMAT = dwarf; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( diff --git a/lldb/source/API/SBBlock.cpp b/lldb/source/API/SBBlock.cpp index 5374a7f86ba7..580d2b5a2135 100644 --- a/lldb/source/API/SBBlock.cpp +++ b/lldb/source/API/SBBlock.cpp @@ -174,7 +174,7 @@ SBBlock::GetDescription (SBStream &description) if (m_opaque_ptr) { lldb::user_id_t id = m_opaque_ptr->GetID(); - description.Printf ("Block: {id: %d} ", id); + description.Printf ("Block: {id: %llu} ", id); if (IsInlined()) { description.Printf (" (inlined, '%s') ", GetInlinedName()); diff --git a/lldb/source/API/SBDebugger.cpp b/lldb/source/API/SBDebugger.cpp index f71b8604bc95..dfef7eb3178d 100644 --- a/lldb/source/API/SBDebugger.cpp +++ b/lldb/source/API/SBDebugger.cpp @@ -969,7 +969,7 @@ SBDebugger::GetDescription (SBStream &description) { const char *name = m_opaque_sp->GetInstanceName().AsCString(); user_id_t id = m_opaque_sp->GetID(); - description.Printf ("Debugger (instance: \"%s\", id: %d)", name, id); + description.Printf ("Debugger (instance: \"%s\", id: %llu)", name, id); } else description.Printf ("No value"); diff --git a/lldb/source/API/SBFunction.cpp b/lldb/source/API/SBFunction.cpp index e037f83e8da6..4e23b9dfb493 100644 --- a/lldb/source/API/SBFunction.cpp +++ b/lldb/source/API/SBFunction.cpp @@ -107,9 +107,9 @@ SBFunction::GetDescription (SBStream &s) { if (m_opaque_ptr) { - s.Printf ("SBFunction: id = 0x%8.8x, name = %s", - m_opaque_ptr->GetID(), - m_opaque_ptr->GetName().AsCString()); + s.Printf ("SBFunction: id = 0x%8.8llx, name = %s", + m_opaque_ptr->GetID(), + m_opaque_ptr->GetName().AsCString()); Type *func_type = m_opaque_ptr->GetType(); if (func_type) s.Printf(", type = %s", func_type->GetName().AsCString()); diff --git a/lldb/source/API/SBProcess.cpp b/lldb/source/API/SBProcess.cpp index c9062bd0a212..7e04d5af1598 100644 --- a/lldb/source/API/SBProcess.cpp +++ b/lldb/source/API/SBProcess.cpp @@ -303,7 +303,7 @@ SBProcess::ReportEventState (const SBEvent &event, FILE *out) const char message[1024]; int message_len = ::snprintf (message, sizeof (message), - "Process %d %s\n", + "Process %llu %s\n", m_opaque_sp->GetID(), SBDebugger::StateAsCString (event_state)); @@ -321,7 +321,7 @@ SBProcess::AppendEventStateReport (const SBEvent &event, SBCommandReturnObject & char message[1024]; ::snprintf (message, sizeof (message), - "Process %d %s\n", + "Process %llu %s\n", m_opaque_sp->GetID(), SBDebugger::StateAsCString (event_state)); @@ -809,7 +809,7 @@ SBProcess::GetDescription (SBStream &description) if (exe_module) exe_name = exe_module->GetFileSpec().GetFilename().AsCString(); - description.Printf ("SBProcess: pid = %d, state = %s, threads = %d%s%s", + description.Printf ("SBProcess: pid = %llu, state = %s, threads = %d%s%s", m_opaque_sp->GetID(), lldb_private::StateAsCString (GetState()), GetNumThreads(), diff --git a/lldb/source/API/SBThread.cpp b/lldb/source/API/SBThread.cpp index 6b498c12a920..6c24e9809829 100644 --- a/lldb/source/API/SBThread.cpp +++ b/lldb/source/API/SBThread.cpp @@ -954,7 +954,7 @@ SBThread::GetDescription (SBStream &description) const if (m_opaque_sp) { StreamString strm; - description.Printf("SBThread: tid = 0x%4.4x", m_opaque_sp->GetID()); + description.Printf("SBThread: tid = 0x%4.4llx", m_opaque_sp->GetID()); } else description.Printf ("No value"); diff --git a/lldb/source/Commands/CommandObjectProcess.cpp b/lldb/source/Commands/CommandObjectProcess.cpp index 72aba1c7c0d3..0cea39c8754a 100644 --- a/lldb/source/Commands/CommandObjectProcess.cpp +++ b/lldb/source/Commands/CommandObjectProcess.cpp @@ -323,7 +323,7 @@ public: { const char *archname = exe_module->GetArchitecture().GetArchitectureName(); - result.AppendMessageWithFormat ("Process %i launched: '%s' (%s)\n", process->GetID(), filename, archname); + result.AppendMessageWithFormat ("Process %llu launched: '%s' (%s)\n", process->GetID(), filename, archname); result.SetDidChangeProcessState (true); if (m_options.stop_at_entry == false) { @@ -573,7 +573,7 @@ public: state = process->GetState(); if (process->IsAlive() && state != eStateConnected) { - result.AppendErrorWithFormat ("Process %u is currently being debugged, kill the process before attaching.\n", + result.AppendErrorWithFormat ("Process %llu is currently being debugged, kill the process before attaching.\n", process->GetID()); result.SetStatus (eReturnStatusFailed); return false; @@ -676,7 +676,7 @@ public: StateType state = process->WaitForProcessToStop (NULL); result.SetDidChangeProcessState (true); - result.AppendMessageWithFormat ("Process %i %s\n", process->GetID(), StateAsCString (state)); + result.AppendMessageWithFormat ("Process %llu %s\n", process->GetID(), StateAsCString (state)); result.SetStatus (eReturnStatusSuccessFinishNoResult); } else @@ -728,7 +728,7 @@ public: StateType state = process->WaitForProcessToStop (NULL); result.SetDidChangeProcessState (true); - result.AppendMessageWithFormat ("Process %i %s\n", process->GetID(), StateAsCString (state)); + result.AppendMessageWithFormat ("Process %llu %s\n", process->GetID(), StateAsCString (state)); result.SetStatus (eReturnStatusSuccessFinishNoResult); } else @@ -859,13 +859,13 @@ public: Error error(process->Resume()); if (error.Success()) { - result.AppendMessageWithFormat ("Process %i resuming\n", process->GetID()); + result.AppendMessageWithFormat ("Process %llu resuming\n", process->GetID()); if (synchronous_execution) { state = process->WaitForProcessToStop (NULL); result.SetDidChangeProcessState (true); - result.AppendMessageWithFormat ("Process %i %s\n", process->GetID(), StateAsCString (state)); + result.AppendMessageWithFormat ("Process %llu %s\n", process->GetID(), StateAsCString (state)); result.SetStatus (eReturnStatusSuccessFinishNoResult); } else @@ -923,7 +923,7 @@ public: return false; } - result.AppendMessageWithFormat ("Detaching from process %i\n", process->GetID()); + result.AppendMessageWithFormat ("Detaching from process %llu\n", process->GetID()); Error error (process->Detach()); if (error.Success()) { @@ -1030,7 +1030,7 @@ public: { if (process->IsAlive()) { - result.AppendErrorWithFormat ("Process %u is currently being debugged, kill the process before connecting.\n", + result.AppendErrorWithFormat ("Process %llu is currently being debugged, kill the process before connecting.\n", process->GetID()); result.SetStatus (eReturnStatusFailed); return false; diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp index 53d002dd1a92..082332997bb6 100644 --- a/lldb/source/Commands/CommandObjectTarget.cpp +++ b/lldb/source/Commands/CommandObjectTarget.cpp @@ -3581,7 +3581,7 @@ public: case eInputReaderDone: if (!got_interrupted && !batch_mode) { - out_stream->Printf ("Stop hook #%d added.\n", new_stop_hook->GetID()); + out_stream->Printf ("Stop hook #%llu added.\n", new_stop_hook->GetID()); out_stream->Flush(); } break; @@ -3667,7 +3667,7 @@ public: { // Use one-liner. new_hook_sp->GetCommandPointer()->AppendString (m_options.m_one_liner.c_str()); - result.AppendMessageWithFormat("Stop hook #%d added.\n", new_hook_sp->GetID()); + result.AppendMessageWithFormat("Stop hook #%llu added.\n", new_hook_sp->GetID()); } else { diff --git a/lldb/source/Commands/CommandObjectThread.cpp b/lldb/source/Commands/CommandObjectThread.cpp index c7bf27622f83..fde747273324 100644 --- a/lldb/source/Commands/CommandObjectThread.cpp +++ b/lldb/source/Commands/CommandObjectThread.cpp @@ -546,7 +546,7 @@ public: // } process->GetThreadList().SetSelectedThreadByID (thread->GetID()); result.SetDidChangeProcessState (true); - result.AppendMessageWithFormat ("Process %i %s\n", process->GetID(), StateAsCString (state)); + result.AppendMessageWithFormat ("Process %llu %s\n", process->GetID(), StateAsCString (state)); result.SetStatus (eReturnStatusSuccessFinishNoResult); } } @@ -685,7 +685,7 @@ public: thread->SetResumeState (eStateSuspended); } } - result.AppendMessageWithFormat ("in process %i\n", process->GetID()); + result.AppendMessageWithFormat ("in process %llu\n", process->GetID()); } } else @@ -703,7 +703,7 @@ public: Thread *thread = process->GetThreadList().GetThreadAtIndex(idx).get(); if (thread == current_thread) { - result.AppendMessageWithFormat ("Resuming thread 0x%4.4x in process %i\n", thread->GetID(), process->GetID()); + result.AppendMessageWithFormat ("Resuming thread 0x%4.4llx in process %llu\n", thread->GetID(), process->GetID()); thread->SetResumeState (eStateRunning); } else @@ -716,13 +716,13 @@ public: Error error (process->Resume()); if (error.Success()) { - result.AppendMessageWithFormat ("Process %i resuming\n", process->GetID()); + result.AppendMessageWithFormat ("Process %llu resuming\n", process->GetID()); if (synchronous_execution) { state = process->WaitForProcessToStop (NULL); result.SetDidChangeProcessState (true); - result.AppendMessageWithFormat ("Process %i %s\n", process->GetID(), StateAsCString (state)); + result.AppendMessageWithFormat ("Process %llu %s\n", process->GetID(), StateAsCString (state)); result.SetStatus (eReturnStatusSuccessFinishNoResult); } else @@ -1043,13 +1043,13 @@ public: Error error (process->Resume ()); if (error.Success()) { - result.AppendMessageWithFormat ("Process %i resuming\n", process->GetID()); + result.AppendMessageWithFormat ("Process %llu resuming\n", process->GetID()); if (synchronous_execution) { StateType state = process->WaitForProcessToStop (NULL); result.SetDidChangeProcessState (true); - result.AppendMessageWithFormat ("Process %i %s\n", process->GetID(), StateAsCString (state)); + result.AppendMessageWithFormat ("Process %llu %s\n", process->GetID(), StateAsCString (state)); result.SetStatus (eReturnStatusSuccessFinishNoResult); } else diff --git a/lldb/source/Core/Address.cpp b/lldb/source/Core/Address.cpp index ffb90c9b664f..89131caddeae 100644 --- a/lldb/source/Core/Address.cpp +++ b/lldb/source/Core/Address.cpp @@ -703,7 +703,7 @@ Address::Dump (Stream *s, ExecutionContextScope *exe_scope, DumpStyle style, Dum Variable *var = variable_list.GetVariableAtIndex (var_idx).get(); if (var && var->LocationIsValidForAddress (*this)) { - s->Printf (" Variable: id = {0x%8.8x}, name = \"%s\", type= \"%s\", location =", + s->Printf (" Variable: id = {0x%8.8llx}, name = \"%s\", type= \"%s\", location =", var->GetID(), var->GetName().GetCString(), var->GetType()->GetName().GetCString()); diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp index c27559c3f5ef..45c0653b9d8c 100644 --- a/lldb/source/Core/Debugger.cpp +++ b/lldb/source/Core/Debugger.cpp @@ -1524,7 +1524,7 @@ Debugger::FormatPrompt var_name_begin += ::strlen ("process."); if (::strncmp (var_name_begin, "id}", strlen("id}")) == 0) { - s.Printf("%i", process->GetID()); + s.Printf("%llu", process->GetID()); var_success = true; } else if ((::strncmp (var_name_begin, "name}", strlen("name}")) == 0) || @@ -1562,7 +1562,7 @@ Debugger::FormatPrompt var_name_begin += ::strlen ("thread."); if (::strncmp (var_name_begin, "id}", strlen("id}")) == 0) { - s.Printf("0x%4.4x", thread->GetID()); + s.Printf("0x%4.4llx", thread->GetID()); var_success = true; } else if (::strncmp (var_name_begin, "index}", strlen("index}")) == 0) @@ -1733,7 +1733,7 @@ Debugger::FormatPrompt if (::strncmp (var_name_begin, "id}", strlen("id}")) == 0) { if (sc->function) - s.Printf("function{0x%8.8x}", sc->function->GetID()); + s.Printf("function{0x%8.8llx}", sc->function->GetID()); else s.Printf("symbol[%u]", sc->symbol->GetID()); diff --git a/lldb/source/Core/Section.cpp b/lldb/source/Core/Section.cpp index 60b3e15fccbe..b8b9ddf3d181 100644 --- a/lldb/source/Core/Section.cpp +++ b/lldb/source/Core/Section.cpp @@ -228,7 +228,7 @@ Section::Dump (Stream *s, Target *target, uint32_t depth) const { // s->Printf("%.*p: ", (int)sizeof(void*) * 2, this); s->Indent(); - s->Printf("0x%8.8x %-14s ", GetID(), GetSectionTypeAsCString (m_type)); + s->Printf("0x%8.8llx %-14s ", GetID(), GetSectionTypeAsCString (m_type)); bool resolved = true; addr_t addr = LLDB_INVALID_ADDRESS; diff --git a/lldb/source/Core/UserID.cpp b/lldb/source/Core/UserID.cpp index 29141100c3e5..ad042df8cbc4 100644 --- a/lldb/source/Core/UserID.cpp +++ b/lldb/source/Core/UserID.cpp @@ -20,6 +20,6 @@ UserID::~UserID () Stream& lldb_private::operator << (Stream& strm, const UserID& uid) { - strm.Printf("{0x%8.8x}", uid.GetID()); + strm.Printf("{0x%8.8llx}", uid.GetID()); return strm; } diff --git a/lldb/source/Interpreter/ScriptInterpreterPython.cpp b/lldb/source/Interpreter/ScriptInterpreterPython.cpp index f1f4a3255a38..6b71c82b4e8e 100644 --- a/lldb/source/Interpreter/ScriptInterpreterPython.cpp +++ b/lldb/source/Interpreter/ScriptInterpreterPython.cpp @@ -204,7 +204,7 @@ ScriptInterpreterPython::ScriptInterpreterPython (CommandInterpreter &interprete PyRun_SimpleString (run_string.GetData()); run_string.Clear(); - run_string.Printf ("run_one_line (%s, 'lldb.debugger_unique_id = %d')", m_dictionary_name.c_str(), + run_string.Printf ("run_one_line (%s, 'lldb.debugger_unique_id = %llu')", m_dictionary_name.c_str(), interpreter.GetDebugger().GetID()); PyRun_SimpleString (run_string.GetData()); @@ -306,13 +306,13 @@ ScriptInterpreterPython::EnterSession () StreamString run_string; - run_string.Printf ("run_one_line (%s, 'lldb.debugger_unique_id = %d')", m_dictionary_name.c_str(), + run_string.Printf ("run_one_line (%s, 'lldb.debugger_unique_id = %llu')", m_dictionary_name.c_str(), GetCommandInterpreter().GetDebugger().GetID()); PyRun_SimpleString (run_string.GetData()); run_string.Clear(); - run_string.Printf ("run_one_line (%s, 'lldb.debugger = lldb.SBDebugger.FindDebuggerWithID (%d)')", + run_string.Printf ("run_one_line (%s, 'lldb.debugger = lldb.SBDebugger.FindDebuggerWithID (%llu)')", m_dictionary_name.c_str(), GetCommandInterpreter().GetDebugger().GetID()); PyRun_SimpleString (run_string.GetData()); diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp index bca099c0242f..09350b30e007 100644 --- a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp +++ b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp @@ -294,7 +294,7 @@ ProcessKDP::UpdateThreadList (ThreadList &old_thread_list, ThreadList &new_threa // locker will keep a mutex locked until it goes out of scope LogSP log (ProcessKDPLog::GetLogIfAllCategoriesSet (KDP_LOG_THREAD)); if (log && log->GetMask().Test(KDP_LOG_VERBOSE)) - log->Printf ("ProcessKDP::%s (pid = %i)", __FUNCTION__, GetID()); + log->Printf ("ProcessKDP::%s (pid = %llu)", __FUNCTION__, GetID()); // We currently are making only one thread per core and we // actually don't know about actual threads. Eventually we @@ -698,7 +698,7 @@ ProcessKDP::AsyncThread (void *arg) LogSP log (ProcessKDPLog::GetLogIfAllCategoriesSet (KDP_LOG_PROCESS)); if (log) - log->Printf ("ProcessKDP::%s (arg = %p, pid = %i) thread starting...", __FUNCTION__, arg, process->GetID()); + log->Printf ("ProcessKDP::%s (arg = %p, pid = %llu) thread starting...", __FUNCTION__, arg, process->GetID()); Listener listener ("ProcessKDP::AsyncThread"); EventSP event_sp; @@ -713,14 +713,14 @@ ProcessKDP::AsyncThread (void *arg) while (!done) { if (log) - log->Printf ("ProcessKDP::%s (arg = %p, pid = %i) listener.WaitForEvent (NULL, event_sp)...", __FUNCTION__, arg, process->GetID()); + log->Printf ("ProcessKDP::%s (arg = %p, pid = %llu) listener.WaitForEvent (NULL, event_sp)...", __FUNCTION__, arg, process->GetID()); if (listener.WaitForEvent (NULL, event_sp)) { const uint32_t event_type = event_sp->GetType(); if (event_sp->BroadcasterIs (&process->m_async_broadcaster)) { if (log) - log->Printf ("ProcessKDP::%s (arg = %p, pid = %i) Got an event of type: %d...", __FUNCTION__, arg, process->GetID(), event_type); + log->Printf ("ProcessKDP::%s (arg = %p, pid = %llu) Got an event of type: %d...", __FUNCTION__, arg, process->GetID(), event_type); switch (event_type) { @@ -772,13 +772,13 @@ ProcessKDP::AsyncThread (void *arg) case eBroadcastBitAsyncThreadShouldExit: if (log) - log->Printf ("ProcessKDP::%s (arg = %p, pid = %i) got eBroadcastBitAsyncThreadShouldExit...", __FUNCTION__, arg, process->GetID()); + log->Printf ("ProcessKDP::%s (arg = %p, pid = %llu) got eBroadcastBitAsyncThreadShouldExit...", __FUNCTION__, arg, process->GetID()); done = true; break; default: if (log) - log->Printf ("ProcessKDP::%s (arg = %p, pid = %i) got unknown event 0x%8.8x", __FUNCTION__, arg, process->GetID(), event_type); + log->Printf ("ProcessKDP::%s (arg = %p, pid = %llu) got unknown event 0x%8.8x", __FUNCTION__, arg, process->GetID(), event_type); done = true; break; } @@ -795,14 +795,14 @@ ProcessKDP::AsyncThread (void *arg) else { if (log) - log->Printf ("ProcessKDP::%s (arg = %p, pid = %i) listener.WaitForEvent (NULL, event_sp) => false", __FUNCTION__, arg, process->GetID()); + log->Printf ("ProcessKDP::%s (arg = %p, pid = %llu) listener.WaitForEvent (NULL, event_sp) => false", __FUNCTION__, arg, process->GetID()); done = true; } } } if (log) - log->Printf ("ProcessKDP::%s (arg = %p, pid = %i) thread exiting...", __FUNCTION__, arg, process->GetID()); + log->Printf ("ProcessKDP::%s (arg = %p, pid = %llu) thread exiting...", __FUNCTION__, arg, process->GetID()); process->m_async_thread = LLDB_INVALID_HOST_THREAD; return NULL; diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp b/lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp index 3b37d7866f3c..6fb947087e57 100644 --- a/lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp +++ b/lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp @@ -76,7 +76,7 @@ ThreadKDP::WillResume (StateType resume_state) lldb::LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_STEP)); if (log) - log->Printf ("Resuming thread: %4.4x with state: %s.", GetID(), StateAsCString(resume_state)); + log->Printf ("Resuming thread: %4.4llx with state: %s.", GetID(), StateAsCString(resume_state)); // ProcessKDP &process = GetKDPProcess(); // switch (resume_state) diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp index 7d9a146df700..18d42c837685 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp @@ -179,7 +179,7 @@ GDBRemoteRegisterContext::ReadRegisterBytes (const RegisterInfo *reg_info, DataE { // Get all registers in one packet if (thread_suffix_supported) - packet_len = ::snprintf (packet, sizeof(packet), "g;thread:%4.4x;", m_thread.GetID()); + packet_len = ::snprintf (packet, sizeof(packet), "g;thread:%4.4llx;", m_thread.GetID()); else packet_len = ::snprintf (packet, sizeof(packet), "g"); assert (packet_len < (sizeof(packet) - 1)); @@ -195,7 +195,7 @@ GDBRemoteRegisterContext::ReadRegisterBytes (const RegisterInfo *reg_info, DataE // Get each register individually if (thread_suffix_supported) - packet_len = ::snprintf (packet, sizeof(packet), "p%x;thread:%4.4x;", reg, m_thread.GetID()); + packet_len = ::snprintf (packet, sizeof(packet), "p%x;thread:%4.4llx;", reg, m_thread.GetID()); else packet_len = ::snprintf (packet, sizeof(packet), "p%x", reg); assert (packet_len < (sizeof(packet) - 1)); @@ -282,7 +282,7 @@ GDBRemoteRegisterContext::WriteRegisterBytes (const lldb_private::RegisterInfo * lldb::endian::InlHostByteOrder()); if (thread_suffix_supported) - packet.Printf (";thread:%4.4x;", m_thread.GetID()); + packet.Printf (";thread:%4.4llx;", m_thread.GetID()); // Invalidate all register values InvalidateIfNeeded (true); @@ -309,7 +309,7 @@ GDBRemoteRegisterContext::WriteRegisterBytes (const lldb_private::RegisterInfo * lldb::endian::InlHostByteOrder()); if (thread_suffix_supported) - packet.Printf (";thread:%4.4x;", m_thread.GetID()); + packet.Printf (";thread:%4.4llx;", m_thread.GetID()); // Invalidate just this register m_reg_valid[reg] = false; @@ -346,7 +346,7 @@ GDBRemoteRegisterContext::ReadAllRegisterValues (lldb::DataBufferSP &data_sp) { int packet_len = 0; if (thread_suffix_supported) - packet_len = ::snprintf (packet, sizeof(packet), "g;thread:%4.4x", m_thread.GetID()); + packet_len = ::snprintf (packet, sizeof(packet), "g;thread:%4.4llx", m_thread.GetID()); else packet_len = ::snprintf (packet, sizeof(packet), "g"); assert (packet_len < (sizeof(packet) - 1)); @@ -363,7 +363,7 @@ GDBRemoteRegisterContext::ReadAllRegisterValues (lldb::DataBufferSP &data_sp) if (thread_suffix_supported) { char thread_id_cstr[64]; - ::snprintf (thread_id_cstr, sizeof(thread_id_cstr), ";thread:%4.4x;", m_thread.GetID()); + ::snprintf (thread_id_cstr, sizeof(thread_id_cstr), ";thread:%4.4llx;", m_thread.GetID()); response_str.append (thread_id_cstr); } data_sp.reset (new DataBufferHeap (response_str.c_str(), response_str.size())); @@ -457,7 +457,7 @@ GDBRemoteRegisterContext::WriteAllRegisterValues (const lldb::DataBufferSP &data lldb::endian::InlHostByteOrder()); if (thread_suffix_supported) - packet.Printf (";thread:%4.4x;", m_thread.GetID()); + packet.Printf (";thread:%4.4llx;", m_thread.GetID()); m_reg_valid[reg] = false; if (gdb_comm.SendPacketAndWaitForResponse(packet.GetString().c_str(), diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp index 7e2ad1c3b229..70147d4dce5d 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -1082,7 +1082,7 @@ ProcessGDBRemote::UpdateThreadList (ThreadList &old_thread_list, ThreadList &new // locker will keep a mutex locked until it goes out of scope LogSP log (ProcessGDBRemoteLog::GetLogIfAllCategoriesSet (GDBR_LOG_THREAD)); if (log && log->GetMask().Test(GDBR_LOG_VERBOSE)) - log->Printf ("ProcessGDBRemote::%s (pid = %i)", __FUNCTION__, GetID()); + log->Printf ("ProcessGDBRemote::%s (pid = %llu)", __FUNCTION__, GetID()); // Update the thread list's stop id immediately so we don't recurse into this function. std::vector thread_ids; @@ -1798,12 +1798,12 @@ ProcessGDBRemote::EnableBreakpoint (BreakpointSite *bp_site) user_id_t site_id = bp_site->GetID(); const addr_t addr = bp_site->GetLoadAddress(); if (log) - log->Printf ("ProcessGDBRemote::EnableBreakpoint (size_id = %d) address = 0x%llx", site_id, (uint64_t)addr); + log->Printf ("ProcessGDBRemote::EnableBreakpoint (size_id = %llu) address = 0x%llx", site_id, (uint64_t)addr); if (bp_site->IsEnabled()) { if (log) - log->Printf ("ProcessGDBRemote::EnableBreakpoint (size_id = %d) address = 0x%llx -- SUCCESS (already enabled)", site_id, (uint64_t)addr); + log->Printf ("ProcessGDBRemote::EnableBreakpoint (size_id = %llu) address = 0x%llx -- SUCCESS (already enabled)", site_id, (uint64_t)addr); return error; } else @@ -1860,7 +1860,7 @@ ProcessGDBRemote::DisableBreakpoint (BreakpointSite *bp_site) user_id_t site_id = bp_site->GetID(); LogSP log (ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_BREAKPOINTS)); if (log) - log->Printf ("ProcessGDBRemote::DisableBreakpoint (site_id = %d) addr = 0x%8.8llx", site_id, (uint64_t)addr); + log->Printf ("ProcessGDBRemote::DisableBreakpoint (site_id = %llu) addr = 0x%8.8llx", site_id, (uint64_t)addr); if (bp_site->IsEnabled()) { @@ -1889,7 +1889,7 @@ ProcessGDBRemote::DisableBreakpoint (BreakpointSite *bp_site) else { if (log) - log->Printf ("ProcessGDBRemote::DisableBreakpoint (site_id = %d) addr = 0x%8.8llx -- SUCCESS (already disabled)", site_id, (uint64_t)addr); + log->Printf ("ProcessGDBRemote::DisableBreakpoint (site_id = %llu) addr = 0x%8.8llx -- SUCCESS (already disabled)", site_id, (uint64_t)addr); return error; } @@ -1926,11 +1926,11 @@ ProcessGDBRemote::EnableWatchpoint (Watchpoint *wp) addr_t addr = wp->GetLoadAddress(); LogSP log (ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_WATCHPOINTS)); if (log) - log->Printf ("ProcessGDBRemote::EnableWatchpoint(watchID = %d)", watchID); + log->Printf ("ProcessGDBRemote::EnableWatchpoint(watchID = %llu)", watchID); if (wp->IsEnabled()) { if (log) - log->Printf("ProcessGDBRemote::EnableWatchpoint(watchID = %d) addr = 0x%8.8llx: watchpoint already enabled.", watchID, (uint64_t)addr); + log->Printf("ProcessGDBRemote::EnableWatchpoint(watchID = %llu) addr = 0x%8.8llx: watchpoint already enabled.", watchID, (uint64_t)addr); return error; } @@ -1970,12 +1970,12 @@ ProcessGDBRemote::DisableWatchpoint (Watchpoint *wp) addr_t addr = wp->GetLoadAddress(); if (log) - log->Printf ("ProcessGDBRemote::DisableWatchpoint (watchID = %d) addr = 0x%8.8llx", watchID, (uint64_t)addr); + log->Printf ("ProcessGDBRemote::DisableWatchpoint (watchID = %llu) addr = 0x%8.8llx", watchID, (uint64_t)addr); if (!wp->IsEnabled()) { if (log) - log->Printf ("ProcessGDBRemote::DisableWatchpoint (watchID = %d) addr = 0x%8.8llx -- SUCCESS (already disabled)", watchID, (uint64_t)addr); + log->Printf ("ProcessGDBRemote::DisableWatchpoint (watchID = %llu) addr = 0x%8.8llx -- SUCCESS (already disabled)", watchID, (uint64_t)addr); return error; } @@ -2307,7 +2307,7 @@ ProcessGDBRemote::AsyncThread (void *arg) LogSP log (ProcessGDBRemoteLog::GetLogIfAllCategoriesSet (GDBR_LOG_PROCESS)); if (log) - log->Printf ("ProcessGDBRemote::%s (arg = %p, pid = %i) thread starting...", __FUNCTION__, arg, process->GetID()); + log->Printf ("ProcessGDBRemote::%s (arg = %p, pid = %llu) thread starting...", __FUNCTION__, arg, process->GetID()); Listener listener ("ProcessGDBRemote::AsyncThread"); EventSP event_sp; @@ -2322,14 +2322,14 @@ ProcessGDBRemote::AsyncThread (void *arg) while (!done) { if (log) - log->Printf ("ProcessGDBRemote::%s (arg = %p, pid = %i) listener.WaitForEvent (NULL, event_sp)...", __FUNCTION__, arg, process->GetID()); + log->Printf ("ProcessGDBRemote::%s (arg = %p, pid = %llu) listener.WaitForEvent (NULL, event_sp)...", __FUNCTION__, arg, process->GetID()); if (listener.WaitForEvent (NULL, event_sp)) { const uint32_t event_type = event_sp->GetType(); if (event_sp->BroadcasterIs (&process->m_async_broadcaster)) { if (log) - log->Printf ("ProcessGDBRemote::%s (arg = %p, pid = %i) Got an event of type: %d...", __FUNCTION__, arg, process->GetID(), event_type); + log->Printf ("ProcessGDBRemote::%s (arg = %p, pid = %llu) Got an event of type: %d...", __FUNCTION__, arg, process->GetID(), event_type); switch (event_type) { @@ -2342,7 +2342,7 @@ ProcessGDBRemote::AsyncThread (void *arg) const char *continue_cstr = (const char *)continue_packet->GetBytes (); const size_t continue_cstr_len = continue_packet->GetByteSize (); if (log) - log->Printf ("ProcessGDBRemote::%s (arg = %p, pid = %i) got eBroadcastBitAsyncContinue: %s", __FUNCTION__, arg, process->GetID(), continue_cstr); + log->Printf ("ProcessGDBRemote::%s (arg = %p, pid = %llu) got eBroadcastBitAsyncContinue: %s", __FUNCTION__, arg, process->GetID(), continue_cstr); if (::strstr (continue_cstr, "vAttach") == NULL) process->SetPrivateState(eStateRunning); @@ -2379,13 +2379,13 @@ ProcessGDBRemote::AsyncThread (void *arg) case eBroadcastBitAsyncThreadShouldExit: if (log) - log->Printf ("ProcessGDBRemote::%s (arg = %p, pid = %i) got eBroadcastBitAsyncThreadShouldExit...", __FUNCTION__, arg, process->GetID()); + log->Printf ("ProcessGDBRemote::%s (arg = %p, pid = %llu) got eBroadcastBitAsyncThreadShouldExit...", __FUNCTION__, arg, process->GetID()); done = true; break; default: if (log) - log->Printf ("ProcessGDBRemote::%s (arg = %p, pid = %i) got unknown event 0x%8.8x", __FUNCTION__, arg, process->GetID(), event_type); + log->Printf ("ProcessGDBRemote::%s (arg = %p, pid = %llu) got unknown event 0x%8.8x", __FUNCTION__, arg, process->GetID(), event_type); done = true; break; } @@ -2402,14 +2402,14 @@ ProcessGDBRemote::AsyncThread (void *arg) else { if (log) - log->Printf ("ProcessGDBRemote::%s (arg = %p, pid = %i) listener.WaitForEvent (NULL, event_sp) => false", __FUNCTION__, arg, process->GetID()); + log->Printf ("ProcessGDBRemote::%s (arg = %p, pid = %llu) listener.WaitForEvent (NULL, event_sp) => false", __FUNCTION__, arg, process->GetID()); done = true; } } } if (log) - log->Printf ("ProcessGDBRemote::%s (arg = %p, pid = %i) thread exiting...", __FUNCTION__, arg, process->GetID()); + log->Printf ("ProcessGDBRemote::%s (arg = %p, pid = %llu) thread exiting...", __FUNCTION__, arg, process->GetID()); process->m_async_thread = LLDB_INVALID_HOST_THREAD; return NULL; diff --git a/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp index 7fe8cdeed3e1..49385916ad6c 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp @@ -77,7 +77,7 @@ ThreadGDBRemote::WillResume (StateType resume_state) int signo = GetResumeSignal(); lldb::LogSP log(lldb_private::GetLogIfAnyCategoriesSet (GDBR_LOG_THREAD)); if (log) - log->Printf ("Resuming thread: %4.4x with state: %s.", GetID(), StateAsCString(resume_state)); + log->Printf ("Resuming thread: %4.4llx with state: %s.", GetID(), StateAsCString(resume_state)); ProcessGDBRemote &process = GetGDBProcess(); switch (resume_state) diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp index bd68518933f1..0bbb27fa0b83 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -163,6 +163,7 @@ GetParentSymbolContextDIE(const DWARFDebugInfoEntry *child_die) SymbolFileDWARF::SymbolFileDWARF(ObjectFile* objfile) : SymbolFile (objfile), + UserID (0), // Used by SymbolFileDWARFDebugMap to when this class parses .o files to contain the .o file index/ID m_debug_map_symfile (NULL), m_clang_tu_decl (NULL), m_flags(), @@ -551,8 +552,8 @@ DWARFCompileUnit* SymbolFileDWARF::GetDWARFCompileUnitForUID(lldb::user_id_t cu_uid) { DWARFDebugInfo* info = DebugInfo(); - if (info) - return info->GetCompileUnit(cu_uid).get(); + if (info && UserIDMatches(cu_uid)) + return info->GetCompileUnit((dw_offset_t)cu_uid).get(); return NULL; } @@ -609,7 +610,11 @@ SymbolFileDWARF::ParseCompileUnit (DWARFCompileUnit* curr_cu, CompUnitSP& compil cu_file_spec.SetFile (fullpath.c_str(), false); } - compile_unit_sp.reset(new CompileUnit(m_obj_file->GetModule(), curr_cu, cu_file_spec, curr_cu->GetOffset(), cu_language)); + compile_unit_sp.reset(new CompileUnit (m_obj_file->GetModule(), + curr_cu, + cu_file_spec, + MakeUserID(curr_cu->GetOffset()), + cu_language)); if (compile_unit_sp.get()) { curr_cu->SetUserData(compile_unit_sp.get()); @@ -722,9 +727,10 @@ SymbolFileDWARF::ParseCompileUnitFunction (const SymbolContext& sc, DWARFCompile func_range.GetBaseAddress().ResolveLinkedAddress(); + const user_id_t func_user_id = MakeUserID(die->GetOffset()); func_sp.reset(new Function (sc.comp_unit, - die->GetOffset(), // UserID is the DIE offset - die->GetOffset(), + func_user_id, // UserID is the DIE offset + func_user_id, func_name, func_type, func_range)); // first address range @@ -755,7 +761,7 @@ SymbolFileDWARF::ParseCompileUnitFunctions(const SymbolContext &sc) for (func_idx = 0; func_idx < num_funtions; ++func_idx) { const DWARFDebugInfoEntry *die = function_dies.GetDIEPtrAtIndex(func_idx); - if (sc.comp_unit->FindFunctionByUID (die->GetOffset()).get() == NULL) + if (sc.comp_unit->FindFunctionByUID (MakeUserID(die->GetOffset())).get() == NULL) { if (ParseCompileUnitFunction(sc, dwarf_cu, die)) ++functions_added; @@ -1030,7 +1036,7 @@ SymbolFileDWARF::ParseFunctionBlocks } else { - BlockSP block_sp(new Block (die->GetOffset())); + BlockSP block_sp(new Block (MakeUserID(die->GetOffset()))); parent_block->AddChild(block_sp); block = block_sp.get(); } @@ -1248,13 +1254,13 @@ SymbolFileDWARF::ParseChildMembers else { if (name) - ReportError ("0x%8.8x: DW_TAG_member '%s' refers to type 0x%8.8x which was unable to be parsed", - die->GetOffset(), + ReportError ("0x%8.8llx: DW_TAG_member '%s' refers to type 0x%8.8llx which was unable to be parsed", + MakeUserID(die->GetOffset()), name, encoding_uid); else - ReportError ("0x%8.8x: DW_TAG_member refers to type 0x%8.8x which was unable to be parsed", - die->GetOffset(), + ReportError ("0x%8.8llx: DW_TAG_member refers to type 0x%8.8llx which was unable to be parsed", + MakeUserID(die->GetOffset()), encoding_uid); } } @@ -1371,7 +1377,7 @@ clang::DeclContext* SymbolFileDWARF::GetClangDeclContextContainingTypeUID (lldb::user_id_t type_uid) { DWARFDebugInfo* debug_info = DebugInfo(); - if (debug_info) + if (debug_info && UserIDMatches(type_uid)) { DWARFCompileUnitSP cu_sp; const DWARFDebugInfoEntry* die = debug_info->GetDIEPtr(type_uid, &cu_sp); @@ -1384,32 +1390,37 @@ SymbolFileDWARF::GetClangDeclContextContainingTypeUID (lldb::user_id_t type_uid) clang::DeclContext* SymbolFileDWARF::GetClangDeclContextForTypeUID (const lldb_private::SymbolContext &sc, lldb::user_id_t type_uid) { - return GetClangDeclContextForDIEOffset (sc, type_uid); + if (UserIDMatches(type_uid)) + return GetClangDeclContextForDIEOffset (sc, type_uid); + return NULL; } Type* SymbolFileDWARF::ResolveTypeUID (lldb::user_id_t type_uid) { - DWARFDebugInfo* debug_info = DebugInfo(); - if (debug_info) + if (UserIDMatches(type_uid)) { - DWARFCompileUnitSP cu_sp; - const DWARFDebugInfoEntry* type_die = debug_info->GetDIEPtr(type_uid, &cu_sp); - if (type_die != NULL) + DWARFDebugInfo* debug_info = DebugInfo(); + if (debug_info) { - // We might be coming in in the middle of a type tree (a class - // withing a class, an enum within a class), so parse any needed - // parent DIEs before we get to this one... - const DWARFDebugInfoEntry *decl_ctx_die = GetDeclContextDIEContainingDIE (cu_sp.get(), type_die); - switch (decl_ctx_die->Tag()) + DWARFCompileUnitSP cu_sp; + const DWARFDebugInfoEntry* type_die = debug_info->GetDIEPtr(type_uid, &cu_sp); + if (type_die != NULL) { - case DW_TAG_structure_type: - case DW_TAG_union_type: - case DW_TAG_class_type: - ResolveType(cu_sp.get(), decl_ctx_die); - break; + // We might be coming in in the middle of a type tree (a class + // withing a class, an enum within a class), so parse any needed + // parent DIEs before we get to this one... + const DWARFDebugInfoEntry *decl_ctx_die = GetDeclContextDIEContainingDIE (cu_sp.get(), type_die); + switch (decl_ctx_die->Tag()) + { + case DW_TAG_structure_type: + case DW_TAG_union_type: + case DW_TAG_class_type: + ResolveType(cu_sp.get(), decl_ctx_die); + break; + } + return ResolveType (cu_sp.get(), type_die); } - return ResolveType (cu_sp.get(), type_die); } } return NULL; @@ -1456,8 +1467,8 @@ SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (lldb::clang_type_t clang_type const dw_tag_t tag = die->Tag(); - DEBUG_PRINTF ("0x%8.8x: %s (\"%s\") - resolve forward declaration...\n", - die->GetOffset(), + DEBUG_PRINTF ("0x%8.8llx: %s (\"%s\") - resolve forward declaration...\n", + MakeUserID(die->GetOffset()), DW_TAG_value_to_name(tag), type->GetName().AsCString()); assert (clang_type); @@ -1657,7 +1668,7 @@ SymbolFileDWARF::GetFunction (DWARFCompileUnit* curr_cu, const DWARFDebugInfoEnt // Check if the symbol vendor already knows about this compile unit? sc.comp_unit = GetCompUnitForDWARFCompUnit(curr_cu, UINT32_MAX); - sc.function = sc.comp_unit->FindFunctionByUID (func_die->GetOffset()).get(); + sc.function = sc.comp_unit->FindFunctionByUID (MakeUserID(func_die->GetOffset())).get(); if (sc.function == NULL) sc.function = ParseCompileUnitFunction(sc, curr_cu, func_die); @@ -1741,7 +1752,7 @@ SymbolFileDWARF::ResolveSymbolContext (const Address& so_addr, uint32_t resolve_ if (function_die != NULL) { - sc.function = sc.comp_unit->FindFunctionByUID (function_die->GetOffset()).get(); + sc.function = sc.comp_unit->FindFunctionByUID (MakeUserID(function_die->GetOffset())).get(); if (sc.function == NULL) sc.function = ParseCompileUnitFunction(sc, curr_cu, function_die); } @@ -1755,9 +1766,9 @@ SymbolFileDWARF::ResolveSymbolContext (const Address& so_addr, uint32_t resolve_ Block& block = sc.function->GetBlock (true); if (block_die != NULL) - sc.block = block.FindBlockByID (block_die->GetOffset()); + sc.block = block.FindBlockByID (MakeUserID(block_die->GetOffset())); else - sc.block = block.FindBlockByID (function_die->GetOffset()); + sc.block = block.FindBlockByID (MakeUserID(function_die->GetOffset())); if (sc.block) resolved |= eSymbolContextBlock; } @@ -1837,7 +1848,7 @@ SymbolFileDWARF::ResolveSymbolContext(const FileSpec& file_spec, uint32_t line, if (function_die != NULL) { - sc.function = sc.comp_unit->FindFunctionByUID (function_die->GetOffset()).get(); + sc.function = sc.comp_unit->FindFunctionByUID (MakeUserID(function_die->GetOffset())).get(); if (sc.function == NULL) sc.function = ParseCompileUnitFunction(sc, curr_cu, function_die); } @@ -1847,9 +1858,9 @@ SymbolFileDWARF::ResolveSymbolContext(const FileSpec& file_spec, uint32_t line, Block& block = sc.function->GetBlock (true); if (block_die != NULL) - sc.block = block.FindBlockByID (block_die->GetOffset()); + sc.block = block.FindBlockByID (MakeUserID(block_die->GetOffset())); else - sc.block = block.FindBlockByID (function_die->GetOffset()); + sc.block = block.FindBlockByID (MakeUserID(function_die->GetOffset())); } } } @@ -2219,7 +2230,7 @@ SymbolFileDWARF::ResolveFunction (DWARFCompileUnit *cu, // Parse all blocks if needed if (inlined_die) { - sc.block = sc.function->GetBlock (true).FindBlockByID (inlined_die->GetOffset()); + sc.block = sc.function->GetBlock (true).FindBlockByID (MakeUserID(inlined_die->GetOffset())); assert (sc.block != NULL); if (sc.block->GetStartAddress (addr) == false) addr.Clear(); @@ -3319,9 +3330,9 @@ SymbolFileDWARF::ResolveNamespaceDIE (DWARFCompileUnit *curr_cu, const DWARFDebu if (log) { const char *object_name = m_obj_file->GetModule()->GetObjectName().GetCString(); - log->Printf ("ASTContext => %p: 0x%8.8x: DW_TAG_namespace with DW_AT_name(\"%s\") => clang::NamespaceDecl * %p in %s/%s%s%s%s (original = %p)", + log->Printf ("ASTContext => %p: 0x%8.8llx: DW_TAG_namespace with DW_AT_name(\"%s\") => clang::NamespaceDecl * %p in %s/%s%s%s%s (original = %p)", GetClangASTContext().getASTContext(), - die->GetOffset(), + MakeUserID(die->GetOffset()), namespace_name, namespace_decl, m_obj_file->GetFileSpec().GetDirectory().GetCString(), @@ -3529,12 +3540,12 @@ SymbolFileDWARF::FindDefinitionTypeForDIE (DWARFCompileUnit* cu, Type *resolved_type = ResolveType (type_cu, type_die, false); if (resolved_type && resolved_type != DIE_IS_BEING_PARSED) { - DEBUG_PRINTF ("resolved 0x%8.8x (cu 0x%8.8x) from %s to 0x%8.8x (cu 0x%8.8x)\n", - die->GetOffset(), - curr_cu->GetOffset(), + DEBUG_PRINTF ("resolved 0x%8.8llx (cu 0x%8.8llx) from %s to 0x%8.8llx (cu 0x%8.8llx)\n", + MakeUserID(die->GetOffset()), + MakeUserID(curr_cu->GetOffset()), m_obj_file->GetFileSpec().GetFilename().AsCString(), - type_die->GetOffset(), - type_cu->GetOffset()); + MakeUserID(type_die->GetOffset()), + MakeUserID(type_cu->GetOffset())); m_die_to_type[die] = resolved_type; type_sp = resolved_type; @@ -3646,7 +3657,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, } } - DEBUG_PRINTF ("0x%8.8x: %s (\"%s\") type => 0x%8.8x\n", die->GetOffset(), DW_TAG_value_to_name(tag), type_name_cstr, encoding_uid); + DEBUG_PRINTF ("0x%8.8llx: %s (\"%s\") type => 0x%8.8x\n", MakeUserID(die->GetOffset()), DW_TAG_value_to_name(tag), type_name_cstr, encoding_uid); switch (tag) { @@ -3693,7 +3704,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, } } - type_sp.reset( new Type (die->GetOffset(), + type_sp.reset( new Type (MakeUserID(die->GetOffset()), this, type_name_const_str, byte_size, @@ -3811,7 +3822,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, } } - DEBUG_PRINTF ("0x%8.8x: %s (\"%s\")\n", die->GetOffset(), DW_TAG_value_to_name(tag), type_name_cstr); + DEBUG_PRINTF ("0x%8.8llx: %s (\"%s\")\n", MakeUserID(die->GetOffset()), DW_TAG_value_to_name(tag), type_name_cstr); int tag_decl_kind = -1; AccessType default_accessibility = eAccessNone; @@ -3875,7 +3886,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, // parameters in any class methods need it for the clang // types for function prototypes. LinkDeclContextToDIE(ClangASTContext::GetDeclContextForType(clang_type), die); - type_sp.reset (new Type (die->GetOffset(), + type_sp.reset (new Type (MakeUserID(die->GetOffset()), this, type_name_const_str, byte_size, @@ -3965,7 +3976,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, } } - DEBUG_PRINTF ("0x%8.8x: %s (\"%s\")\n", die->GetOffset(), DW_TAG_value_to_name(tag), type_name_cstr); + DEBUG_PRINTF ("0x%8.8llx: %s (\"%s\")\n", MakeUserID(die->GetOffset()), DW_TAG_value_to_name(tag), type_name_cstr); clang_type_t enumerator_clang_type = NULL; clang_type = m_forward_decl_die_to_clang_type.lookup (die); @@ -3987,7 +3998,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, LinkDeclContextToDIE(ClangASTContext::GetDeclContextForType(clang_type), die); - type_sp.reset( new Type (die->GetOffset(), + type_sp.reset( new Type (MakeUserID(die->GetOffset()), this, type_name_const_str, byte_size, @@ -4108,7 +4119,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, } } - DEBUG_PRINTF ("0x%8.8x: %s (\"%s\")\n", die->GetOffset(), DW_TAG_value_to_name(tag), type_name_cstr); + DEBUG_PRINTF ("0x%8.8llx: %s (\"%s\")\n", MakeUserID(die->GetOffset()), DW_TAG_value_to_name(tag), type_name_cstr); clang_type_t return_clang_type = NULL; Type *func_type = NULL; @@ -4236,8 +4247,8 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, } else { - ReportWarning ("0x%8.8x: DW_AT_specification(0x%8.8x) has no decl\n", - die->GetOffset(), + ReportWarning ("0x%8.8llx: DW_AT_specification(0x%8.8x) has no decl\n", + MakeUserID(die->GetOffset()), specification_die_offset); } type_handled = true; @@ -4259,8 +4270,8 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, } else { - ReportWarning ("0x%8.8x: DW_AT_abstract_origin(0x%8.8x) has no decl\n", - die->GetOffset(), + ReportWarning ("0x%8.8llx: DW_AT_abstract_origin(0x%8.8x) has no decl\n", + MakeUserID(die->GetOffset()), abstract_origin_die_offset); } type_handled = true; @@ -4288,10 +4299,10 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, { clang::CXXMethodDecl *cxx_method_decl; // REMOVE THE CRASH DESCRIPTION BELOW - Host::SetCrashDescriptionWithFormat ("SymbolFileDWARF::ParseType() is adding a method %s to class %s in DIE 0x%8.8x from %s/%s", + Host::SetCrashDescriptionWithFormat ("SymbolFileDWARF::ParseType() is adding a method %s to class %s in DIE 0x%8.8llx from %s/%s", type_name_cstr, class_type->GetName().GetCString(), - die->GetOffset(), + MakeUserID(die->GetOffset()), m_obj_file->GetFileSpec().GetDirectory().GetCString(), m_obj_file->GetFileSpec().GetFilename().GetCString()); @@ -4356,7 +4367,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, function_param_decls.size()); } } - type_sp.reset( new Type (die->GetOffset(), + type_sp.reset( new Type (MakeUserID(die->GetOffset()), this, type_name_const_str, 0, @@ -4421,7 +4432,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, } } - DEBUG_PRINTF ("0x%8.8x: %s (\"%s\")\n", die->GetOffset(), DW_TAG_value_to_name(tag), type_name_cstr); + DEBUG_PRINTF ("0x%8.8llx: %s (\"%s\")\n", MakeUserID(die->GetOffset()), DW_TAG_value_to_name(tag), type_name_cstr); Type *element_type = ResolveTypeUID(type_die_offset); @@ -4449,7 +4460,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, array_element_bit_stride = array_element_bit_stride * num_elements; } ConstString empty_name; - type_sp.reset( new Type (die->GetOffset(), + type_sp.reset( new Type (MakeUserID(die->GetOffset()), this, empty_name, array_element_bit_stride / 8, @@ -4502,7 +4513,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, byte_size = ClangASTType::GetClangTypeBitWidth (ast.getASTContext(), clang_type) / 8; - type_sp.reset( new Type (die->GetOffset(), + type_sp.reset( new Type (MakeUserID(die->GetOffset()), this, type_name_const_str, byte_size, @@ -4533,7 +4544,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, } else if (sc.function != NULL) { - symbol_context_scope = sc.function->GetBlock(true).FindBlockByID(sc_parent_die->GetOffset()); + symbol_context_scope = sc.function->GetBlock(true).FindBlockByID(MakeUserID(sc_parent_die->GetOffset())); if (symbol_context_scope == NULL) symbol_context_scope = sc.function; } @@ -4582,7 +4593,7 @@ SymbolFileDWARF::ParseTypes if (die->Tag() == DW_TAG_subprogram) { SymbolContext child_sc(sc); - child_sc.function = sc.comp_unit->FindFunctionByUID(die->GetOffset()).get(); + child_sc.function = sc.comp_unit->FindFunctionByUID(MakeUserID(die->GetOffset())).get(); types_added += ParseTypes(child_sc, dwarf_cu, die->GetFirstChild(), true, true); } else @@ -4854,7 +4865,7 @@ SymbolFileDWARF::ParseVariableDIE case DW_TAG_lexical_block: if (sc.function) { - symbol_context_scope = sc.function->GetBlock(true).FindBlockByID(sc_parent_die->GetOffset()); + symbol_context_scope = sc.function->GetBlock(true).FindBlockByID(MakeUserID(sc_parent_die->GetOffset())); if (symbol_context_scope == NULL) symbol_context_scope = sc.function; } @@ -4867,16 +4878,16 @@ SymbolFileDWARF::ParseVariableDIE if (symbol_context_scope) { - var_sp.reset (new Variable(die->GetOffset(), - name, - mangled, - var_type, - scope, - symbol_context_scope, - &decl, - location, - is_external, - is_artificial)); + var_sp.reset (new Variable (MakeUserID(die->GetOffset()), + name, + mangled, + var_type, + scope, + symbol_context_scope, + &decl, + location, + is_external, + is_artificial)); var_sp->SetLocationIsConstantValueData (location_is_const_value_data); } @@ -5020,11 +5031,11 @@ SymbolFileDWARF::ParseVariables } else { - ReportError ("parent 0x%8.8x %s with no valid compile unit in symbol context for 0x%8.8x %s.\n", - sc_parent_die->GetOffset(), - DW_TAG_value_to_name (parent_tag), - orig_die->GetOffset(), - DW_TAG_value_to_name (orig_die->Tag())); + ReportError ("parent 0x%8.8llx %s with no valid compile unit in symbol context for 0x%8.8llx %s.\n", + MakeUserID(sc_parent_die->GetOffset()), + DW_TAG_value_to_name (parent_tag), + MakeUserID(orig_die->GetOffset()), + DW_TAG_value_to_name (orig_die->Tag())); } break; @@ -5035,7 +5046,7 @@ SymbolFileDWARF::ParseVariables { // Check to see if we already have parsed the variables for the given scope - Block *block = sc.function->GetBlock(true).FindBlockByID(sc_parent_die->GetOffset()); + Block *block = sc.function->GetBlock(true).FindBlockByID(MakeUserID(sc_parent_die->GetOffset())); if (block == NULL) { // This must be a specification or abstract origin with @@ -5047,7 +5058,7 @@ SymbolFileDWARF::ParseVariables sc_parent_die->GetOffset(), &concrete_block_die_cu); if (concrete_block_die) - block = sc.function->GetBlock(true).FindBlockByID(concrete_block_die->GetOffset()); + block = sc.function->GetBlock(true).FindBlockByID(MakeUserID(concrete_block_die->GetOffset())); } if (block != NULL) @@ -5064,9 +5075,9 @@ SymbolFileDWARF::ParseVariables break; default: - ReportError ("didn't find appropriate parent DIE for variable list for 0x%8.8x %s.\n", - orig_die->GetOffset(), - DW_TAG_value_to_name (orig_die->Tag())); + ReportError ("didn't find appropriate parent DIE for variable list for 0x%8.8llx %s.\n", + MakeUserID(orig_die->GetOffset()), + DW_TAG_value_to_name (orig_die->Tag())); break; } } diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h index 15f3147f1b06..89db5f5700ab 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h @@ -55,7 +55,7 @@ class DWARFDIECollection; class DWARFFormValue; class SymbolFileDWARFDebugMap; -class SymbolFileDWARF : public lldb_private::SymbolFile +class SymbolFileDWARF : public lldb_private::SymbolFile, public lldb_private::UserID { public: friend class SymbolFileDWARFDebugMap; @@ -411,6 +411,21 @@ protected: m_decl_ctx_to_die[decl_ctx].insert(die); } + bool + UserIDMatches (lldb::user_id_t uid) const + { + const lldb::user_id_t high_uid = uid & 0xffffffff00000000ull; + if (high_uid) + return high_uid == GetID(); + return true; + } + + lldb::user_id_t + MakeUserID (dw_offset_t die_offset) const + { + return GetID() | die_offset; + } + void ReportError (const char *format, ...) __attribute__ ((format (printf, 2, 3))); void diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp index 2d702bc57f1e..123e06a98d30 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp @@ -231,6 +231,20 @@ SymbolFileDWARFDebugMap::GetObjectFileByCompUnitInfo (CompileUnitInfo *comp_unit return NULL; } + +uint32_t +SymbolFileDWARFDebugMap::GetCompUnitInfoIndex (const CompileUnitInfo *comp_unit_info) +{ + if (!m_compile_unit_infos.empty()) + { + const CompileUnitInfo *first_comp_unit_info = &m_compile_unit_infos.front(); + const CompileUnitInfo *last_comp_unit_info = &m_compile_unit_infos.back(); + if (first_comp_unit_info <= comp_unit_info && comp_unit_info <= last_comp_unit_info) + return comp_unit_info - first_comp_unit_info; + } + return UINT32_MAX; +} + SymbolFileDWARF * SymbolFileDWARFDebugMap::GetSymbolFileByOSOIndex (uint32_t oso_idx) { @@ -256,7 +270,12 @@ SymbolFileDWARFDebugMap::GetSymbolFileByCompUnitInfo (CompileUnitInfo *comp_unit // Set a a pointer to this class to set our OSO DWARF file know // that the DWARF is being used along with a debug map and that // it will have the remapped sections that we do below. - ((SymbolFileDWARF *)comp_unit_info->oso_symbol_vendor->GetSymbolFile())->SetDebugMapSymfile(this); + SymbolFileDWARF *oso_symfile = (SymbolFileDWARF *)comp_unit_info->oso_symbol_vendor->GetSymbolFile(); + oso_symfile->SetDebugMapSymfile(this); + // Set the ID of the symbol file DWARF to the index of the OSO + // shifted left by 32 bits to provide a unique prefix for any + // UserID's that get created in the symbol file. + oso_symfile->SetID (((uint64_t)GetCompUnitInfoIndex(comp_unit_info) + 1ull) << 32ull); comp_unit_info->debug_map_sections_sp.reset(new SectionList); Symtab *exe_symtab = m_obj_file->GetSymtab(); @@ -622,11 +641,15 @@ SymbolFileDWARFDebugMap::ParseVariablesForContext (const SymbolContext& sc) Type* SymbolFileDWARFDebugMap::ResolveTypeUID(lldb::user_id_t type_uid) { + const uint64_t oso_idx = GetOSOIndexFromUserID (type_uid); + SymbolFileDWARF *oso_dwarf = GetSymbolFileByOSOIndex (oso_idx); + if (oso_dwarf) + oso_dwarf->ResolveTypeUID (type_uid); return NULL; } lldb::clang_type_t -SymbolFileDWARFDebugMap::ResolveClangOpaqueTypeDefinition (lldb::clang_type_t clang_Type) +SymbolFileDWARFDebugMap::ResolveClangOpaqueTypeDefinition (lldb::clang_type_t clang_type) { // We have a struct/union/class/enum that needs to be fully resolved. return NULL; @@ -1149,3 +1172,24 @@ SymbolFileDWARFDebugMap::CompleteObjCInterfaceDecl (void *baton, clang::ObjCInte } } +clang::DeclContext* +SymbolFileDWARFDebugMap::GetClangDeclContextContainingTypeUID (lldb::user_id_t type_uid) +{ + const uint64_t oso_idx = GetOSOIndexFromUserID (type_uid); + SymbolFileDWARF *oso_dwarf = GetSymbolFileByOSOIndex (oso_idx); + if (oso_dwarf) + return oso_dwarf->GetClangDeclContextContainingTypeUID (type_uid); + return NULL; +} + +clang::DeclContext* +SymbolFileDWARFDebugMap::GetClangDeclContextForTypeUID (const lldb_private::SymbolContext &sc, lldb::user_id_t type_uid) +{ + const uint64_t oso_idx = GetOSOIndexFromUserID (type_uid); + SymbolFileDWARF *oso_dwarf = GetSymbolFileByOSOIndex (oso_idx); + if (oso_dwarf) + return oso_dwarf->GetClangDeclContextForTypeUID (sc, type_uid); + return NULL; +} + + diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h index 8d722a1a4a89..ec7dae447948 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h @@ -66,6 +66,8 @@ public: virtual size_t ParseVariablesForContext (const lldb_private::SymbolContext& sc); virtual lldb_private::Type* ResolveTypeUID (lldb::user_id_t type_uid); + virtual clang::DeclContext* GetClangDeclContextContainingTypeUID (lldb::user_id_t type_uid); + virtual clang::DeclContext* GetClangDeclContextForTypeUID (const lldb_private::SymbolContext &sc, lldb::user_id_t type_uid); virtual lldb::clang_type_t ResolveClangOpaqueTypeDefinition (lldb::clang_type_t clang_Type); virtual uint32_t ResolveSymbolContext (const lldb_private::Address& so_addr, uint32_t resolve_scope, lldb_private::SymbolContext& sc); virtual uint32_t ResolveSymbolContext (const lldb_private::FileSpec& file_spec, uint32_t line, bool check_inlines, uint32_t resolve_scope, lldb_private::SymbolContextList& sc_list); @@ -151,6 +153,11 @@ protected: void InitOSO (); + static uint32_t + GetOSOIndexFromUserID (lldb::user_id_t uid) + { + return (uint32_t)((uid >> 32ull) - 1ull); + } bool GetFileSpecForSO (uint32_t oso_idx, lldb_private::FileSpec &file_spec); @@ -169,6 +176,9 @@ protected: lldb_private::ObjectFile * GetObjectFileByOSOIndex (uint32_t oso_idx); + uint32_t + GetCompUnitInfoIndex (const CompileUnitInfo *comp_unit_info); + SymbolFileDWARF * GetSymbolFile (const lldb_private::SymbolContext& sc); diff --git a/lldb/source/Symbol/Block.cpp b/lldb/source/Symbol/Block.cpp index a65eb78f47d3..886144d36d11 100644 --- a/lldb/source/Symbol/Block.cpp +++ b/lldb/source/Symbol/Block.cpp @@ -89,7 +89,7 @@ Block::Dump(Stream *s, addr_t base_addr, int32_t depth, bool show_context) const const Block* parent_block = GetParent(); if (parent_block) { - s->Printf(", parent = {0x%8.8x}", parent_block->GetID()); + s->Printf(", parent = {0x%8.8llx}", parent_block->GetID()); } if (m_inlineInfoSP.get() != NULL) { @@ -194,7 +194,7 @@ Block::DumpSymbolContext(Stream *s) Function *function = CalculateSymbolContextFunction(); if (function) function->DumpSymbolContext(s); - s->Printf(", Block{0x%8.8x}", GetID()); + s->Printf(", Block{0x%8.8llx}", GetID()); } void @@ -398,7 +398,7 @@ Block::AddRange (const Range& range) const Declaration &func_decl = func_type->GetDeclaration(); if (func_decl.GetLine()) { - log->Printf ("warning: %s/%s:%u block {0x%8.8x} has range[%u] [0x%llx - 0x%llx) which is not contained in parent block {0x%8.8x} in function {0x%8.8x} from %s/%s", + log->Printf ("warning: %s/%s:%u block {0x%8.8llx} has range[%u] [0x%llx - 0x%llx) which is not contained in parent block {0x%8.8llx} in function {0x%8.8llx} from %s/%s", func_decl.GetFile().GetDirectory().GetCString(), func_decl.GetFile().GetFilename().GetCString(), func_decl.GetLine(), @@ -413,7 +413,7 @@ Block::AddRange (const Range& range) } else { - log->Printf ("warning: block {0x%8.8x} has range[%u] [0x%llx - 0x%llx) which is not contained in parent block {0x%8.8x} in function {0x%8.8x} from %s/%s", + log->Printf ("warning: block {0x%8.8llx} has range[%u] [0x%llx - 0x%llx) which is not contained in parent block {0x%8.8llx} in function {0x%8.8llx} from %s/%s", GetID(), (uint32_t)m_ranges.GetSize(), block_start_addr, diff --git a/lldb/source/Symbol/CompileUnit.cpp b/lldb/source/Symbol/CompileUnit.cpp index ec383eb59512..3380603e1dd9 100644 --- a/lldb/source/Symbol/CompileUnit.cpp +++ b/lldb/source/Symbol/CompileUnit.cpp @@ -73,7 +73,7 @@ void CompileUnit::DumpSymbolContext(Stream *s) { GetModule()->DumpSymbolContext(s); - s->Printf(", CompileUnit{0x%8.8x}", GetID()); + s->Printf(", CompileUnit{0x%8.8llx}", GetID()); } diff --git a/lldb/source/Symbol/Function.cpp b/lldb/source/Symbol/Function.cpp index 11480f7c086e..1f643d42c0d3 100644 --- a/lldb/source/Symbol/Function.cpp +++ b/lldb/source/Symbol/Function.cpp @@ -367,7 +367,7 @@ Function::Dump(Stream *s, bool show_context) const } else if (m_type_uid != LLDB_INVALID_UID) { - s->Printf(", type_uid = 0x%8.8x", m_type_uid); + s->Printf(", type_uid = 0x%8.8llx", m_type_uid); } s->EOL(); @@ -423,7 +423,7 @@ void Function::DumpSymbolContext(Stream *s) { m_comp_unit->DumpSymbolContext(s); - s->Printf(", Function{0x%8.8x}", GetID()); + s->Printf(", Function{0x%8.8llx}", GetID()); } size_t diff --git a/lldb/source/Symbol/Symbol.cpp b/lldb/source/Symbol/Symbol.cpp index b764bada5540..8ff972c25779 100644 --- a/lldb/source/Symbol/Symbol.cpp +++ b/lldb/source/Symbol/Symbol.cpp @@ -20,8 +20,8 @@ using namespace lldb_private; Symbol::Symbol() : - UserID (), SymbolContextScope (), + m_uid (UINT32_MAX), m_mangled (), m_type (eSymbolTypeInvalid), m_type_data (0), @@ -39,7 +39,7 @@ Symbol::Symbol() : Symbol::Symbol ( - user_id_t symID, + uint32_t symID, const char *name, bool name_is_mangled, SymbolType type, @@ -52,8 +52,8 @@ Symbol::Symbol uint32_t size, uint32_t flags ) : - UserID (symID), SymbolContextScope (), + m_uid (symID), m_mangled (name, name_is_mangled), m_type (type), m_type_data (0), @@ -71,7 +71,7 @@ Symbol::Symbol Symbol::Symbol ( - user_id_t symID, + uint32_t symID, const char *name, bool name_is_mangled, SymbolType type, @@ -82,8 +82,8 @@ Symbol::Symbol const AddressRange &range, uint32_t flags ) : - UserID (symID), SymbolContextScope (), + m_uid (symID), m_mangled (name, name_is_mangled), m_type (type), m_type_data (0), @@ -100,8 +100,8 @@ Symbol::Symbol } Symbol::Symbol(const Symbol& rhs): - UserID (rhs), SymbolContextScope (rhs), + m_uid (rhs.m_uid), m_mangled (rhs.m_mangled), m_type (rhs.m_type), m_type_data (rhs.m_type_data), @@ -123,7 +123,7 @@ Symbol::operator= (const Symbol& rhs) if (this != &rhs) { SymbolContextScope::operator= (rhs); - UserID::operator= (rhs); + m_uid = rhs.m_uid; m_mangled = rhs.m_mangled; m_type = rhs.m_type; m_type_data = rhs.m_type_data; @@ -140,6 +140,24 @@ Symbol::operator= (const Symbol& rhs) return *this; } +void +Symbol::Clear() +{ + m_uid = UINT32_MAX; + m_mangled.Clear(); + m_type = eSymbolTypeInvalid; + m_type_data = 0; + m_type_data_resolved = false; + m_is_synthetic = false; + m_is_debug = false; + m_is_external = false; + m_size_is_sibling = false; + m_size_is_synthesized = false; + m_searched_for_function = false; + m_addr_range.Clear(); + m_flags = 0; +} + AddressRange * Symbol::GetAddressRangePtr() { diff --git a/lldb/source/Symbol/SymbolContext.cpp b/lldb/source/Symbol/SymbolContext.cpp index 673dc3cb545a..43ac5fc6e5fd 100644 --- a/lldb/source/Symbol/SymbolContext.cpp +++ b/lldb/source/Symbol/SymbolContext.cpp @@ -500,7 +500,7 @@ SymbolContext::GetParentOfInlinedScope (const Address &curr_frame_pc, if (log) { - log->Printf ("warning: inlined block 0x%8.8x doesn't have a range that contains file address 0x%llx", + log->Printf ("warning: inlined block 0x%8.8llx doesn't have a range that contains file address 0x%llx", curr_inlined_block->GetID(), curr_frame_pc.GetFileAddress()); } #ifdef LLDB_CONFIGURATION_DEBUG @@ -519,7 +519,7 @@ SymbolContext::GetParentOfInlinedScope (const Address &curr_frame_pc, } if (objfile) { - fprintf (stderr, "warning: inlined block 0x%8.8x doesn't have a range that contains file address 0x%llx in %s/%s\n", + fprintf (stderr, "warning: inlined block 0x%8.8llx doesn't have a range that contains file address 0x%llx in %s/%s\n", curr_inlined_block->GetID(), curr_frame_pc.GetFileAddress(), objfile->GetFileSpec().GetDirectory().GetCString(), @@ -527,7 +527,7 @@ SymbolContext::GetParentOfInlinedScope (const Address &curr_frame_pc, } else { - fprintf (stderr, "warning: inlined block 0x%8.8x doesn't have a range that contains file address 0x%llx\n", + fprintf (stderr, "warning: inlined block 0x%8.8llx doesn't have a range that contains file address 0x%llx\n", curr_inlined_block->GetID(), curr_frame_pc.GetFileAddress()); } } diff --git a/lldb/source/Symbol/Type.cpp b/lldb/source/Symbol/Type.cpp index 0d4c3d3c234a..d54d4c30559d 100644 --- a/lldb/source/Symbol/Type.cpp +++ b/lldb/source/Symbol/Type.cpp @@ -228,7 +228,7 @@ Type::DumpValue { s->PutChar('('); if (verbose) - s->Printf("Type{0x%8.8x} ", GetID()); + s->Printf("Type{0x%8.8llx} ", GetID()); DumpTypeName (s); s->PutCString(") "); } diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp index aa577587ed20..9a3020a527b6 100644 --- a/lldb/source/Target/Process.cpp +++ b/lldb/source/Target/Process.cpp @@ -1340,7 +1340,7 @@ Process::DisableBreakpointSiteByID (lldb::user_id_t break_id) } else { - error.SetErrorStringWithFormat("invalid breakpoint site ID: %i", break_id); + error.SetErrorStringWithFormat("invalid breakpoint site ID: %llu", break_id); } return error; @@ -1358,7 +1358,7 @@ Process::EnableBreakpointSiteByID (lldb::user_id_t break_id) } else { - error.SetErrorStringWithFormat("invalid breakpoint site ID: %i", break_id); + error.SetErrorStringWithFormat("invalid breakpoint site ID: %llu", break_id); } return error; } @@ -1540,7 +1540,7 @@ Process::DisableSoftwareBreakpoint (BreakpointSite *bp_site) addr_t bp_addr = bp_site->GetLoadAddress(); lldb::user_id_t breakID = bp_site->GetID(); if (log) - log->Printf ("Process::DisableBreakpoint (breakID = %d) addr = 0x%llx", breakID, (uint64_t)bp_addr); + log->Printf ("Process::DisableBreakpoint (breakID = %llu) addr = 0x%llx", breakID, (uint64_t)bp_addr); if (bp_site->IsHardware()) { @@ -2718,7 +2718,7 @@ Process::StartPrivateStateThread () // Create a thread that watches our internal state and controls which // events make it to clients (into the DCProcess event queue). char thread_name[1024]; - snprintf(thread_name, sizeof(thread_name), "", GetID()); + snprintf(thread_name, sizeof(thread_name), "", GetID()); m_private_state_thread = Host::ThreadCreate (thread_name, Process::PrivateStateThread, this, NULL); return IS_VALID_LLDB_HOST_THREAD(m_private_state_thread); } @@ -2823,7 +2823,7 @@ Process::HandlePrivateEvent (EventSP &event_sp) { if (log) { - log->Printf ("Process::%s (pid = %i) broadcasting new state %s (old state %s) to %s", + log->Printf ("Process::%s (pid = %llu) broadcasting new state %s (old state %s) to %s", __FUNCTION__, GetID(), StateAsCString(new_state), @@ -2842,7 +2842,7 @@ Process::HandlePrivateEvent (EventSP &event_sp) { if (log) { - log->Printf ("Process::%s (pid = %i) suppressing state %s (old state %s): should_broadcast == false", + log->Printf ("Process::%s (pid = %llu) suppressing state %s (old state %s): should_broadcast == false", __FUNCTION__, GetID(), StateAsCString(new_state), @@ -2867,7 +2867,7 @@ Process::RunPrivateStateThread () LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS)); if (log) - log->Printf ("Process::%s (arg = %p, pid = %i) thread starting...", __FUNCTION__, this, GetID()); + log->Printf ("Process::%s (arg = %p, pid = %llu) thread starting...", __FUNCTION__, this, GetID()); bool exit_now = false; while (!exit_now) @@ -2893,7 +2893,7 @@ Process::RunPrivateStateThread () } if (log) - log->Printf ("Process::%s (arg = %p, pid = %i) got a control event: %d", __FUNCTION__, this, GetID(), event_sp->GetType()); + log->Printf ("Process::%s (arg = %p, pid = %llu) got a control event: %d", __FUNCTION__, this, GetID(), event_sp->GetType()); m_private_state_control_wait.SetValue (true, eBroadcastAlways); continue; @@ -2912,7 +2912,7 @@ Process::RunPrivateStateThread () internal_state == eStateDetached ) { if (log) - log->Printf ("Process::%s (arg = %p, pid = %i) about to exit with internal state %s...", __FUNCTION__, this, GetID(), StateAsCString(internal_state)); + log->Printf ("Process::%s (arg = %p, pid = %llu) about to exit with internal state %s...", __FUNCTION__, this, GetID(), StateAsCString(internal_state)); break; } @@ -2920,7 +2920,7 @@ Process::RunPrivateStateThread () // Verify log is still enabled before attempting to write to it... if (log) - log->Printf ("Process::%s (arg = %p, pid = %i) thread exiting...", __FUNCTION__, this, GetID()); + log->Printf ("Process::%s (arg = %p, pid = %llu) thread exiting...", __FUNCTION__, this, GetID()); m_private_state_control_wait.SetValue (true, eBroadcastAlways); m_private_state_thread = LLDB_INVALID_HOST_THREAD; @@ -3043,7 +3043,7 @@ void Process::ProcessEventData::Dump (Stream *s) const { if (m_process_sp) - s->Printf(" process = %p (pid = %u), ", m_process_sp.get(), m_process_sp->GetID()); + s->Printf(" process = %p (pid = %llu), ", m_process_sp.get(), m_process_sp->GetID()); s->Printf("state = %s", StateAsCString(GetState())); } @@ -3433,7 +3433,7 @@ Process::RunThreadPlan (ExecutionContext &exe_ctx, { StreamString s; thread_plan_sp->GetDescription(&s, lldb::eDescriptionLevelVerbose); - log->Printf ("Process::RunThreadPlan(): Resuming thread %u - 0x%4.4x to run thread plan \"%s\".", + log->Printf ("Process::RunThreadPlan(): Resuming thread %u - 0x%4.4llx to run thread plan \"%s\".", thread->GetIndexID(), thread->GetID(), s.GetData()); @@ -3830,7 +3830,7 @@ Process::RunThreadPlan (ExecutionContext &exe_ctx, continue; } - ts.Printf("<0x%4.4x ", thread->GetID()); + ts.Printf("<0x%4.4llx ", thread->GetID()); RegisterContext *register_context = thread->GetRegisterContext().get(); if (register_context) @@ -3967,7 +3967,7 @@ Process::GetStatus (Stream &strm) { int exit_status = GetExitStatus(); const char *exit_description = GetExitDescription(); - strm.Printf ("Process %d exited with status = %i (0x%8.8x) %s\n", + strm.Printf ("Process %llu exited with status = %i (0x%8.8x) %s\n", GetID(), exit_status, exit_status, @@ -3978,12 +3978,12 @@ Process::GetStatus (Stream &strm) if (state == eStateConnected) strm.Printf ("Connected to remote target.\n"); else - strm.Printf ("Process %d %s\n", GetID(), StateAsCString (state)); + strm.Printf ("Process %llu %s\n", GetID(), StateAsCString (state)); } } else { - strm.Printf ("Process %d is running.\n", GetID()); + strm.Printf ("Process %llu is running.\n", GetID()); } } diff --git a/lldb/source/Target/StackID.cpp b/lldb/source/Target/StackID.cpp index a1e45b147e52..c430c3a38a45 100644 --- a/lldb/source/Target/StackID.cpp +++ b/lldb/source/Target/StackID.cpp @@ -31,7 +31,7 @@ StackID::Dump (Stream *s) m_symbol_scope->CalculateSymbolContext (&sc); if (sc.block) - s->Printf(" (Block {0x%8.8x})", sc.block->GetID()); + s->Printf(" (Block {0x%8.8llx})", sc.block->GetID()); else if (sc.symbol) s->Printf(" (Symbol{0x%8.8x})", sc.symbol->GetID()); } diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp index 5423e4cd4058..a7e87563c9be 100644 --- a/lldb/source/Target/Target.cpp +++ b/lldb/source/Target/Target.cpp @@ -1736,7 +1736,7 @@ Target::RunStopHooks () } if (print_hook_header && !any_thread_matched) { - result.AppendMessageWithFormat("\n- Hook %d\n", cur_hook_sp->GetID()); + result.AppendMessageWithFormat("\n- Hook %llu\n", cur_hook_sp->GetID()); any_thread_matched = true; } @@ -1760,7 +1760,7 @@ Target::RunStopHooks () if ((result.GetStatus() == eReturnStatusSuccessContinuingNoResult) || (result.GetStatus() == eReturnStatusSuccessContinuingResult)) { - result.AppendMessageWithFormat ("Aborting stop hooks, hook %d set the program running.", cur_hook_sp->GetID()); + result.AppendMessageWithFormat ("Aborting stop hooks, hook %llu set the program running.", cur_hook_sp->GetID()); keep_going = false; } } @@ -1857,7 +1857,7 @@ Target::StopHook::GetDescription (Stream *s, lldb::DescriptionLevel level) const s->SetIndentLevel(indent_level + 2); - s->Printf ("Hook: %d\n", GetID()); + s->Printf ("Hook: %llu\n", GetID()); if (m_active) s->Indent ("State: enabled\n"); else diff --git a/lldb/source/Target/Thread.cpp b/lldb/source/Target/Thread.cpp index 7af871421007..b51356a579f8 100644 --- a/lldb/source/Target/Thread.cpp +++ b/lldb/source/Target/Thread.cpp @@ -65,7 +65,7 @@ Thread::Thread (Process &process, lldb::tid_t tid) : { LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_OBJECT)); if (log) - log->Printf ("%p Thread::Thread(tid = 0x%4.4x)", this, GetID()); + log->Printf ("%p Thread::Thread(tid = 0x%4.4llx)", this, GetID()); QueueFundamentalPlan(true); UpdateInstanceName(); @@ -76,7 +76,7 @@ Thread::~Thread() { LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_OBJECT)); if (log) - log->Printf ("%p Thread::~Thread(tid = 0x%4.4x)", this, GetID()); + log->Printf ("%p Thread::~Thread(tid = 0x%4.4llx)", this, GetID()); /// If you hit this assert, it means your derived class forgot to call DoDestroy in its destructor. assert (m_destroy_called); } @@ -373,7 +373,7 @@ Thread::ShouldReportStop (Event* event_ptr) if (thread_state == eStateSuspended || thread_state == eStateInvalid) { if (log) - log->Printf ("Thread::ShouldReportStop() tid = 0x%4.4x: returning vote %i (state was suspended or invalid)\n", GetID(), eVoteNoOpinion); + log->Printf ("Thread::ShouldReportStop() tid = 0x%4.4llx: returning vote %i (state was suspended or invalid)\n", GetID(), eVoteNoOpinion); return eVoteNoOpinion; } @@ -381,13 +381,13 @@ Thread::ShouldReportStop (Event* event_ptr) { // Don't use GetCompletedPlan here, since that suppresses private plans. if (log) - log->Printf ("Thread::ShouldReportStop() tid = 0x%4.4x: returning vote for complete stack's back plan\n", GetID()); + log->Printf ("Thread::ShouldReportStop() tid = 0x%4.4llx: returning vote for complete stack's back plan\n", GetID()); return m_completed_plan_stack.back()->ShouldReportStop (event_ptr); } else { if (log) - log->Printf ("Thread::ShouldReportStop() tid = 0x%4.4x: returning vote for current plan\n", GetID()); + log->Printf ("Thread::ShouldReportStop() tid = 0x%4.4llx: returning vote for current plan\n", GetID()); return GetCurrentPlan()->ShouldReportStop (event_ptr); } } @@ -408,7 +408,7 @@ Thread::ShouldReportRun (Event* event_ptr) { // Don't use GetCompletedPlan here, since that suppresses private plans. if (log) - log->Printf ("Current Plan for thread %d (0x%4.4x): %s being asked whether we should report run.", + log->Printf ("Current Plan for thread %d (0x%4.4llx): %s being asked whether we should report run.", GetIndexID(), GetID(), m_completed_plan_stack.back()->GetName()); @@ -418,7 +418,7 @@ Thread::ShouldReportRun (Event* event_ptr) else { if (log) - log->Printf ("Current Plan for thread %d (0x%4.4x): %s being asked whether we should report run.", + log->Printf ("Current Plan for thread %d (0x%4.4llx): %s being asked whether we should report run.", GetIndexID(), GetID(), GetCurrentPlan()->GetName()); @@ -453,7 +453,7 @@ Thread::PushPlan (ThreadPlanSP &thread_plan_sp) { StreamString s; thread_plan_sp->GetDescription (&s, lldb::eDescriptionLevelFull); - log->Printf("Pushing plan: \"%s\", tid = 0x%4.4x.", + log->Printf("Pushing plan: \"%s\", tid = 0x%4.4llx.", s.GetData(), thread_plan_sp->GetThread().GetID()); } @@ -472,7 +472,7 @@ Thread::PopPlan () ThreadPlanSP &plan = m_plan_stack.back(); if (log) { - log->Printf("Popping plan: \"%s\", tid = 0x%4.4x.", plan->GetName(), plan->GetThread().GetID()); + log->Printf("Popping plan: \"%s\", tid = 0x%4.4llx.", plan->GetName(), plan->GetThread().GetID()); } m_completed_plan_stack.push_back (plan); plan->WillPop(); @@ -614,7 +614,7 @@ Thread::DiscardThreadPlansUpToPlan (lldb::ThreadPlanSP &up_to_plan_sp) LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP)); if (log) { - log->Printf("Discarding thread plans for thread tid = 0x%4.4x, up to %p", GetID(), up_to_plan_sp.get()); + log->Printf("Discarding thread plans for thread tid = 0x%4.4llx, up to %p", GetID(), up_to_plan_sp.get()); } int stack_size = m_plan_stack.size(); @@ -655,7 +655,7 @@ Thread::DiscardThreadPlans(bool force) LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP)); if (log) { - log->Printf("Discarding thread plans for thread (tid = 0x%4.4x, force %d)", GetID(), force); + log->Printf("Discarding thread plans for thread (tid = 0x%4.4llx, force %d)", GetID(), force); } if (force) @@ -864,7 +864,7 @@ Thread::DumpThreadPlans (lldb_private::Stream *s) const uint32_t stack_size = m_plan_stack.size(); int i; s->Indent(); - s->Printf ("Plan Stack for thread #%u: tid = 0x%4.4x, stack_size = %d\n", GetIndexID(), GetID(), stack_size); + s->Printf ("Plan Stack for thread #%u: tid = 0x%4.4llx, stack_size = %d\n", GetIndexID(), GetID(), stack_size); for (i = stack_size - 1; i >= 0; i--) { s->IndentMore(); diff --git a/lldb/source/Target/ThreadList.cpp b/lldb/source/Target/ThreadList.cpp index 6c9eaa4f428a..f4d75f5502fb 100644 --- a/lldb/source/Target/ThreadList.cpp +++ b/lldb/source/Target/ThreadList.cpp @@ -202,7 +202,7 @@ ThreadList::ShouldStop (Event *event_ptr) if (thread_sp->GetResumeState () == eStateSuspended) { if (log) - log->Printf ("ThreadList::%s for tid = 0x%4.4x, pc = 0x%16.16llx, should_stop = 0 (ignore since thread was suspended)", + log->Printf ("ThreadList::%s for tid = 0x%4.4llx, pc = 0x%16.16llx, should_stop = 0 (ignore since thread was suspended)", __FUNCTION__, thread_sp->GetID (), thread_sp->GetRegisterContext()->GetPC()); @@ -212,7 +212,7 @@ ThreadList::ShouldStop (Event *event_ptr) if (thread_sp->ThreadStoppedForAReason() == false) { if (log) - log->Printf ("ThreadList::%s for tid = 0x%4.4x, pc = 0x%16.16llx, should_stop = 0 (ignore since no stop reason)", + log->Printf ("ThreadList::%s for tid = 0x%4.4llx, pc = 0x%16.16llx, should_stop = 0 (ignore since no stop reason)", __FUNCTION__, thread_sp->GetID (), thread_sp->GetRegisterContext()->GetPC()); @@ -220,7 +220,7 @@ ThreadList::ShouldStop (Event *event_ptr) } if (log) - log->Printf ("ThreadList::%s for tid = 0x%4.4x, pc = 0x%16.16llx", + log->Printf ("ThreadList::%s for tid = 0x%4.4llx, pc = 0x%16.16llx", __FUNCTION__, thread_sp->GetID (), thread_sp->GetRegisterContext()->GetPC()); @@ -267,7 +267,7 @@ ThreadList::ShouldReportStop (Event *event_ptr) { const Vote vote = thread_sp->ShouldReportStop (event_ptr); if (log) - log->Printf ("ThreadList::%s thread 0x%4.4x: pc = 0x%16.16llx, vote = %s", + log->Printf ("ThreadList::%s thread 0x%4.4llx: pc = 0x%16.16llx, vote = %s", __FUNCTION__, thread_sp->GetID (), thread_sp->GetRegisterContext()->GetPC(), @@ -289,7 +289,7 @@ ThreadList::ShouldReportStop (Event *event_ptr) else { if (log) - log->Printf ("ThreadList::%s thread 0x%4.4x: pc = 0x%16.16llx voted %s, but lost out because result was %s", + log->Printf ("ThreadList::%s thread 0x%4.4llx: pc = 0x%16.16llx voted %s, but lost out because result was %s", __FUNCTION__, thread_sp->GetID (), thread_sp->GetRegisterContext()->GetPC(), @@ -334,7 +334,7 @@ ThreadList::ShouldReportRun (Event *event_ptr) break; case eVoteNo: if (log) - log->Printf ("ThreadList::ShouldReportRun() thread %d (0x%4.4x) says don't report.", + log->Printf ("ThreadList::ShouldReportRun() thread %d (0x%4.4llx) says don't report.", (*pos)->GetIndexID(), (*pos)->GetID()); result = eVoteNo; diff --git a/lldb/source/Target/ThreadPlan.cpp b/lldb/source/Target/ThreadPlan.cpp index 56403ef009d5..ad45ad2adf86 100644 --- a/lldb/source/Target/ThreadPlan.cpp +++ b/lldb/source/Target/ThreadPlan.cpp @@ -153,7 +153,7 @@ ThreadPlan::WillResume (StateType resume_state, bool current_plan) addr_t pc = reg_ctx->GetPC(); addr_t sp = reg_ctx->GetSP(); addr_t fp = reg_ctx->GetFP(); - log->Printf("%s Thread #%u: tid = 0x%4.4x, pc = 0x%8.8llx, sp = 0x%8.8llx, fp = 0x%8.8llx, plan = '%s', state = %s, stop others = %d", + log->Printf("%s Thread #%u: tid = 0x%4.4llx, pc = 0x%8.8llx, sp = 0x%8.8llx, fp = 0x%8.8llx, plan = '%s', state = %s, stop others = %d", __FUNCTION__, m_thread.GetIndexID(), m_thread.GetID(), diff --git a/lldb/source/Target/ThreadPlanBase.cpp b/lldb/source/Target/ThreadPlanBase.cpp index 5c2631ad1721..ebaa4dcf86f0 100644 --- a/lldb/source/Target/ThreadPlanBase.cpp +++ b/lldb/source/Target/ThreadPlanBase.cpp @@ -106,7 +106,7 @@ ThreadPlanBase::ShouldStop (Event *event_ptr) // at this point. Don't force the discard, however, so Master plans can stay // in place if they want to. if (log) - log->Printf("Base plan discarding thread plans for thread tid = 0x%4.4x (breakpoint hit.)", m_thread.GetID()); + log->Printf("Base plan discarding thread plans for thread tid = 0x%4.4llx (breakpoint hit.)", m_thread.GetID()); m_thread.DiscardThreadPlans(false); return true; } @@ -134,7 +134,7 @@ ThreadPlanBase::ShouldStop (Event *event_ptr) // If we crashed, discard thread plans and stop. Don't force the discard, however, // since on rerun the target may clean up this exception and continue normally from there. if (log) - log->Printf("Base plan discarding thread plans for thread tid = 0x%4.4x (exception.)", m_thread.GetID()); + log->Printf("Base plan discarding thread plans for thread tid = 0x%4.4llx (exception.)", m_thread.GetID()); m_thread.DiscardThreadPlans(false); return true; @@ -142,7 +142,7 @@ ThreadPlanBase::ShouldStop (Event *event_ptr) if (stop_info_sp->ShouldStop(event_ptr)) { if (log) - log->Printf("Base plan discarding thread plans for thread tid = 0x%4.4x (signal.)", m_thread.GetID()); + log->Printf("Base plan discarding thread plans for thread tid = 0x%4.4llx (signal.)", m_thread.GetID()); m_thread.DiscardThreadPlans(false); return true; } diff --git a/lldb/source/Target/ThreadPlanCallFunction.cpp b/lldb/source/Target/ThreadPlanCallFunction.cpp index 583ff43d0cc5..a5eb4b96a067 100644 --- a/lldb/source/Target/ThreadPlanCallFunction.cpp +++ b/lldb/source/Target/ThreadPlanCallFunction.cpp @@ -292,7 +292,7 @@ ThreadPlanCallFunction::DoTakedown () abi->GetReturnValue(m_thread, *m_return_value_sp); } if (log) - log->Printf ("DoTakedown called for thread 0x%4.4x, m_valid: %d complete: %d.\n", m_thread.GetID(), m_valid, IsPlanComplete()); + log->Printf ("DoTakedown called for thread 0x%4.4llx, m_valid: %d complete: %d.\n", m_thread.GetID(), m_valid, IsPlanComplete()); m_takedown_done = true; m_real_stop_info_sp = GetPrivateStopReason(); m_thread.RestoreThreadStateFromCheckpoint(m_stored_thread_state); @@ -305,7 +305,7 @@ ThreadPlanCallFunction::DoTakedown () else { if (log) - log->Printf ("DoTakedown called as no-op for thread 0x%4.4x, m_valid: %d complete: %d.\n", m_thread.GetID(), m_valid, IsPlanComplete()); + log->Printf ("DoTakedown called as no-op for thread 0x%4.4llx, m_valid: %d complete: %d.\n", m_thread.GetID(), m_valid, IsPlanComplete()); } } diff --git a/lldb/source/Target/ThreadPlanRunToAddress.cpp b/lldb/source/Target/ThreadPlanRunToAddress.cpp index 0779a1fd3223..0ff510a6e5ae 100644 --- a/lldb/source/Target/ThreadPlanRunToAddress.cpp +++ b/lldb/source/Target/ThreadPlanRunToAddress.cpp @@ -152,7 +152,7 @@ ThreadPlanRunToAddress::GetDescription (Stream *s, lldb::DescriptionLevel level) } s->Address(m_addresses[i], sizeof (addr_t)); - s->Printf (" using breakpoint: %d - ", m_break_ids[i]); + s->Printf (" using breakpoint: %llu - ", m_break_ids[i]); Breakpoint *breakpoint = m_thread.GetProcess().GetTarget().GetBreakpointByID (m_break_ids[i]).get(); if (breakpoint) breakpoint->Dump (s); diff --git a/lldb/source/Target/ThreadPlanStepOverBreakpoint.cpp b/lldb/source/Target/ThreadPlanStepOverBreakpoint.cpp index f310e4748ed7..c30219cc3b4b 100644 --- a/lldb/source/Target/ThreadPlanStepOverBreakpoint.cpp +++ b/lldb/source/Target/ThreadPlanStepOverBreakpoint.cpp @@ -48,7 +48,7 @@ ThreadPlanStepOverBreakpoint::~ThreadPlanStepOverBreakpoint () void ThreadPlanStepOverBreakpoint::GetDescription (Stream *s, lldb::DescriptionLevel level) { - s->Printf("Single stepping past breakpoint site %d at 0x%llx", m_breakpoint_site_id, (uint64_t)m_breakpoint_addr); + s->Printf("Single stepping past breakpoint site %llu at 0x%llx", m_breakpoint_site_id, (uint64_t)m_breakpoint_addr); } bool