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

Enable HwbpManual #541

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lz-bro
Copy link
Contributor

@lz-bro lz-bro commented Mar 1, 2024

Change-Id: I2ee8718f03d6e381369b7d3bb0222563789ed525

@@ -710,6 +715,7 @@ def test(self):
self.gdb.p("$pc")
assertRegex(output, r"[bB]reakpoint")
assertIn("rot13 ", output)
self.gdb.stepi()
Copy link
Collaborator

Choose a reason for hiding this comment

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

why do we need this stepi ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

rot13(fox);
checksum ^= crc32a(fox, strlen(fox));
rot13(fox);
checksum ^= crc32a(fox, strlen(fox));

According to the program, I think that the breakpoint should be hit 2 times at rot13, and then hit at crc32a and _exit sequentially. So stepi avoids hitting the rot13 breakpoint at the same position as main

Copy link
Collaborator

@aap-sc aap-sc May 9, 2024

Choose a reason for hiding this comment

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

So stepi avoids hitting the rot13 breakpoint at the same position as main

I don't get it. What do you mean "at the same position as main" ? main and rot13 should have different addresses. When gdb issues a continue request it issues a single-step and then issues a real continue. The breakpoint at main should not be hit.

if value == tdata1:
value = self.gdb.p("$tdata1")
if value == tdata1 or \
(value >> (xlen-4) == 0x6 and \
Copy link
Collaborator

Choose a reason for hiding this comment

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

value >> (xlen-4) == 0x6 What is the purpose of this condition? If I read this right we explicitly ask for TYPE=2 trigger. How come we end up with TYPE=6?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The purpose is to be compatible with spec 1.0 and 0.13. On our hardware that supports spec 0.13, setting the TYPE to 2 trigger actually we end up with TYPE=6.

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 instead just re-request type==6 if the resulting value of tdata1 is different? I believe this would enable us to support wide range of platforms in a more cleaner way.

Signed-off-by: 梁镇 <[email protected]>
Change-Id: I2ee8718f03d6e381369b7d3bb0222563789ed525
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.

2 participants