adamgreen / mri

MRI - Monitor for Remote Inspection. The gdb compatible debug monitor for Cortex-M devices.
Apache License 2.0
155 stars 57 forks source link

Remove "extern int errno" from architectures/armv7-m/armv7-m.c #25

Closed xiaoxiang781216 closed 2 years ago

xiaoxiang781216 commented 2 years ago

since no all libc implement errno as an normal integer

adamgreen commented 2 years ago

The diff looks good. I will test and merge later this week.

adamgreen commented 2 years ago

@xiaoxiang781216 For your semi host implementation, do you see any issues if I have the armv7-m module just track the semi host errno in the mriCortexMState global structure rather than a Standard C Library implementation of errno as done currently?

For my newlib version of the semihosting functionality, I would just add a function to retrieve the global errno similar to what you recently added for the mbed/arm version.

xiaoxiang781216 commented 2 years ago

@xiaoxiang781216 For your semi host implementation, do you see any issues if I have the armv7-m module just track the semi host errno in the mriCortexMState global structure rather than a Standard C Library implementation of errno as done currently?

For my newlib version of the semihosting functionality, I would just add a function to retrieve the global errno similar to what you recently added for the mbed/arm version.

Yes, it's better to not depend on libc's errno in mri.

adamgreen commented 2 years ago

Yes, it's better to not depend on libc's errno in mri.

Cool. I will make that change soon.

Thanks again for the PRs.