Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
3835e01d
Commit
3835e01d
authored
Jul 28, 2008
by
Rob Pike
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
print tracebacks for all goroutines, not just the crashing one
R=ken OCL=13518 CL=13518
parent
ea056902
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
2 deletions
+21
-2
proc.c
src/runtime/proc.c
+15
-0
rt1_amd64_darwin.c
src/runtime/rt1_amd64_darwin.c
+1
-0
rt1_amd64_linux.c
src/runtime/rt1_amd64_linux.c
+2
-1
runtime.c
src/runtime/runtime.c
+1
-0
runtime.h
src/runtime/runtime.h
+2
-1
No files found.
src/runtime/proc.c
View file @
3835e01d
...
...
@@ -74,6 +74,21 @@ sys·newproc(int32 siz, byte* fn, byte* arg0)
//prints("\n");
}
void
tracebackothers
(
G
*
me
)
{
G
*
g
;
for
(
g
=
allg
;
g
!=
nil
;
g
=
g
->
alllink
)
{
if
(
g
==
me
)
continue
;
prints
(
"
\n
goroutine "
);
sys
·
printint
(
g
->
goid
);
prints
(
":
\n
"
);
traceback
(
g
->
sched
.
PC
,
g
->
sched
.
SP
+
8
,
g
);
// gogo adjusts SP by 8 (not portable!)
}
}
G
*
select
(
void
)
{
...
...
src/runtime/rt1_amd64_darwin.c
View file @
3835e01d
...
...
@@ -149,6 +149,7 @@ sighandler(int32 sig, siginfo *info, void *context)
prints
(
"
\n\n
"
);
traceback
((
void
*
)
ss
->
__rip
,
(
void
*
)
ss
->
__rsp
,
(
void
*
)
ss
->
__r15
);
tracebackothers
((
void
*
)
ss
->
__r15
);
print_thread_state
(
ss
);
sys
·
exit
(
2
);
...
...
src/runtime/rt1_amd64_linux.c
View file @
3835e01d
...
...
@@ -153,7 +153,8 @@ sighandler(int32 sig, siginfo* info, void** context)
prints
(
"
\n\n
"
);
traceback
((
void
*
)
sc
->
rip
,
(
void
*
)
sc
->
rsp
,
(
void
*
)
sc
->
r15
);
print_sigcontext
(
sc
);
tracebackothers
((
void
*
)
sc
->
__r15
);
print_sigcontext
(
sc
);
sys
·
breakpoint
();
sys
·
exit
(
2
);
...
...
src/runtime/runtime.c
View file @
3835e01d
...
...
@@ -19,6 +19,7 @@ sys·panicl(int32 lno)
prints
(
"
\n
"
);
sp
=
(
uint8
*
)
&
lno
;
traceback
(
sys
·
getcallerpc
(
&
lno
),
sp
,
g
);
tracebackothers
(
g
);
sys
·
breakpoint
();
sys
·
exit
(
2
);
}
...
...
src/runtime/runtime.h
View file @
3835e01d
...
...
@@ -106,7 +106,7 @@ struct G
byte
*
stackbase
;
// must not move
byte
*
stack0
;
// first stack segment
Gobuf
sched
;
G
*
alllink
;
// on all
q
G
*
alllink
;
// on all
g
void
*
param
;
// passed parameter on wakeup
int16
status
;
int32
goid
;
...
...
@@ -189,6 +189,7 @@ void* mal(uint32);
uint32
cmpstring
(
string
,
string
);
void
initsig
(
void
);
void
traceback
(
uint8
*
pc
,
uint8
*
sp
,
G
*
gp
);
void
tracebackothers
(
G
*
);
int32
open
(
byte
*
,
int32
,
...);
int32
read
(
int32
,
void
*
,
int32
);
int32
write
(
int32
,
void
*
,
int32
);
...
...
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