addr2line and the name of the executable
Mohan Embar
gnustuff@thisiscool.com
Wed Feb 26 05:57:00 GMT 2003
Hi Ranjit,
As I mentioned to you personally, I must have hit the send button
for my patch:
http://gcc.gnu.org/ml/java-patches/2003-q1/msg00559.html
...a couple of seconds before you posted your message!
My patch is slightly at variance with your post. Here are my reflections:
> a. "gnu.gcj.progname" should be set to whatever is argv[0]. Note that
> apparently on Mac OS Classic, argv[0] can actually be equal to NULL,
> though this might be irrelevant since there is no port of GCJ on Mac
> OS Classic.
This would be at variance with the current behavior today, where gnu.gcj.progname
returns /proc/XXX/exe on i686 Linux, for example. Although you mused as to
how well-founded this was (and I agree), changing this behavior could
potentially break the fringe cases that rely on this. Being new to this,
I can't properly assess the consequences and wasn't comfortable changing
behavior on platforms other than mingw32.
> b. _Jv_ThisExecutable( ) should return the actual executable file that
> was used to create the current process, if possible.
>> c. NameFinder should use _Jv_ThisExecutable( ) to construct the argument
> passed to "addr2line -e".
These are addressed by my patch.
>> case of Win32. Semantically, argv[0] and the full path to the executable
>> are the same in the case of Win32, and given that gnu.gcj.progname is
>>Only in the case of Win9x and not on WinNT/2K/XP:
>> http://article.gmane.org/gmane.comp.gnu.mingw.user/6198
I said *semantically* equivalent, not equivalent. Given that a subset of the
Win32 platforms (albeit "deprecated" ones: Win9x) would end up having
gnu.gcj.progname return the same value as the value that would be returned
by my proposed patch on all Win32 platforms (i.e. the full path to the executable
and not necessarily whatever was present verbatim on the command line), I don't see
the harm in generalizing this to all Win32 platforms. I can't even begin to imagine a
case where the patch's behavior (having gnu.gcj.progname return GetModuleFilename()
and not the actual value on the command line) would not be acceptable on
non-Win9x platforms, especially given that such programs would then break
if run on Win9x....
Does any of this make sense or I am just foaming at the mouth?
-- Mohan
http://www.thisiscool.com/
http://www.animalsong.org/
More information about the Java
mailing list