From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32078 invoked by alias); 19 Apr 2005 21:05:04 -0000 Mailing-List: contact binutils-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sources.redhat.com Received: (qmail 32060 invoked from network); 19 Apr 2005 21:04:59 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sourceware.org with SMTP; 19 Apr 2005 21:04:59 -0000 Received: from drow by nevyn.them.org with local (Exim 4.50 #1 (Debian)) id 1DNztz-000325-Ba for ; Tue, 19 Apr 2005 17:04:59 -0400 Date: Tue, 19 Apr 2005 21:05:00 -0000 From: Daniel Jacobowitz To: binutils@sources.redhat.com Subject: RFA: Display signed/factored offsets in readelf Message-ID: <20050419210459.GA11556@nevyn.them.org> Mail-Followup-To: binutils@sources.redhat.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.8i X-SW-Source: 2005-04/txt/msg00526.txt.bz2 While butchering some existing CFI annotations, I discovered that readelf was missing a couple of multiplications by data_factor. OK? BTW, the GAS cfi annotations don't work "right" with delay slots. Try this on a mips assembler: .cfi_startproc .set noreorder jr $31 addiu $29, $29, 8 .cfi_adjust_cfa_offset 8 .set reorder .cfi_endproc The CFI directive will come out at the beginning of the delay slot. Doesn't make much practical difference, so I'm not going to track it down right now. -- Daniel Jacobowitz CodeSourcery, LLC 2005-04-19 Daniel Jacobowitz * readelf.c (display_debug_frames): Use data factor for DW_CFA_def_cfa_sf and DW_CFA_def_cfa_offset_sf. Index: binutils/binutils/readelf.c =================================================================== --- binutils.orig/binutils/readelf.c 2005-04-12 16:39:11.000000000 -0400 +++ binutils/binutils/readelf.c 2005-04-19 16:50:16.922546591 -0400 @@ -10709,6 +10709,7 @@ display_debug_frames (Elf_Internal_Shdr case DW_CFA_def_cfa_sf: fc->cfa_reg = LEB (); fc->cfa_offset = SLEB (); + fc->cfa_offset = fc->cfa_offset * fc->data_factor; fc->cfa_exp = 0; if (! do_debug_frames_interp) printf (" DW_CFA_def_cfa_sf: r%d ofs %d\n", @@ -10717,6 +10718,7 @@ display_debug_frames (Elf_Internal_Shdr case DW_CFA_def_cfa_offset_sf: fc->cfa_offset = SLEB (); + fc->cfa_offset = fc->cfa_offset * fc->data_factor; if (! do_debug_frames_interp) printf (" DW_CFA_def_cfa_offset_sf: %d\n", fc->cfa_offset); break;