How does GDB determine ARM architecture

核能气质少年 提交于 2019-12-08 09:37:23

问题


I am using gdb (arm-none-eabi) with a Texas Instruments Hercules (Cortex-R4F) processor. I'm using Texas Instrument's XDS agent as a remote GDB server

After running

target remote ip:port 

in GDB, GDB will connect with the XDS GDBserver. I can then print the registers

info all-registers

It shows me the CPU registers, but also f7 and fpa registers which lead me to conclude that the CPU has an floating point coprocessor (FPA). This is however not the case. The processor has vfpv3. So GDB is using the wrong register definitions which leads to problems.

I tried to find the info in the packets sent by XDS GDB server by setting

set debug remote 1

but could not find any info. How does GDB determine the register definitions to use?

Update: I found the set architecture command:

set architecture

>Requires an argument. Valid arguments are arm, armv2, armv2a, armv3, armv3m, armv4, armv4t, armv5, armv5t, armv5te, xscale, ep9312, iwmmxt, iwmmxt2, arm_any, auto.

Cortex-R4f is armv7 with vfpv3. How can I set it?


回答1:


TI's XDS agent is acting as a GDBServer.

But it does not respond to packets such as qXfer:features:read... to get information on the target

In the end I manually applied:

set tdesc filename /gdb/binutils-gdb/gdb/features/arm/arm-with-vfpv3.xml

this sets the correct features for the Corter-R4f and allows me to set breakpoints, call functions, etc.

Alas, we're finding other problems now. It seems TI's XDS GDBserver agent is not very stable.



来源:https://stackoverflow.com/questions/43373048/how-does-gdb-determine-arm-architecture

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!