-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Qt/Debugger: Implement "Code" widget #6386
Conversation
962bc50
to
03f7743
Compare
Ok, I pretty much tested everything I could as far as the UI/UX is concerned (haven't really checked the code though, not that good with Qt yet to review the code) Here's what I got:
That's all I have to say. Overall, this is shaping to be MUCH better than the WX one because of all the extra space saved and the removal of several hardcoded visuals. By the way, about the branch lines, feel free to do whatever you want with them because they weren't that good in the wx one, they just disappeared if they were off screen. |
Should be more readable all around now.
You can now! (It will also remember it)
Should be clearer now.
Possible now
Fixed
Might be fixed now.
It's more similar to Wx now.
Fixed.
There are colors now.
Fixed.
You can now! Edit:
Editable and usable now! |
de7053c
to
718683b
Compare
I tested some more and found more issues, but first:
Unfortunately, it is only partially. If I put a breakpoint near the PC enough, it's fine. However, if the breakpoint is very far form the PC, enough for the game to runs for a couple of seconds/1-2 minutes, nothing updates, the pause/play button AND the code view, but you can trigger an update manually by scrolling in the view.
Well now you cannot use the option anywhere, it's grayed, even when actually on a branch :( Ok so here's the new stuff:
That's all I have for now. |
Can't comment on your first two points until tomorrow, sorry.
4., 5., 6., 10., 13. I understand those and will fix them tomorrow
|
What was wrong with click and drag was the fact it's just really weird as it triggers events much more than once. (like it constantly scrolls one way, add remove breakpoints at sporadious interval or select constantly a symbol). But to answer the question, I would do that on WX if I need to recenter the view to a precise instruction that happens to be near the current center. What the WX one does is if you click, but not release is it puts a thinner frame on the line you would click and if you drag, it would drag the frame too, it follows the line the cursor is on. Only when you release the click is when it will recenter the view to that line so it became a bit usefull if I wanted to recenter the view to that line only. It is obviously not for scrolling. To be honest, this is mostly a small convenient feature that I use from time to time as I realised it can be nice to have, but not essential, you could just click the right line the first time to do the same thing.
However, this happens if I resize the code view to have more space so I can read things: On WX, this would always show the extra space and I guess it "resize" dynamically, but thinking about it, I am not even sure it resizes, it might just render the view and have only a part visible and you would have to resize to see more of it.
everything's fine, but if I put map the window to the right and expand it a bit (so the window now has less horizontal space): On wx, maybe the game view might be weird (such as showing nothing), but the code view should be perfectly readable and resized accordingly.
You can see the odd spacing there, I assume it has to do with the column's width because it seems like non dotted rlwinm snuggly fit. If it is, then a ps_merge00 would be worse.
It's kind of tricky to trigger that, but I guess clickling a bunch at precise place, eventually it will show up. |
Tried to address everything except for:
Which I couldn't figure out, so I'll try to fix that later. For the time being you could use a external render window or undock the code widget.
It doesn't currently restrict it to branch instructions only. Could you provide me with a list of all branch instructions where it should be available? |
9db4aeb
to
37eb336
Compare
Well, there's a lot, what I realised is this is what the WX implementation does (so it enables the options if this returns something other than 0) https://github.com/dolphin-emu/dolphin/blob/master/Source/Core/DolphinWX/Debugger/CodeView.cpp#L190 But if you would like to do it differently, I wouldn't necessarly try to do it by list because there's a lot of them (branch, branch + link, branch under some conditions, branch to some special things, branch to lr, etc...._). What I would try to do is check the instruction in hex and check the bits that tells this is a branch instruction. ... I think the former solution might be simpler, only branches instructions have that -> notation anyway. I guess I can check how it determines whether to put it or not, but if it's already determined by the string, it would be a bit weird to check this in this convoluted way. |
if (symbol) | ||
{ | ||
std::string text; | ||
text = text + symbol->name + "\r\n"; |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
||
void CodeViewWidget::SetAddress(u32 address) | ||
{ | ||
if (m_address != address) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
void CodeWidget::Step() | ||
{ | ||
Common::Event sync_event; | ||
if (CPU::IsStepping()) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
||
void CodeWidget::StepOver() | ||
{ | ||
if (CPU::IsStepping()) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
||
void CodeWidget::StepOut() | ||
{ | ||
if (CPU::IsStepping()) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Source/Core/DolphinQt2/MenuBar.cpp
Outdated
bool good; | ||
unsigned long address = text.toUInt(&good, 16); | ||
|
||
if (good && address <= std::numeric_limits<u32>::max()) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Source/Core/DolphinQt2/MenuBar.cpp
Outdated
QString text = QInputDialog::getText( | ||
this, tr("Input"), tr("Only export symbols with prefix:\n(Blank for all symbols)")); | ||
|
||
if (!text.isEmpty()) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
@@ -6,6 +6,7 @@ | |||
|
|||
#include <memory> | |||
|
|||
#include <QFont> |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
const u32 address = m_context_item->data(Qt::UserRole).toUInt(); | ||
|
||
Symbol* symbol = g_symbolDB.GetSymbolFromAddr(address); | ||
if (symbol) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
AddWidget(tr("Wii and Wii Remote"), new HotkeyWii(this)); | ||
AddWidget(tr("Graphics"), new HotkeyGraphics(this)); | ||
AddWidget(tr("3D"), new Hotkey3D(this)); | ||
AddWidget(tr("Save and Load State"), new HotkeyStates(this)); | ||
setWindowTitle(tr("Hotkey Settings")); | ||
|
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
c18aefe
to
8e64a0d
Compare
@aldelaro5 Should work properly now! |
Actually, it works, but not exactly how it should. Currently, it allows to branch and it will branch if you use the option, but only if the current selected line is a branch. What should be happening is when you right click on a line that is a branch, it should allow you to follow the branch, even if the line isn't selected and isn't the center. It would be too annoying to have to recenter before branching so that would be why you should be able to do it that way. |
edeb784
to
9e371bb
Compare
@aldelaro5 Fixed. Also Fixed the color stuff you mentioned. |
@aldelaro5 got anything else? |
@spycrab only thing I noticed is the magenta color. I think I wasn't explicit enough when I said it, but I meant the instructions PARAMETERS column, not the instruction column. Basically, this: Other than that, so far, not really. |
@aldelaro5 Actually forgot to commit that, my bad. Take your time and if you don't find anything else approve the PR so I know you're okay with it. Thanks for your feedback. |
Unfortunately, this is not ready for merge, new issues were introduced as well as existing ones seems to not have been addressed yet.
Here are the issues yet to be addressed:
This one is partially addressed (the symbols panel still has that problem):
|
As discussed in IRC.
Fixed (AFAICT).
I changed it for the up and down keys but forgot about doing this for mouse scrolling, fixed now.
I didn't clarify this in the first time I addressed this (see that for possible "fixes"): That's something too complicated for me to fix right now so I'll have to postpone it (also not really related to this PR).
Overlooked that, sorry. Fixed now.
I've talked about this before but a TL;DR: I think this is mostly working as intended and I don't get why you'd want to do this.
Really strange, works fine here. Edit: Or I'm misinterpreting what you mean. Screenshots of How it looks now vs How it should look would help a lot! |
f8a62d8
to
4272ff7
Compare
Some stuff is still broken. Will address those once I have time. |
@container1234 @aldelaro5 Should be all addressed now, except for
That will be addressed in the upcoming Memory Widget PR. |
Sorry for the delay, but I finally had time to review again and I noticed one problem: I actually really like how you can hide each of the 4 symbols panels on the left of the code view, but I realised that if you do so, it's pretty confusing to figure out what was hidden and how to unhide it (you just see an awkward series of lines if you collapses some). What I suggest is using a collapsable view where the header is always visible, kind of like this: http://oi42.tinypic.com/11jn6ko.jpg This is especially fitting with the panels being laied down veritcally and it still saves enough space for it to matter. Other than that, everything seems alright. |
While that would be nice. I don't think it can be done easily with Qt. |
This needs thorough reviewing.