Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
c7588418
Commit
c7588418
authored
Jul 19, 2013
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/ld, runtime: remove unused fields from Func
R=golang-dev, r CC=golang-dev
https://golang.org/cl/11604043
parent
7666f24a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
24 deletions
+23
-24
src/cmd/ld/lib.c
src/cmd/ld/lib.c
+1
-8
src/libmach/sym.c
src/libmach/sym.c
+17
-8
src/pkg/debug/gosym/pclntab.go
src/pkg/debug/gosym/pclntab.go
+4
-4
src/pkg/runtime/runtime.h
src/pkg/runtime/runtime.h
+1
-4
No files found.
src/cmd/ld/lib.c
View file @
c7588418
...
...
@@ -2400,7 +2400,7 @@ pclntab(void)
// fixed size of struct, checked below
off
=
funcstart
;
end
=
funcstart
+
PtrSize
+
6
*
4
+
5
*
4
+
npcdata
*
4
+
nfuncdata
*
PtrSize
;
end
=
funcstart
+
PtrSize
+
3
*
4
+
5
*
4
+
npcdata
*
4
+
nfuncdata
*
PtrSize
;
if
(
nfuncdata
>
0
&&
(
end
&
(
PtrSize
-
1
)))
end
+=
4
;
symgrow
(
ftab
,
end
);
...
...
@@ -2417,9 +2417,6 @@ pclntab(void)
off
=
setuint32
(
ftab
,
off
,
ArgsSizeUnknown
);
else
off
=
setuint32
(
ftab
,
off
,
cursym
->
args
);
// Dead space. TODO: Delete (and update all parsers).
off
=
setuint32
(
ftab
,
off
,
0
);
// frame int32
// TODO: Remove entirely. The pcsp table is more precise.
...
...
@@ -2432,10 +2429,6 @@ pclntab(void)
else
off
=
setuint32
(
ftab
,
off
,
(
uint32
)
cursym
->
text
->
to
.
offset
+
PtrSize
);
// Dead space. TODO: Delete (and update all parsers).
off
=
setuint32
(
ftab
,
off
,
0
);
off
=
setuint32
(
ftab
,
off
,
0
);
// pcsp table (offset int32)
off
=
addpctab
(
ftab
,
off
,
cursym
,
"pctospadj"
,
pctospadj
,
0
);
...
...
src/libmach/sym.c
View file @
c7588418
...
...
@@ -1563,6 +1563,15 @@ dumphist(char *name)
// Go 1.2 pcln table
// See golang.org/s/go12symtab.
// Func layout
#define FuncEntry (0)
#define FuncName (pcptrsize)
#define FuncArgs (pcptrsize+4)
#define FuncFrame (pcptrsize+2*4)
#define FuncPCSP (pcptrsize+3*4)
#define FuncPCFile (pcptrsize+4*4)
#define FuncPCLine (pcptrsize+5*4)
static
int32
pcquantum
;
static
int32
pcptrsize
;
static
uvlong
(
*
pcswav
)(
uvlong
);
...
...
@@ -1788,8 +1797,8 @@ go12pc2sp(uvlong pc)
f
=
go12findfunc
(
pc
);
if
(
f
==
nil
)
return
~
(
uvlong
)
0
;
entry
=
pcuintptr
(
f
);
off
=
pcswal
(
*
(
uint32
*
)(
f
+
pcptrsize
+
6
*
4
));
entry
=
pcuintptr
(
f
+
FuncEntry
);
off
=
pcswal
(
*
(
uint32
*
)(
f
+
FuncPCSP
));
sp
=
pcvalue
(
off
,
entry
,
pc
);
if
(
sp
<
0
)
return
~
(
uvlong
)
0
;
...
...
@@ -1807,9 +1816,9 @@ go12fileline(char *str, int n, uvlong pc)
f
=
go12findfunc
(
pc
);
if
(
f
==
nil
)
return
0
;
entry
=
pcuintptr
(
f
);
fileoff
=
pcswal
(
*
(
uint32
*
)(
f
+
pcptrsize
+
7
*
4
));
lineoff
=
pcswal
(
*
(
uint32
*
)(
f
+
pcptrsize
+
8
*
4
));
entry
=
pcuintptr
(
f
+
FuncEntry
);
fileoff
=
pcswal
(
*
(
uint32
*
)(
f
+
FuncPCFile
));
lineoff
=
pcswal
(
*
(
uint32
*
)(
f
+
FuncPCLine
));
lno
=
pcvalue
(
lineoff
,
entry
,
pc
);
fno
=
pcvalue
(
fileoff
,
entry
,
pc
);
if
(
lno
<
0
||
fno
<=
0
||
fno
>=
nfiletab
)
{
...
...
@@ -1845,9 +1854,9 @@ havefile:
// quick.
for
(
i
=
0
;
i
<
nfunctab
;
i
++
)
{
func
=
pcline
+
pcuintptr
(
functab
+
i
*
2
*
pcptrsize
+
pcptrsize
);
entry
=
pcuintptr
(
func
);
fp
=
pcline
+
pcswal
(
*
(
uint32
*
)(
func
+
pcptrsize
+
7
*
4
));
lp
=
pcline
+
pcswal
(
*
(
uint32
*
)(
func
+
pcptrsize
+
8
*
4
));
entry
=
pcuintptr
(
func
+
FuncEntry
);
fp
=
pcline
+
pcswal
(
*
(
uint32
*
)(
func
+
FuncPCFile
));
lp
=
pcline
+
pcswal
(
*
(
uint32
*
)(
func
+
FuncPCLine
));
fval
=
lval
=
-
1
;
fpc
=
lpc
=
entry
;
fstartpc
=
fpc
;
...
...
src/pkg/debug/gosym/pclntab.go
View file @
c7588418
...
...
@@ -339,7 +339,7 @@ func (t *LineTable) go12PCToLine(pc uint64) (line int) {
return
-
1
}
entry
:=
t
.
uintptr
(
f
)
linetab
:=
t
.
binary
.
Uint32
(
f
[
t
.
ptrsize
+
8
*
4
:
])
linetab
:=
t
.
binary
.
Uint32
(
f
[
t
.
ptrsize
+
5
*
4
:
])
return
int
(
t
.
pcvalue
(
linetab
,
entry
,
pc
))
}
...
...
@@ -356,7 +356,7 @@ func (t *LineTable) go12PCToFile(pc uint64) (file string) {
return
""
}
entry
:=
t
.
uintptr
(
f
)
filetab
:=
t
.
binary
.
Uint32
(
f
[
t
.
ptrsize
+
7
*
4
:
])
filetab
:=
t
.
binary
.
Uint32
(
f
[
t
.
ptrsize
+
4
*
4
:
])
fno
:=
t
.
pcvalue
(
filetab
,
entry
,
pc
)
if
fno
<=
0
{
return
""
...
...
@@ -384,8 +384,8 @@ func (t *LineTable) go12LineToPC(file string, line int) (pc uint64) {
for
i
:=
uint32
(
0
);
i
<
t
.
nfunctab
;
i
++
{
f
:=
t
.
Data
[
t
.
uintptr
(
t
.
functab
[
2
*
t
.
ptrsize
*
i
+
t
.
ptrsize
:
])
:
]
entry
:=
t
.
uintptr
(
f
)
filetab
:=
t
.
binary
.
Uint32
(
f
[
t
.
ptrsize
+
7
*
4
:
])
linetab
:=
t
.
binary
.
Uint32
(
f
[
t
.
ptrsize
+
8
*
4
:
])
filetab
:=
t
.
binary
.
Uint32
(
f
[
t
.
ptrsize
+
4
*
4
:
])
linetab
:=
t
.
binary
.
Uint32
(
f
[
t
.
ptrsize
+
5
*
4
:
])
pc
:=
t
.
findFileLine
(
entry
,
filetab
,
linetab
,
int32
(
filenum
),
int32
(
line
))
if
pc
!=
0
{
return
pc
...
...
src/pkg/runtime/runtime.h
View file @
c7588418
...
...
@@ -405,12 +405,9 @@ struct Func
uintptr
entry
;
// start pc
int32
nameoff
;
// function name
// TODO:
R
emove these fields.
// TODO:
Perhaps r
emove these fields.
int32
args
;
// in/out args size
int32
x1
;
// locals size
int32
frame
;
// legacy frame size; use pcsp if possible
int32
x2
;
int32
x3
;
int32
pcsp
;
int32
pcfile
;
...
...
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