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
2d55fdb5
Commit
2d55fdb5
authored
Jan 08, 2014
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debug/goobj: add String methods for SymID and SymKind
R=iant CC=golang-codereviews
https://golang.org/cl/48890044
parent
06c02804
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
0 deletions
+50
-0
src/pkg/debug/goobj/read.go
src/pkg/debug/goobj/read.go
+50
-0
No files found.
src/pkg/debug/goobj/read.go
View file @
2d55fdb5
...
...
@@ -72,6 +72,49 @@ const (
SHOSTOBJ
)
var
symKindStrings
=
[]
string
{
SBSS
:
"SBSS"
,
SCONST
:
"SCONST"
,
SDATA
:
"SDATA"
,
SDYNIMPORT
:
"SDYNIMPORT"
,
SELFROSECT
:
"SELFROSECT"
,
SELFRXSECT
:
"SELFRXSECT"
,
SELFSECT
:
"SELFSECT"
,
SFILE
:
"SFILE"
,
SFILEPATH
:
"SFILEPATH"
,
SFUNCTAB
:
"SFUNCTAB"
,
SGOFUNC
:
"SGOFUNC"
,
SGOSTRING
:
"SGOSTRING"
,
SHOSTOBJ
:
"SHOSTOBJ"
,
SINITARR
:
"SINITARR"
,
SMACHO
:
"SMACHO"
,
SMACHOGOT
:
"SMACHOGOT"
,
SMACHOINDIRECTGOT
:
"SMACHOINDIRECTGOT"
,
SMACHOINDIRECTPLT
:
"SMACHOINDIRECTPLT"
,
SMACHOPLT
:
"SMACHOPLT"
,
SMACHOSYMSTR
:
"SMACHOSYMSTR"
,
SMACHOSYMTAB
:
"SMACHOSYMTAB"
,
SNOPTRBSS
:
"SNOPTRBSS"
,
SNOPTRDATA
:
"SNOPTRDATA"
,
SPCLNTAB
:
"SPCLNTAB"
,
SRODATA
:
"SRODATA"
,
SSTRING
:
"SSTRING"
,
SSYMTAB
:
"SSYMTAB"
,
STEXT
:
"STEXT"
,
STLSBSS
:
"STLSBSS"
,
STYPE
:
"STYPE"
,
STYPELINK
:
"STYPELINK"
,
SWINDOWS
:
"SWINDOWS"
,
SXREF
:
"SXREF"
,
}
func
(
k
SymKind
)
String
()
string
{
if
k
<
0
||
int
(
k
)
>=
len
(
symKindStrings
)
{
return
fmt
.
Sprintf
(
"SymKind(%d)"
,
k
)
}
return
symKindStrings
[
k
]
}
// A Sym is a named symbol in an object file.
type
Sym
struct
{
SymID
// symbol identifier (name and version)
...
...
@@ -98,6 +141,13 @@ type SymID struct {
Version
int
}
func
(
s
SymID
)
String
()
string
{
if
s
.
Version
==
0
{
return
s
.
Name
}
return
fmt
.
Sprintf
(
"%s<%d>"
,
s
.
Name
,
s
.
Version
)
}
// A Data is a reference to data stored in an object file.
// It records the offset and size of the data, so that a client can
// read the data only if necessary.
...
...
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