From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18490 invoked by alias); 20 Jun 2008 08:09:40 -0000 Received: (qmail 18478 invoked by uid 22791); 20 Jun 2008 08:09:39 -0000 X-Spam-Check-By: sourceware.org Received: from f180.mail.ru (HELO f180.mail.ru) (194.67.57.207) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 20 Jun 2008 08:09:12 +0000 Received: from mail by f180.mail.ru with local id 1K9bgC-000LPq-00 for gdb@sourceware.org; Fri, 20 Jun 2008 12:09:08 +0400 Received: from [212.92.145.7] by win.mail.ru with HTTP; Fri, 20 Jun 2008 12:09:08 +0400 From: Dmitry Smirnov To: gdb@sourceware.org Subject: THUMB code detection for ADS 1.2 ELF emages Mime-Version: 1.0 X-Mailer: mPOP Web-Mail 2.19 Date: Fri, 20 Jun 2008 08:09:00 -0000 Reply-To: Dmitry Smirnov Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 8bit Message-Id: X-Spam: Not detected X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-06/txt/msg00194.txt.bz2 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