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

Run test roms #47

Merged
merged 17 commits into from
Jun 23, 2024
Merged

Run test roms #47

merged 17 commits into from
Jun 23, 2024

Conversation

joajfreitas
Copy link
Collaborator

No description provided.

Copy link
Collaborator

@diogotito diogotito left a comment

Choose a reason for hiding this comment

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

I like what I'm seeing here

@@ -591,7 +590,6 @@ struct Cli {
rom: Option<String>,
}


#[cfg(not(target_arch = "wasm32"))]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Reading this attribute is always a bit confusing to me.
Should we put a comment above saying "Desktop entry point"?

Copy link
Collaborator

Choose a reason for hiding this comment

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

(unrelated, I know)

}
}

pub fn receive_command(&mut self, cmd: &DebugCmd) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This signature matches the one in trait DebugInterface.
Why not put this in a impl DebugInterface for Debugger?

Comment on lines 38 to 39
self.breakpoints.push(Breakpoint {
pc: *pc,
active: true,
});
Copy link
Collaborator

Choose a reason for hiding this comment

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

What if there's already a Breakpoint with the same pc?

  • Maybe we should test for the existence of a breakpoint on this pc and do nothing in that case.
  • Maybe the field breakpoints should be a HashSet and Breakpoint should impl PartialEq to only compare the pc field.
  • Maybe the field breakpoints should be a HashMap<u16, bool> that maps "program counters" to an active/disabled flag, or a simpler struct that for now only holds the active/disabled flag. The latter would allow us to extend the value later to hold, for example, a conditional expression. Or we could just make a separate ConditionalBreakpoint variant.

Comment on lines 44 to 46
self.watchpoints.push(Watchpoint {
addr: *addr
});
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same comment as above.

Do you think watchpoints could be extended in the future?
If not, watchpoints could be a HashSet<u16>.

fpt/src/lr35902.rs Outdated Show resolved Hide resolved
Comment on lines 48 to 56
impl DebugInterface for LR35902 {
fn receive_command(&mut self, cmd: &DebugCmd) {
self.debugger.receive_command(cmd);
}
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

ooh, I see, this is delegating to DebugCmd, which happens to have a similar signature for now.

Comment on lines 711 to 713
if self.pc() == 0xFE {
std::process::exit(1);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why would the program counter jump to 0xFE?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Some debugging I was trying that made its way here

Copy link
Collaborator

Choose a reason for hiding this comment

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

I commented a bit on the data structures on struct Debugger but this looks good to me anyways.

@joajfreitas joajfreitas merged commit 41ad2ef into main Jun 23, 2024
1 check passed
@joajfreitas joajfreitas deleted the run_test_roms branch June 23, 2024 18:46
@joajfreitas joajfreitas self-assigned this Aug 22, 2024
@joajfreitas joajfreitas added the enhancement New feature or request label Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants