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
d4c2da40
Commit
d4c2da40
authored
Jun 24, 2008
by
Rob Pike
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
safety checks, waiting for gri's real tracking of PC and SP
extant code is too fragile SVN=124223
parent
7b409b30
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
+9
-4
rt0_amd64_darwin.s
src/runtime/rt0_amd64_darwin.s
+1
-1
rt1_amd64_darwin.c
src/runtime/rt1_amd64_darwin.c
+8
-3
No files found.
src/runtime/rt0_amd64_darwin.s
View file @
d4c2da40
...
...
@@ -64,7 +64,7 @@ TEXT sys_sigaction(SB),1,$-8
CALL notok(SB)
RET
TEXT sigtramp(SB),1,$
-
24
TEXT sigtramp(SB),1,$24
MOVL DX,0(SP)
MOVQ CX,8(SP)
MOVQ R8,16(SP)
...
...
src/runtime/rt1_amd64_darwin.c
View file @
d4c2da40
...
...
@@ -39,6 +39,7 @@ typedef struct sigaction {
void
sighandler
(
int32
sig
,
siginfo
*
info
,
void
**
context
)
{
int32
i
;
void
*
pc
,
*
sp
;
if
(
sig
<
0
||
sig
>=
NSIG
){
prints
(
"Signal "
);
...
...
@@ -46,14 +47,18 @@ sighandler(int32 sig, siginfo* info, void** context) {
}
else
{
prints
(
sigtab
[
sig
].
name
);
}
prints
(
"
\n
Faulting address: 0x"
);
sys_printpointer
(
info
->
si_addr
);
prints
(
"
\n
PC: 0x"
);
sys_printpointer
(((
void
**
)((
&
sig
)
+
1
))[
22
]);
pc
=
((
void
**
)((
&
sig
)
+
1
))[
22
];
sys_printpointer
(
pc
);
prints
(
"
\n
SP: 0x"
);
sys_printpointer
(((
void
**
)((
&
sig
)
+
1
))[
13
]);
sp
=
((
void
**
)((
&
sig
)
+
1
))[
13
];
sys_printpointer
(
sp
);
prints
(
"
\n
"
);
traceback
(((
void
**
)((
&
sig
)
+
1
))[
22
],
((
void
**
)((
&
sig
)
+
1
))[
13
]);
/* empirically discovered locations */
if
(
pc
!=
0
&&
sp
!=
0
)
traceback
(
pc
,
sp
);
/* empirically discovered locations */
sys_exit
(
2
);
}
...
...
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