From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24571 invoked by alias); 4 Sep 2012 20:32:01 -0000 Received: (qmail 24472 invoked by uid 22791); 4 Sep 2012 20:31:57 -0000 X-SWARE-Spam-Status: No, hits=-5.6 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,RP_MATCHES_RCVD,TW_GC X-Spam-Check-By: sourceware.org Received: from mail-pb0-f47.google.com (HELO mail-pb0-f47.google.com) (209.85.160.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 04 Sep 2012 20:31:31 +0000 Received: by pbcwy7 with SMTP id wy7so9872300pbc.20 for ; Tue, 04 Sep 2012 13:31:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:x-system-of-record:x-gm-message-state; bh=lm7cVCkfCRhIf6ZSDPruCHocitEge2zPoZonISYVzDQ=; b=PF/HnnsUGkYfJWVzRcjBYu9WHAY1KdO4sdvNOOy6iFvr9ldX4cAwsT7Q0J53/mFbvv 2VpuPoQjyPVSiPHmD1W8XgEjiAz909B/lBgNj6haM57a/fR3KGsUxfHaoAD6nQaQveGS TFOGPPBgArnmwTNbTYP8+axInmPZH5jdymj1O+BjFjtfF6voLS7Urkguv+b6lGP2aBrA bHmyqGMcv2FbgyjTZxsqjt99JO/EOqH6+GRgbICBAiu7YbLAzfenuqY+WF1HuOB+1Aqa /zefWHSOMjTl3AqqEZIvkDz+RLQSjnc2oP2l0OEEaeUfTK+dWzZqN+/qKO7ZRVBYVftO PUIA== Received: by 10.68.132.196 with SMTP id ow4mr19209037pbb.25.1346790690385; Tue, 04 Sep 2012 13:31:30 -0700 (PDT) MIME-Version: 1.0 Received: by 10.68.132.196 with SMTP id ow4mr19209022pbb.25.1346790690235; Tue, 04 Sep 2012 13:31:30 -0700 (PDT) Received: by 10.68.211.170 with HTTP; Tue, 4 Sep 2012 13:31:29 -0700 (PDT) In-Reply-To: <50463875.7000006@redhat.com> References: <50254A50.8070208@redhat.com> <50255B35.9020705@redhat.com> <50258712.4070002@redhat.com> <502E6774.8050609@redhat.com> <503F7876.7030606@redhat.com> <503F84A9.8010504@redhat.com> <503F95D8.5010506@redhat.com> <50463661.1020303@redhat.com> <50463875.7000006@redhat.com> Date: Tue, 04 Sep 2012 20:32:00 -0000 Message-ID: Subject: Re: [PATCH] Set correct source location for deallocator calls From: Dehao Chen To: Andrew Haley Cc: Bryce McKinlay , Richard Henderson , Jason Merrill , Richard Guenther , gcc-patches@gcc.gnu.org, David Li , java@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 X-System-Of-Record: true X-Gm-Message-State: ALoCoQlnH5mwmauTScIIiwXUogvl+PyozdrUgvVNUtrQg4wsgngaLlY5AbZihTGpB71VvdR8I7cB++pD3p+ukR9U/v7WJqwr3wEGLU8l8j9vGwfXK31jJrtjizI895fPalYHtW4Y/gWWUPgN04hfMx1w7e6EyLKpR3ars5s7wAJQCMjUN0Rslax5O8RjJwwiiHB6lurQG0oh Mailing-List: contact java-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-owner@gcc.gnu.org X-SW-Source: 2012-09/txt/msg00008.txt.bz2 Looks like even with addr2line properly installed, the gcj generated code cannot get the correct source file/lineno. Do I need to pass in anything to gcj to let it know where addr2line is? Thanks, Dehao #javac stacktrace.java #java stacktrace stacktrace.e(stacktrace.java:42) stacktrace.d(stacktrace.java:38) stacktrace.c(stacktrace.java:31) stacktrace.b(stacktrace.java:26) stacktrace.a(stacktrace.java:19) stacktrace.main(stacktrace.java:12) #gcj *.class -o stacktrace.exe #./stacktrace.exe stacktrace.e(stacktrace.exe:-1) stacktrace.d(stacktrace.exe:-1) stacktrace.c(stacktrace.exe:-1) stacktrace.b(stacktrace.exe:-1) stacktrace.a(stacktrace.exe:-1) stacktrace.main(stacktrace.exe:-1) The java code is shown below: stacktrace.java /* This test should test the stacktrace functionality. We only print ClassName and MethName since the other information like FileName and LineNumber are not consistent while building native or interpreted and we want to test the output inside the dejagnu test environment. Also, we have to make the methods public since they might be optimized away with inline's and then the -O3/-O2 execution might fail. */ public class stacktrace { public static void main(String args[]) { try { new stacktrace().a(); } catch (TopException e) { } } public void a() throws TopException { try { b(); } catch (MiddleException e) { throw new TopException(e); } } public void b() throws MiddleException { c(); } public void c() throws MiddleException { try { d(); } catch (BottomException e) { throw new MiddleException(e); } } public void d() throws BottomException { e(); } public void e() throws BottomException { throw new BottomException(); } } class TopException extends Exception { TopException(Throwable cause) { super(cause); } } class MiddleException extends Exception { MiddleException(Throwable cause) { super(cause); } } class BottomException extends Exception { BottomException() { StackTraceElement stack[] = this.getStackTrace(); for (int i = 0; i < stack.length; i++) { String className = stack[i].getClassName(); String methodName = stack[i].getMethodName(); System.out.println(className + "." + methodName + "(" + stack[i].getFileName() + ":" + stack[i].getLineNumber() + ")"); } } }