From: Dmitry Smirnov <divis1969@mail.ru>
To: gdb@sourceware.org
Subject: THUMB code detection for ADS 1.2 ELF emages
Date: Fri, 20 Jun 2008 08:09:00 -0000 [thread overview]
Message-ID: <E1K9bgC-000LPq-00.divis1969-mail-ru@f180.mail.ru> (raw)
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
next reply other threads:[~2008-06-20 8:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-20 8:09 Dmitry Smirnov [this message]
2008-06-20 10:36 ` Daniel Jacobowitz
2008-06-20 10:48 ` Stan Shebs
2008-06-20 11:25 Dmitry Smirnov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1K9bgC-000LPq-00.divis1969-mail-ru@f180.mail.ru \
--to=divis1969@mail.ru \
--cc=gdb@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox