* THUMB code detection for ADS 1.2 ELF emages
@ 2008-06-20 8:09 Dmitry Smirnov
2008-06-20 10:36 ` Daniel Jacobowitz
2008-06-20 10:48 ` Stan Shebs
0 siblings, 2 replies; 4+ messages in thread
From: Dmitry Smirnov @ 2008-06-20 8:09 UTC (permalink / raw)
To: gdb
Hi,
I'm trying to use GDB to work with ARM ELF images produced by ADS 1.2 (ARM toolchain, a liitle bit old).
I can do almost all I want with ARM code. But GDB works incorrectly with THUMB code: I cannot disassemle the code, GDB places breakpoints at incorrect address, stepping with 'ni'.
In GDB source code I've found that it completely ignores some special symbols ($t, $a, $d ...) that ADS places to an ELF file.
I'm going to add some processing of this symbols. At first, I would like to handle $t symbols: it looks like they denote THUMB functions (ADS does not use STT_LOPROC) . So, I'm going to cycle though symbols and find a corresponding function name for each $t symbol (they should have the same value, i.e. address).
I'm wondering about the best place for this (I'm just started to learn GDB source).
On my mind it would be better to handle these symbols in elf_slurp_symbol_table() (file elfcode.h). Right now there is no symbol table post processing function (ebd->elf_backend_symbol_table_processing is NULL). So, I'm going to implement such a function. It will cycle over all the symbols and find a symbols that correspond to each $t symbol. If found, this symbol will get STT_LOPROC attribute in isym->st_info. It will replace the STT_FUNC, but I do not know the other way for this. By the time of this assignment, all these symbols will be already processed and sym->symbol.flags will be already updated with BSF_FUNCTION flag.
If you know the better approach, please let me know.
Dmitry
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: THUMB code detection for ADS 1.2 ELF emages
2008-06-20 8:09 THUMB code detection for ADS 1.2 ELF emages Dmitry Smirnov
@ 2008-06-20 10:36 ` Daniel Jacobowitz
2008-06-20 10:48 ` Stan Shebs
1 sibling, 0 replies; 4+ messages in thread
From: Daniel Jacobowitz @ 2008-06-20 10:36 UTC (permalink / raw)
To: Dmitry Smirnov; +Cc: gdb
On Fri, Jun 20, 2008 at 12:09:08PM +0400, Dmitry Smirnov wrote:
> In GDB source code I've found that it completely ignores some special symbols ($t, $a, $d ...) that ADS places to an ELF file.
Try a newer version of GDB; this is already supported. You'll need a
CVS snapshot.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: THUMB code detection for ADS 1.2 ELF emages
2008-06-20 8:09 THUMB code detection for ADS 1.2 ELF emages Dmitry Smirnov
2008-06-20 10:36 ` Daniel Jacobowitz
@ 2008-06-20 10:48 ` Stan Shebs
1 sibling, 0 replies; 4+ messages in thread
From: Stan Shebs @ 2008-06-20 10:48 UTC (permalink / raw)
To: Dmitry Smirnov; +Cc: gdb
Dmitry Smirnov wrote:
> Hi,
>
> I'm trying to use GDB to work with ARM ELF images produced by ADS 1.2 (ARM toolchain, a liitle bit old).
> I can do almost all I want with ARM code. But GDB works incorrectly with THUMB code: I cannot disassemle the code, GDB places breakpoints at incorrect address, stepping with 'ni'.
>
> In GDB source code I've found that it completely ignores some special symbols ($t, $a, $d ...) that ADS places to an ELF file.
>
Dan Jacobowitz added this bit of machinery recently; see
http://sourceware.org/ml/gdb-patches/2008-05/msg00113.html . He points
out that this should be a rare case, only needed if Arm and Thumb code
are mixed within a single file; so if your GDB is having trouble
detecting Thumb code, maybe there is some other problem, perhaps the
toolchain is not marking the executable correctly?
Stan
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: THUMB code detection for ADS 1.2 ELF emages
@ 2008-06-20 11:25 Dmitry Smirnov
0 siblings, 0 replies; 4+ messages in thread
From: Dmitry Smirnov @ 2008-06-20 11:25 UTC (permalink / raw)
To: gdb
Hi Stan, Dan,
Thanks for pointing this new feature. I hope it will helps me.
P.S. What do you mean by "toolchain is not marking the executable correctly"? I suppose that ADS produce the ELF that is not compartible with latest ARM ELF specs. At least, it specifies ELF as an 0x2000000 version, whereas GDB recognizes 0x4000000+.
I believe executable is correct. It mixes ARM and THUMB code. It runs on a real hardware, I can debug it with TRACE32 using this ELF. I'm trying to run this ELF on skyeye (and it runs!), but cannot debug it "in full-power" with GDB.
Stan Shebs wrote:
>Dan Jacobowitz added this bit of machinery recently; see
>http://sourceware.org/ml/gdb-patches/2008-05/msg00113.html . He points
>out that this should be a rare case, only needed if Arm and Thumb code
>are mixed within a single file; so if your GDB is having trouble
>detecting Thumb code, maybe there is some other problem, perhaps the
>toolchain is not marking the executable correctly?
>
>Stan
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-06-20 11:25 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-20 8:09 THUMB code detection for ADS 1.2 ELF emages Dmitry Smirnov
2008-06-20 10:36 ` Daniel Jacobowitz
2008-06-20 10:48 ` Stan Shebs
2008-06-20 11:25 Dmitry Smirnov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox