This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: Does GDB suports mixed ARM_code (ARM+Thumb) debugging?
- To: Nicolas dot Thery at Symbian dot com
- Subject: Re: Does GDB suports mixed ARM_code (ARM+Thumb) debugging?
- From: Joel Brenner <joel dot brenner at tchip dot com>
- Date: Mon, 29 Jan 2001 17:34:58 +0100
- CC: gdb at sources dot redhat dot com
- Organization: TChip Semiconductors
- References: <OFC19A9A36.829A7E77-ON802569DF.0048275F@Symbian.com>
- Reply-To: joel dot brenner at tchip dot com
Nicolas.Thery@Symbian.com wrote:
> Joel Brenner <joel.brenner@tchip.com> wrote:
>
> > does gdb 2.95.2 configured for arm-elf supports debuggin of objects
> > generated by linking together ARM-code (32 bit) and Thumb-code (16 bit)?
>
> GDB 4.17 does. So I guess more recent versions do too.
>
> *******************************************************************************************************************
> Symbian Limited (Co.No.3173352) Registered Office: Sentinel House, 16 Harcourt Street, London, W1H 4AD, UK.
> This message is intended only for use by the named addressee and may contain privileged and/or confidential information. If you are not the named addressee you should not disseminate, copy or take any action in reliance on it. If you have received this message in error please notify postmaster@symbian.com and delete the message and any attachments accompanying it immediately. Symbian does not accept liability for any corruption, interception, amendment, tampering or viruses occuring to this message in transit or for any message sent by its employees which is not in compliance with Symbian corporate policy.
> *******************************************************************************************************************
I've now installed gcc-20010122 to generate thumb-code and it works.
At debugging time (gdb 5.0) there are some problems.
ARM-code compiled with -c -g -O2 -mcpu=arm7tdmi -mthumb-interwork and placed ad address (00100c50 g F .text 00000014 MainApp)
int MainApp( void )
{
for (;;)
{
thumb_func();
};
return(TRUE);
}
Dump of assembler code for function MainApp:
0x100c50 <MainApp>: mov r12, sp
0x100c54 <MainApp+4>: stmdb sp!, {r11, r12, lr, pc}
0x100c58 <MainApp+8>: sub r11, r12, #4 ; 0x4
0x100c5c <MainApp+12>: bl 0x10143c <__thumb_func_from_arm>
0x100c60 <MainApp+16>: b 0x100c5c <MainApp+12>
End of assembler dump.
Thumb-code compiled with -c -g -O2 -mcpu=arm7tdmi -mthumb -mthumb-interwork and placed at address(00100ef4 g .text 00000012 thumb_func)
void thumb_func(void)
{
unsigned char channel;
for(channel=0;channel < 4; channel ++);
}
Dump of assembler code for function thumb_func:
0x100efc <thumb_func>: push {lr}
0x100efe <thumb_func+2>: mov r3, #0
0x100f00 <thumb_func+4>: add r3, #1
0x100f02 <thumb_func+6>: lsl r3, r3, #24
0x100f04 <thumb_func+8>: lsr r3, r3, #24
0x100f06 <thumb_func+10>: cmp r3, #3
0x100f08 <thumb_func+12>: bls 0x100f00 <thumb_func+4>
0x100f0a <thumb_func+14>: pop {r0}
0x100f0c <thumb_func+16>: bx r0
End of assembler dump.
If I begin a dubugging session with gdb there are no preblems if I never try to enter (step) in Thumb_func(), if I do this gdb never comes bak.
My questions are:
-are the compilation flags the right one?
-can I'use a standard linker script or a midified one for interworking conde?
-where is the problem ?
-gdb automaticly swith betwen 16 and 32 bit code ?
tanks joel brenner