Tweaking some thread names.

This commit is contained in:
Ben Vanik 2015-07-29 23:28:45 -07:00
parent a9b89a790b
commit e523ffcd51
3 changed files with 8 additions and 3 deletions

View File

@ -68,7 +68,7 @@ SourceMapEntry* DebugInfo::LookupCodeOffset(uint32_t offset) {
return entry;
}
}
return nullptr;
return source_map_count_ ? &source_map_entries_[0] : nullptr;
}
void DebugInfo::Dump() {

View File

@ -84,8 +84,7 @@ void XdpServer::AcceptClient(std::unique_ptr<Socket> client) {
// Create a thread to manage the connection.
client_thread_ = xe::threading::Thread::Create({}, [this]() {
// TODO(benvanik): GDB protocol stuff? Do we say hi?
// TODO(benvanik): move hello to thread
xe::threading::set_name("XDP Debug Server");
// Let the debugger know we are present.
debugger_->set_attached(true);

View File

@ -223,6 +223,12 @@ X_STATUS XUserModule::Launch(uint32_t flags) {
entry_point_, 0,
X_CREATE_SUSPENDED, true));
// We know this is the 'main thread'.
char thread_name[32];
snprintf(thread_name, xe::countof(thread_name), "Main XThread %04X",
thread->handle());
thread->set_name(thread_name);
X_STATUS result = thread->Create();
if (XFAILED(result)) {
XELOGE("Could not create launch thread: %.8X", result);