Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[debugger] Windows support + process-drawable + joint #942

Closed

Conversation

ManDude
Copy link
Member

@ManDude ManDude commented Oct 25, 2021

No description provided.

@ManDude ManDude changed the title [debugger] Windows support [debugger] Windows support + process-drawable Oct 25, 2021
@ManDude ManDude changed the title [debugger] Windows support + process-drawable [debugger] Windows support + process-drawable + joint Oct 27, 2021
@ManDude
Copy link
Member Author

ManDude commented Oct 27, 2021

joint is being a pain in the ass so i'll add that too

@coveralls
Copy link

coveralls commented Oct 27, 2021

Pull Request Test Coverage Report for Build 1397409601

  • 10 of 64 (15.63%) changed or added relevant lines in 8 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.02%) to 58.507%

Changes Missing Coverage Covered Lines Changed/Added Lines %
tools/dgo_unpacker.cpp 0 1 0.0%
decompiler/ObjectFile/ObjectFileDB.cpp 0 4 0.0%
decompiler/analysis/final_output.cpp 0 4 0.0%
goalc/main.cpp 0 4 0.0%
goalc/debugger/Debugger.cpp 9 14 64.29%
goalc/compiler/Compiler.cpp 0 18 0.0%
goalc/compiler/compilation/Debug.cpp 0 18 0.0%
Totals Coverage Status
Change from base Build 1388211263: -0.02%
Covered Lines: 40345
Relevant Lines: 68958

💛 - Coveralls

Copy link
Collaborator

@water111 water111 left a comment

Choose a reason for hiding this comment

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

nice, thanks for getting the debugger working on windows! Just a few comments on some of the mutex stuff, otherwise everything else looks good

return false;
}

cont_status = 1;
Copy link
Collaborator

Choose a reason for hiding this comment

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

you should lock the mutex before setting cont_status, otherwise this can happen:

  • lock in check_stopped
  • check_stopped checks cont_status, it is -1
  • this code sets cont_status = -1
  • this code does a notify_all
  • check_stopped does a wait, then gets stuck there.

/*!
* Cross-thread things.
*/
int cont_status = -1; // hack? -1 = ignore; 0 = waiting for cont; 1 = cont'd, will resume
Copy link
Collaborator

Choose a reason for hiding this comment

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

does something reset this to -1 if you restart the runtime in the middle of debugging? (maybe it doesn't matter)

@@ -233,6 +233,37 @@ gc> (:disasm (sym-val basic-type?) 80)

For now, the disassembly is pretty basic, but it should eventually support GOAL symbols.

### `(:sym-name)`

Print the name of a symbol from its offset. The name is fetched from memory.
Copy link
Collaborator

Choose a reason for hiding this comment

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

nice, this will be a useful feature

@@ -14,6 +15,10 @@
#include "goalc/listener/Listener.h"
#include "third-party/fmt/core.h"

namespace {
std::mutex watcher_mutex;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we move this to m_watcher_mutex in Debugger?

Copy link
Member Author

Choose a reason for hiding this comment

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

Apparently there's already a m_watcher_mutex field so I just re-used that. Should be okay?

@@ -572,6 +609,7 @@ void Debugger::start_watcher() {
assert(!m_watcher_running);
m_watcher_running = true;
m_watcher_should_stop = false;
m_attach_return = false;
Copy link
Collaborator

Choose a reason for hiding this comment

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

should lock the mutex before changing this

@xTVaser
Copy link
Member

xTVaser commented Oct 29, 2021

Looks like these two files havn't been added to the reference tests

Copy link
Collaborator

@water111 water111 left a comment

Choose a reason for hiding this comment

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

mutex fixes look good, thanks. This just needs to have merge conflicts resolved (sorry, I think I did these in a bad order?)

@water111
Copy link
Collaborator

merged in #953

@water111 water111 closed this Oct 31, 2021
@ManDude
Copy link
Member Author

ManDude commented Oct 31, 2021

Awesome, thanks.

@ManDude ManDude deleted the d/windows-debugger-and-process-drawable branch November 10, 2021 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants