From patchwork Thu Sep 26 11:14:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omair Javaid X-Patchwork-Id: 20593 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ye0-f200.google.com (mail-ye0-f200.google.com [209.85.213.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BB83224687 for ; Thu, 26 Sep 2013 11:15:25 +0000 (UTC) Received: by mail-ye0-f200.google.com with SMTP id r5sf789762yen.11 for ; Thu, 26 Sep 2013 04:15:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mime-version:from:date:message-id :subject:to:cc:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe:content-type; bh=g6aNULi+2m7VRLwRtFMmO7nar4QcRzEtK802fwSnSFo=; b=jSl96mwYiz+0+iTYFbq4LnxnooL7gINO/sNiEEefYTycYgc11vg0CdB5yOAg52JrmG sMsDto8G4uZe9FRqZGjFwRnfm23bGjonvnmZ2AMw9FvY1SxqXqujoHjtQqEadL1ztoAr aGl9yrz7zgS6lZOxTqcQ7OvmQmmFdUgHn19Ysicri1KoaZlBfEk1TH/LuimXuFqvNUVk ZkQdcMDKYVDsRFRDzHTRVHQNNzb6l9grifDYmQyFR8KQ6morKg2U2hJPw/Ny7E3eVDCJ /MLislSUvb0VBUzQ7veJsADJtxUjPgcr1vN3GVxcci96oE5s02ugQPZL9CO3kI/9PapZ EaEg== X-Gm-Message-State: ALoCoQlGjILBI5ImsVWJ5+/lChFyns4LGwhrzECoghHu+4k+zzRV4TbuEAF/AkmNhkbfHxFdb4tt X-Received: by 10.236.24.195 with SMTP id x43mr61041yhx.3.1380194125329; Thu, 26 Sep 2013 04:15:25 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.29.167 with SMTP id l7ls855499qeh.47.gmail; Thu, 26 Sep 2013 04:15:25 -0700 (PDT) X-Received: by 10.58.8.231 with SMTP id u7mr165057vea.44.1380194125238; Thu, 26 Sep 2013 04:15:25 -0700 (PDT) Received: from mail-ve0-f169.google.com (mail-ve0-f169.google.com [209.85.128.169]) by mx.google.com with ESMTPS id d9si253885vee.85.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 26 Sep 2013 04:15:25 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.169; Received: by mail-ve0-f169.google.com with SMTP id db12so749046veb.14 for ; Thu, 26 Sep 2013 04:14:55 -0700 (PDT) X-Received: by 10.221.23.72 with SMTP id qz8mr158833vcb.66.1380194095150; Thu, 26 Sep 2013 04:14:55 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp359779vcz; Thu, 26 Sep 2013 04:14:54 -0700 (PDT) X-Received: by 10.49.35.106 with SMTP id g10mr430734qej.35.1380194094651; Thu, 26 Sep 2013 04:14:54 -0700 (PDT) Received: from mail-qe0-f41.google.com (mail-qe0-f41.google.com [209.85.128.41]) by mx.google.com with ESMTPS id fo1si184416qcb.93.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 26 Sep 2013 04:14:54 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.41 is neither permitted nor denied by best guess record for domain of omair.javaid@linaro.org) client-ip=209.85.128.41; Received: by mail-qe0-f41.google.com with SMTP id 1so662697qee.28 for ; Thu, 26 Sep 2013 04:14:54 -0700 (PDT) X-Received: by 10.49.53.10 with SMTP id x10mr547520qeo.46.1380194094340; Thu, 26 Sep 2013 04:14:54 -0700 (PDT) MIME-Version: 1.0 Received: by 10.49.116.66 with HTTP; Thu, 26 Sep 2013 04:14:34 -0700 (PDT) From: Omair Javaid Date: Thu, 26 Sep 2013 16:14:34 +0500 Message-ID: Subject: [PATCH] testsuite/gdb.dwarf2: dw2-case-insensitive.exp: p fuNC_lang fails on arm To: gdb-patches@sourceware.org Cc: Patch Tracking X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: omair.javaid@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , dw2-case-insensitive.exp: p fuNC_lang fails on arm. The problem occurs when thumb mode code is generated. On ARM last bit of function pointer value indicates whether the target function is an ARM (if 0) or Thumb (if 1) routine. The PC address should refer to actual address in either case. This patch adds new compile unit and function labels to code which act as address ranges of compile unit and functions in debug information. Therefore address ranges will have correct addresses and not the ones with an incremented least significant bit. This patch has been tested on x86_64 and arm machines. gdb/testsuite/ChangeLog: 2013-09-26 Omair Javaid * gdb.dwarf2/dw2-case-insensitive-debug.S: Updated compile unit and function label names. * gdb.dwarf2/dw2-case-insensitive.c: Created function and compile unit labels. .../gdb.dwarf2/dw2-case-insensitive-debug.S | 8 ++++---- gdb/testsuite/gdb.dwarf2/dw2-case-insensitive.c | 12 ++++++++++++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/gdb/testsuite/gdb.dwarf2/dw2-case-insensitive-debug.S b/gdb/testsuite/gdb.dwarf2/dw2-case-insensitive-debug.S index db3cce8..22b01f9 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-case-insensitive-debug.S +++ b/gdb/testsuite/gdb.dwarf2/dw2-case-insensitive-debug.S @@ -29,14 +29,14 @@ .ascii "file1.txt\0" /* DW_AT_name */ .ascii "GNU C 3.3.3\0" /* DW_AT_producer */ .byte 8 /* DW_AT_language (DW_LANG_Fortran90) */ - .4byte FUNC_lang /* DW_AT_low_pc */ - .4byte main /* DW_AT_high_pc */ + .4byte cu_text_start /* DW_AT_low_pc */ + .4byte cu_text_end /* DW_AT_high_pc */ .uleb128 3 /* Abbrev: DW_TAG_subprogram */ .byte 1 /* DW_AT_external */ .ascii "FUNC_lang\0" /* DW_AT_name */ - .4byte FUNC_lang /* DW_AT_low_pc */ - .4byte main /* DW_AT_high_pc */ + .4byte FUNC_lang_start /* DW_AT_low_pc */ + .4byte FUNC_lang_end /* DW_AT_high_pc */ .byte 1 /* DW_AT_prototyped */ .4byte .Ltype - .Lcu1_begin /* DW_AT_type */ diff --git a/gdb/testsuite/gdb.dwarf2/dw2-case-insensitive.c b/gdb/testsuite/gdb.dwarf2/dw2-case-insensitive.c index 09e9683..4b3ea07 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-case-insensitive.c +++ b/gdb/testsuite/gdb.dwarf2/dw2-case-insensitive.c @@ -16,12 +16,21 @@ along with this program. If not, see . */ /* Use DW_LANG_Fortran90 for case insensitive DWARF. */ +asm (".globl cu_text_start"); +asm ("cu_text_start:"); + +asm (".globl FUNC_lang_start"); +asm (".p2align 4"); +asm ("FUNC_lang_start:"); void FUNC_lang (void) { } +asm (".globl FUNC_lang_end"); +asm ("FUNC_lang_end:"); + /* Symbol is present only in ELF .symtab. */ void @@ -36,3 +45,6 @@ main (void) FUNC_symtab (); return 0; } + +asm (".globl cu_text_end"); +asm ("cu_text_end:");