Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
686750d2
Commit
686750d2
authored
Oct 05, 2012
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
runtime: Use argv[0] to get executable name for backtrace.
From-SVN: r192123
parent
4f60bf18
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
1 deletions
+13
-1
libgo/runtime/go-caller.c
+6
-1
libgo/runtime/runtime.c
+6
-0
libgo/runtime/runtime.h
+1
-0
No files found.
libgo/runtime/go-caller.c
View file @
686750d2
...
@@ -98,7 +98,12 @@ __go_get_backtrace_state ()
...
@@ -98,7 +98,12 @@ __go_get_backtrace_state ()
{
{
runtime_lock
(
&
back_state_lock
);
runtime_lock
(
&
back_state_lock
);
if
(
back_state
==
NULL
)
if
(
back_state
==
NULL
)
back_state
=
backtrace_create_state
(
NULL
,
1
,
error_callback
,
NULL
);
{
const
char
*
filename
;
filename
=
(
const
char
*
)
runtime_progname
();
back_state
=
backtrace_create_state
(
filename
,
1
,
error_callback
,
NULL
);
}
runtime_unlock
(
&
back_state_lock
);
runtime_unlock
(
&
back_state_lock
);
return
back_state
;
return
back_state
;
}
}
...
...
libgo/runtime/runtime.c
View file @
686750d2
...
@@ -117,6 +117,12 @@ runtime_args(int32 c, byte **v)
...
@@ -117,6 +117,12 @@ runtime_args(int32 c, byte **v)
runtime_sysargs
(
c
,
v
);
runtime_sysargs
(
c
,
v
);
}
}
byte
*
runtime_progname
()
{
return
argc
==
0
?
nil
:
argv
[
0
];
}
void
void
runtime_goargs
(
void
)
runtime_goargs
(
void
)
{
{
...
...
libgo/runtime/runtime.h
View file @
686750d2
...
@@ -520,5 +520,6 @@ extern uintptr runtime_stacks_sys;
...
@@ -520,5 +520,6 @@ extern uintptr runtime_stacks_sys;
struct
backtrace_state
;
struct
backtrace_state
;
extern
struct
backtrace_state
*
__go_get_backtrace_state
(
void
);
extern
struct
backtrace_state
*
__go_get_backtrace_state
(
void
);
extern
_Bool
__go_file_line
(
uintptr
,
String
*
,
String
*
,
int
*
);
extern
_Bool
__go_file_line
(
uintptr
,
String
*
,
String
*
,
int
*
);
extern
byte
*
runtime_progname
();
int32
getproccount
(
void
);
int32
getproccount
(
void
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment