Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lldb/tools/debugserver/source/MacOSX/MachProcess.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1739,7 +1739,7 @@ static uint64_t bits(uint64_t value, uint32_t msbit, uint32_t lsbit) {
ReplyToAllExceptions();
}

m_task.ShutDownExcecptionThread();
m_task.ShutDownExceptionThread();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No idea, it's been that way since forever.


// Detach from our process
errno = 0;
Expand Down
2 changes: 1 addition & 1 deletion lldb/tools/debugserver/source/MacOSX/MachTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class MachTask {
bool ExceptionPortIsValid() const;
kern_return_t SaveExceptionPortInfo();
kern_return_t RestoreExceptionPortInfo();
kern_return_t ShutDownExcecptionThread();
void ShutDownExceptionThread();

bool StartExceptionThread(
const RNBContext::IgnoredExceptions &ignored_exceptions, DNBError &err);
Expand Down
13 changes: 8 additions & 5 deletions lldb/tools/debugserver/source/MacOSX/MachTask.mm
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,8 @@
//----------------------------------------------------------------------
void MachTask::Clear() {
// Do any cleanup needed for this task
if (m_exception_thread)
ShutDownExcecptionThread();
ShutDownExceptionThread();
m_task = TASK_NULL;
m_exception_thread = 0;
m_exception_port = MACH_PORT_NULL;
m_exec_will_be_suspended = false;
m_do_double_resume = false;
Expand Down Expand Up @@ -685,8 +683,11 @@ static void get_threads_profile_data(DNBProfileDataScanType scanType,
return false;
}

kern_return_t MachTask::ShutDownExcecptionThread() {
void MachTask::ShutDownExceptionThread() {
DNBError err;

if (!m_exception_thread)
return;

err = RestoreExceptionPortInfo();

Expand All @@ -702,6 +703,8 @@ static void get_threads_profile_data(DNBProfileDataScanType scanType,
if (DNBLogCheckLogBit(LOG_TASK) || err.Fail())
err.LogThreaded("::pthread_join ( thread = %p, value_ptr = NULL)",
m_exception_thread);

m_exception_thread = nullptr;

// Deallocate our exception port that we used to track our child process
mach_port_t task_self = mach_task_self();
Expand All @@ -713,7 +716,7 @@ static void get_threads_profile_data(DNBProfileDataScanType scanType,
m_exec_will_be_suspended = false;
m_do_double_resume = false;

return err.Status();
return;
}

void *MachTask::ExceptionThread(void *arg) {
Expand Down
Loading