zephyrproject-rtos / openocd

OpenOCD with Zephyr patches for building Zephyr SDK
Other
28 stars 45 forks source link

Zephyr introduce ARCv2(EMSK boards) support #15

Closed EvgeniiDidin closed 4 years ago

EvgeniiDidin commented 4 years ago

ARC EMSK boards have support in both OpenOCD and Zephyr projects. With this series of patches the support of ARCv2 architecture for Zephyr is introduced into OpenOCD. The patch series is based on the latest zephyr-20191003 branch.

galak commented 4 years ago

This fails for me:

src/rtos/Zephyr.c: In function ‘Zephyr_get_thread_reg_list’:
src/rtos/Zephyr.c:579:48: error: pointer targets in passing argument 3 of ‘target_read_u32’ differ in signedness [-Werror=pointer-sign]
   retval = target_read_u32(rtos->target, addr, &real_stack_addr);
                                                ^~~~~~~~~~~~~~~~
In file included from src/rtos/rtos.h:23,
                 from src/rtos/Zephyr.c:27:
./src/target/target.h:725:5: note: expected ‘uint32_t *’ {aka ‘unsigned int *’} but argument is of type ‘int32_t *’ {aka ‘int *’}
 int target_read_u32(struct target *target, target_addr_t address, uint32_t *value);
     ^~~~~~~~~~~~~~~
src/rtos/Zephyr.c:608:21: error: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Werror=sign-compare]
   for (int i = 0; i < sizeof(arc_cpu_saved) / 6; i++) {
                     ^
src/rtos/Zephyr.c:628:31: error: ‘sp_offset’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
   buf_cpy(stack_p, (*reg_list)[sp_offset].value, sizeof(uint32_t) * 8);
                               ^
src/rtos/Zephyr.c:618:55: error: ‘pc_offset’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
   buf_cpy((*reg_list)[blink_offset].value, (*reg_list)[pc_offset].value, sizeof(uint32_t) * 8);
                                                       ^
src/rtos/Zephyr.c:618:22: error: ‘blink_offset’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
   buf_cpy((*reg_list)[blink_offset].value, (*reg_list)[pc_offset].value, sizeof(uint32_t) * 8);
                      ^
cc1: all warnings being treated as errors
make[2]: *** [Makefile:4050: src/rtos/librtos_la-Zephyr.lo] Error 1
make[2]: Leaving directory '/home/galak/git/z.tools/openocd'
make[1]: *** [Makefile:4359: all-recursive] Error 1
make[1]: Leaving directory '/home/galak/git/z.tools/openocd'
EvgeniiDidin commented 4 years ago

Oh, I configured with --disable-werror and didn't try without it. My bad, I will fix it ASAP.