[PATCH] Set correct source location for deallocator calls

Bryce McKinlay bmckinlay@gmail.com
Thu Aug 30 14:45:00 GMT 2012

On Thu, Aug 30, 2012 at 3:28 PM, Richard Henderson <rth@redhat.com> wrote:
> On 08/17/2012 03:02 PM, Dehao Chen wrote:
>> I spend a whole day working on this, but find it very difficult to add
>> such a java test because:
>> * First, libjava testsuits are all runtime tests, i.e., it compiles
>> the byte code to native code, execute it, and compares the output to
>> expected output. There is no way to scan the assembly.
>> * Though there is a way to derive the line number at runtime in java
>> (using Exception().getStackTrace()), this method only works on VM, and
>> the gcj generated native code does not get the lineno.
>> Any suggestions on this?
> Hmm, not from me, unfortunately.  Cc'ing the java list for clues.
> I won't hang up the main patch for this though.

libjava calls out to addr2line to get the line number and source file
name for stack traces. As long as it can find addr2line you should get
a line number - but some platforms don't have it.

Ref: libjava/stacktrace.cc and libjava/gnu/gcj/runtime/NameFinder.java

More information about the Java mailing list