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

Implement debug command #94

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

tgagneret-embedded
Copy link

Hi,

This a command to support the "debug-binary" command in tockloader. This command allows to debug a binary on the board. It does not flash the binary on the board, only runs gdb and load a symbol file.

Since "--debug" would conflict with "debug", it is called "debug-binary". If it's a problem, we could rename "--debug" with "--verbose" to fix this issue.

return ocd_p

def _run_gdb_client(self, binary):
gdb_command = f'arm-none-eabi-gdb --exec {binary} --symbols {binary} -eval-command="target remote localhost:3333"'
Copy link
Contributor

Choose a reason for hiding this comment

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

would gdb-multiarch work just as well here? Otherwise this command only works on arm boards

Copy link
Author

Choose a reason for hiding this comment

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

You're right.

I think gdb-multiarch is not present on a lot of system. People tends to use gdb or arm-none-eabi-gdb.

So, to use the correct gdb, I suggest this:

  • Check for "gdb-multiarch" in PATH
  • If not in PATH, use gdb or arm-none-eabi-gdb depending on self.arch variable.

Would it be better ?

Thanks

Copy link
Contributor

Choose a reason for hiding this comment

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

Choosing based on the board arch is fine. Maybe that won't work in all cases, but that is OK for now.

Copy link
Contributor

@bradjc bradjc left a comment

Choose a reason for hiding this comment

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

Can you include example usage in the readme?

tockloader/jlinkexe.py Outdated Show resolved Hide resolved
return ocd_p

def _run_gdb_client(self, binary):
gdb_command = f'arm-none-eabi-gdb --exec {binary} --symbols {binary} -eval-command="target remote localhost:3333"'
Copy link
Contributor

Choose a reason for hiding this comment

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

Choosing based on the board arch is fine. Maybe that won't work in all cases, but that is OK for now.

tockloader/openocd.py Outdated Show resolved Hide resolved
tockloader/tockloader.py Outdated Show resolved Hide resolved
tockloader/main.py Outdated Show resolved Hide resolved
@bradjc
Copy link
Contributor

bradjc commented Nov 28, 2022

Can you include example usage in the readme?

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.

3 participants