ArrM

Kyle Huey me at kylehuey.com
Mon Nov 24 18:27:23 PST 2014


On Mon, Nov 24, 2014 at 5:46 PM, Chris Jones <jones.chris.g at gmail.com> wrote:
> Awesome!! :D
>
> On Mon, Nov 24, 2014 at 4:10 PM, Kyle Huey <me at kylehuey.com> wrote:
>>
>> - We cannot correctly set breakpoints at arbitrary addresses on ARM.
>> Without debugging information you cannot determine whether an address
>> corresponds to ARM or THUMB instructions, so we can't pick the correct
>> breakpoint instruction.
>
>
> gdb has to handle this case too, because not all images have debug info.
> What does gdb do?

You can see the code at
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=gdb/arm-tdep.c;h=100287031747bebb5e923e332c208ad5b867630d;hb=HEAD#l8874.
The interesting bits are in arm_pc_is_thumb which does the following:

1. If the address is not 4-byte aligned, assume it's thumb.
2. Check various override modes.
3. Check if the processor is thumb only.
4. Look at debugging symbols.
5. Otherwise use whatever the running frame is.
6. And if we're not running any code, assume arm.

gdb's breakpoint opcodes may be chosen so that making the wrong choice
is salvageable.  I haven't checked yet.

- Kyle


More information about the rr-dev mailing list