PyCortexMDebug icon indicating copy to clipboard operation
PyCortexMDebug copied to clipboard

Python2 compatibility

Open mrquincle opened this issue 2 years ago • 5 comments

The tar balls of cross-compilers tend to come nowadays with python support, e.g. arm-none-eabi-gdb-py, but this not yet the case for python3, there's no arm-none-eabi-gdb-py3 binary.

This means that your much appreciated code won't work out of the box for developers who don't compile their cross-compilers themselves.

The following commit is still python-2 compatible:

git checkout 76fe009847a3551ee56e75d4d0fa340977943c24

However, maybe it's nice to tag that release (or maybe a later release which is still not python3) and indicate that towards the users of this repository in the README.md? Or alternatively, create a python2 branch and cherry-pick a few of the bugs that have been fixed over time.

Thanks for your work, much appreciated!

mrquincle avatar Oct 04 '21 16:10 mrquincle

As you're probably well aware Python 2 hit EOL over a year ago. And having hung out with some slow-moving distributions like RHEL when projects demand it, I know not all of the world has moved on and I don't have a problem trying to continue to support it (even though I don't have a GDB build that can use it myself). This is a tiny project. I don't think we'll be able to just cherry-pick due to the extent of changes made to fully move to python3 but we can adapt. I don't anticipate adding new features to the python2 branch but bug fixes are fine.

The latest commit I thought was python2 compatible was 8b2fe1446d485a167b1b4d636b0b8a1f51c82b46 back in November 2020. Can you confirm? https://github.com/bnahill/PyCortexMDebug/tree/python2

Thanks!

bnahill avatar Oct 04 '21 17:10 bnahill

Of course I am. :-)

The commit https://github.com/bnahill/PyCortexMDebug/commit/8b2fe1446d485a167b1b4d636b0b8a1f51c82b46 leads to:

svd SCB
Python Exception <type 'exceptions.AttributeError'> 'OrderedDict' object has no attribute 'is_ambiguous': 
Error occurred in Python: 'OrderedDict' object has no attribute 'is_ambiguous'

No need to spend much time on it, people can find this issue if they run into it. The commit https://github.com/bnahill/PyCortexMDebug/commit/76fe009847a3551ee56e75d4d0fa340977943c24 worked fine for me.

mrquincle avatar Oct 05 '21 08:10 mrquincle

Alright, updated the python2 branch to 76fe009. Good to close?

bnahill avatar Oct 19 '21 23:10 bnahill

Seeing similar issues as @mrquincle with the latest arm gdb release. Of course Python 2 is EOL but many embedded developers work in environments where recompiling everything just isn't an option (Windows systems and/or high security environments). A proper fix/acknowledgment would be welcome as this tool looks very useful and is referenced from many places!

radix07 avatar Nov 23 '21 12:11 radix07

@radix07 You realize that there's now the https://github.com/bnahill/PyCortexMDebug/tree/python2 branch?

mrquincle avatar Nov 23 '21 13:11 mrquincle