addr2line and the name of the executable

Andrew Haley
Wed Feb 19 15:34:00 GMT 2003

Mohan Embar writes:
 > Ranjit> > If we need the actual path to the executable, this is best
 > Ranjit> > served by something like _Jv_platform_getexecutable( ) as
 > Ranjit> > Mohan's patch suggests.
 > >
 > Andrew> Okay.
 > So are you all saying that my patch is okay? Any comments as to my
 > implementation? Do I just submit it as-is?
 > Ranjit> > In "normal" Java programs, this is replaced by
 > Ranjit> > "Usage: java FooBar <whatever>" since this used to be the only
 > Ranjit> > way to invoke a Java program. However, with a natively
 > Ranjit> > compiled Java program, one cannot assume this and needs
 > Ranjit> > access to something like argv[0]
 > I wasn't clear from this whether it was okay for _Jv_platform_executable()
 > to supersede the argv[0] implementation or whether Ranjit thought we perhaps
 > needed both for different reasons.

We haven't fisnished the discussion yet.

I would say that your patch was basically OK.
_Jv_platform_executable() should be good for addr2line use, so it
should return a path to the executable.  It does not matter what it's
called as long as it can be opened by addr2line.

gnu.gcj.progname should probably be argv[0], unmangled by anuything.


More information about the Java mailing list