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

GDB doesn't know about PC/PCL relations #71

Open
shahab-vahedi opened this issue Aug 15, 2023 · 0 comments
Open

GDB doesn't know about PC/PCL relations #71

shahab-vahedi opened this issue Aug 15, 2023 · 0 comments
Labels

Comments

@shahab-vahedi
Copy link
Member

shahab-vahedi commented Aug 15, 2023

When GDB loads ELF files into target it sets PC register to "start point" set in this point. For this it sends "P" packet to target and doesn't reread registers after set - register PC is assumed to be set, as long as gdbserver returned success status for P-packet. That means that PCL register is still displayed with it's previous value which is rather unfortunate and might confused a user. It will be nice to avoid that problem, but that is not critical.

On first look there are two ways to fix this:

  1. Update GDB to set PCL to new value when PC is being changed.
  2. Force GDB to refetch PC/PCL after PC is being changed. The latter might be more challenging, since I'm not sure it is possible to set register invalidation in a single place. Another problem would be that gdbserver should be aware of this dependency. For example OpenOCD for "P" packets might not update PC yet, but update it in the cache, so rereading PCL via JTAG will not fix the issue.

kolesov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant