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
88a3371a
Commit
88a3371a
authored
Jun 17, 2008
by
Rob Pike
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
print pc on faults
SVN=123030
parent
bb57a5bc
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
11 deletions
+37
-11
rt0_amd64_darwin.s
src/runtime/rt0_amd64_darwin.s
+5
-0
rt0_amd64_linux.s
src/runtime/rt0_amd64_linux.s
+5
-0
runtime.c
src/runtime/runtime.c
+26
-11
runtime.h
src/runtime/runtime.h
+1
-0
No files found.
src/runtime/rt0_amd64_darwin.s
View file @
88a3371a
...
...
@@ -84,3 +84,8 @@ TEXT sys_memclr(SB),1,$-8
REP
STOSQ
RET
TEXT sys_getcallerpc+0(SB),0,$0
MOVQ x+0(FP),AX
MOVQ -8(AX),AX
RET
src/runtime/rt0_amd64_linux.s
View file @
88a3371a
...
...
@@ -94,3 +94,8 @@ TEXT sys_memclr(SB),1,$-8
REP
STOSQ
RET
TEXT sys_getcallerpc+0(SB),0,$0
MOVQ x+0(FP),AX
MOVQ -8(AX),AX
RET
src/runtime/runtime.c
View file @
88a3371a
...
...
@@ -70,15 +70,6 @@ sys_printpointer(void *p)
sys_write
(
1
,
buf
+
i
,
nelem
(
buf
)
-
i
);
}
void
sys_panicl
(
int32
lno
)
{
prints
(
"
\n
panic on line "
);
sys_printint
(
lno
);
prints
(
"
\n
"
);
*
(
int32
*
)
0
=
0
;
}
void
sys_printstring
(
string
v
)
{
...
...
@@ -101,6 +92,24 @@ prints(int8 *s)
sys_write
(
1
,
s
,
strlen
(
s
));
}
void
sys_printpc
(
void
*
p
)
{
prints
(
"PC=0x"
);
sys_printpointer
(
sys_getcallerpc
(
p
));
}
void
sys_panicl
(
int32
lno
)
{
prints
(
"
\n
panic on line "
);
sys_printint
(
lno
);
prints
(
" "
);
sys_printpc
(
&
lno
);
prints
(
"
\n
"
);
*
(
int32
*
)
0
=
0
;
}
dump
(
byte
*
p
,
int32
n
)
{
uint32
v
;
...
...
@@ -307,8 +316,11 @@ sys_slicestring(string si, int32 lindex, int32 hindex, string so)
int32
l
;
if
(
lindex
<
0
||
lindex
>
si
->
len
||
hindex
<
lindex
||
hindex
>
si
->
len
)
hindex
<
lindex
||
hindex
>
si
->
len
)
{
sys_printpc
(
&
si
);
prints
(
" "
);
prbounds
(
"slice"
,
lindex
,
si
->
len
,
hindex
);
}
l
=
hindex
-
lindex
;
so
=
mal
(
sizeof
(
so
->
len
)
+
l
);
...
...
@@ -320,8 +332,11 @@ sys_slicestring(string si, int32 lindex, int32 hindex, string so)
void
sys_indexstring
(
string
s
,
int32
i
,
byte
b
)
{
if
(
i
<
0
||
i
>=
s
->
len
)
if
(
i
<
0
||
i
>=
s
->
len
)
{
sys_printpc
(
&
s
);
prints
(
" "
);
prbounds
(
"index"
,
0
,
i
,
s
->
len
);
}
b
=
s
->
str
[
i
];
FLUSH
(
&
b
);
...
...
src/runtime/runtime.h
View file @
88a3371a
...
...
@@ -91,6 +91,7 @@ void sys_write(int32, void*, int32);
void
sys_breakpoint
(
void
);
uint8
*
sys_mmap
(
byte
*
,
uint32
,
int32
,
int32
,
int32
,
uint32
);
void
sys_memclr
(
byte
*
,
uint32
);
void
*
sys_getcallerpc
(
void
*
);
/*
* runtime
...
...
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