From e1c3a3737536c57e43d4ad693341717e326f4e17 Mon Sep 17 00:00:00 2001 From: Jerome Guitton Date: Thu, 1 Nov 2018 14:32:30 -0700 Subject: arm-pikeos: software single step On ARM, PikeOS does not support hardware single step, causing various semi-random errors when trying to next/step over some user code. So this patch changes this target to use software-single-step instead. The challenge is that, up to now, the PikeOS target was in all respects identical to a baremetal target as far as GDB was concerned, meaning we were using the baremetal osabi for this target too. This is no longer possible, and we need to introduce a new OSABI variant. Unfortunately, there isn't anything in the object file that would allow us to differentiate between the two platforms. So we have to rely on a heuristic instead, where we look for some known symbols that are required in a PikeOS application (these symbols are expected to be defined by the default linker script, and correspond to routines used to allocate the application stack). For the long run, the hope is that the stub implementation provided by PikeOS is enhanced so that it includes vContSupported+ to the $qSupported query, and then that the reply to the "vCont?" query only return support for "continue" operations (thus exclusing "step" operations). We could then use that information to reliably determine at connection time that the target does not support single-stepping and therefore automatically turn software single-stepping automatically based on it. gdb/ChangeLog: * defs.h (enum gdb_osabi): Add GDB_OSABI_PIKEOS. * osabi.c (gdb_osabi_names): Add name for GDB_OSABI_PIKEOS. * arm-pikeos-tdep.c: New file. * configure.tgt: Add arm-pikeos-tdep.o to the case of ARM embedded system. * Makefile.in (ALL_TARGET_OBS): Add arm-pikeos-tdep.o. Tested on arm-pikeos and arm-elf using AdaCore's testsuite. We also evaluated it on armhf-linux as a cross platform. --- gdb/configure.tgt | 1 + 1 file changed, 1 insertion(+) (limited to 'gdb/configure.tgt') diff --git a/gdb/configure.tgt b/gdb/configure.tgt index 5e9bc36..e6ba333 100644 --- a/gdb/configure.tgt +++ b/gdb/configure.tgt @@ -180,6 +180,7 @@ arm*-*-symbianelf*) ;; arm*-*-*) # Target: ARM embedded system + gdb_target_obs="arm-pikeos-tdep.o" gdb_sim=../sim/arm/libsim.a ;; -- cgit v1.1