mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-11-26 12:23:59 +08:00
* stacktrace.cc (getLineNumberForFrame): Use _Jv_GetSafeArg.
From-SVN: r99733
This commit is contained in:
parent
099ff66cd2
commit
55c15dfc9d
@ -1,3 +1,7 @@
|
||||
2005-05-15 Tom Tromey <tromey@redhat.com>
|
||||
|
||||
* stacktrace.cc (getLineNumberForFrame): Use _Jv_GetSafeArg.
|
||||
|
||||
2005-05-13 Bryce McKinlay <mckinlay@redhat.com>
|
||||
|
||||
PR libgcj/21557
|
||||
|
@ -184,13 +184,13 @@ _Jv_StackTrace::getLineNumberForFrame(_Jv_StackFrame *frame, NameFinder *finder,
|
||||
#endif
|
||||
// Use dladdr() to determine in which binary the address IP resides.
|
||||
#if defined (HAVE_DLFCN_H) && defined (HAVE_DLADDR)
|
||||
extern char **_Jv_argv;
|
||||
Dl_info info;
|
||||
jstring binaryName = NULL;
|
||||
const char *argv0 = _Jv_GetSafeArg(0);
|
||||
|
||||
void *ip = frame->ip;
|
||||
_Unwind_Ptr offset = 0;
|
||||
|
||||
|
||||
if (dladdr (ip, &info))
|
||||
{
|
||||
if (info.dli_fname)
|
||||
@ -199,7 +199,7 @@ _Jv_StackTrace::getLineNumberForFrame(_Jv_StackFrame *frame, NameFinder *finder,
|
||||
return;
|
||||
|
||||
// addr2line expects relative addresses for shared libraries.
|
||||
if (strcmp (info.dli_fname, _Jv_argv[0]) == 0)
|
||||
if (strcmp (info.dli_fname, argv0) == 0)
|
||||
offset = (_Unwind_Ptr) ip;
|
||||
else
|
||||
offset = (_Unwind_Ptr) ip - (_Unwind_Ptr) info.dli_fbase;
|
||||
|
Loading…
Reference in New Issue
Block a user