1

I have a toolchain for my target which includes a gdb client in it:

GNU gdb (GNU Tools for ARM Embedded Processors 6-2017-q2-update) 7.12.1.20170417-git

(It's not the latest available from GNU ARM, but I have to use it for now, so let's assume there is no latest..)

The remote target (connecting through a gdbserver connected to JTAG) in is a Cortex-A7, which is armv7-a architecture.

What I don't understand why the gdb as is from this toolchain does not list armv7-a as one of the architectures that I can with "set architecture" command, yet, it appears to debug just fine.

I build binaries for armv7-a, and verify that they are built for this arch. I can then start the gdb from the toolchain, and load and start debugging.

If I list available inside gdb, it shows this:

set architecture arm arm_any armv2 armv2a armv3 armv3m armv4 armv4t armv5 armv5t armv5te auto ep9312 iwmmxt iwmmxt2 xscale

No armv7 anywhere. Yet gdb doesn't complain about anything, I can debug/single step instruction code, and, I see some v7 / new instructions which are new to the architecture.

These posts somewhat related but not answering it: How does GDB determine ARM architecture

GDB remote debug: can't stop the thread

Attributes from my elf

Attribute Section: aeabi
File Attributes
  Tag_CPU_name: "7-A"
  Tag_CPU_arch: v7
  Tag_CPU_arch_profile: Application
  Tag_ARM_ISA_use: Yes
  Tag_THUMB_ISA_use: Thumb-2
  Tag_ABI_PCS_wchar_t: 4
  Tag_ABI_FP_denormal: Needed
  Tag_ABI_FP_exceptions: Needed
  Tag_ABI_FP_number_model: IEEE 754
  Tag_ABI_align_needed: 8-byte
  Tag_ABI_enum_size: int
  Tag_DIV_use: Allowed in v7-A with integer division extension
  Tag_Virtualization_use: TrustZone and Virtualization Extensions

Gdb build was configured with: configure --host=x86_64-linux-gnu --target=arm-none-eabi

What I expected is that "armv7-a" or "armv7-m" or any may be some "armv7" should be listed by gdb as supported, but it isn't .

Yet it seems to be able to work with armv7-a target code - can disassemble it and understand armv7 new instructions , such as movt/movw.

So how does it do it? Is it a special/patched gdb (client) which does not list the arch, or what am I missing?

(I've seen that later gdb versions do allow set architecture armv7-a, but that's not mine gdb, and I want to understand how mine works)

v01d
  • 189
  • 1
  • 12

1 Answers1

0

I had the same issue trying to set the architecture to ARM (ARM6 for cortex M0) after running gdb. The target architecture wasn't present after running show architecture. I resolved this issue by running gdb-multiarch.