Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
HugeYuan
delve
提交
ce83862d
D
delve
项目概览
HugeYuan
/
delve
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
delve
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
ce83862d
编写于
8月 19, 2017
作者:
A
aarzilli
提交者:
Derek Parker
11月 03, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
pkg/dwarf/line: support DW_LNE_define_file
上级
73a39b98
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
35 addition
and
21 deletion
+35
-21
pkg/dwarf/line/line_parser.go
pkg/dwarf/line/line_parser.go
+21
-12
pkg/dwarf/line/state_machine.go
pkg/dwarf/line/state_machine.go
+14
-9
未找到文件。
pkg/dwarf/line/line_parser.go
浏览文件 @
ce83862d
...
...
@@ -114,23 +114,32 @@ func parseIncludeDirs(info *DebugLineInfo, buf *bytes.Buffer) {
func
parseFileEntries
(
info
*
DebugLineInfo
,
buf
*
bytes
.
Buffer
)
{
for
{
entry
:=
new
(
FileEntry
)
entry
.
Path
,
_
=
util
.
ParseString
(
buf
)
entry
:=
readFileEntry
(
info
,
buf
,
true
)
if
entry
.
Path
==
""
{
break
}
entry
.
DirIdx
,
_
=
util
.
DecodeULEB128
(
buf
)
entry
.
LastModTime
,
_
=
util
.
DecodeULEB128
(
buf
)
entry
.
Length
,
_
=
util
.
DecodeULEB128
(
buf
)
if
!
filepath
.
IsAbs
(
entry
.
Path
)
{
if
entry
.
DirIdx
>=
0
&&
entry
.
DirIdx
<
uint64
(
len
(
info
.
IncludeDirs
))
{
entry
.
Path
=
filepath
.
Join
(
info
.
IncludeDirs
[
entry
.
DirIdx
],
entry
.
Path
)
}
}
info
.
FileNames
=
append
(
info
.
FileNames
,
entry
)
info
.
Lookup
[
entry
.
Path
]
=
entry
}
}
func
readFileEntry
(
info
*
DebugLineInfo
,
buf
*
bytes
.
Buffer
,
exitOnEmptyPath
bool
)
*
FileEntry
{
entry
:=
new
(
FileEntry
)
entry
.
Path
,
_
=
util
.
ParseString
(
buf
)
if
entry
.
Path
==
""
&&
exitOnEmptyPath
{
return
entry
}
entry
.
DirIdx
,
_
=
util
.
DecodeULEB128
(
buf
)
entry
.
LastModTime
,
_
=
util
.
DecodeULEB128
(
buf
)
entry
.
Length
,
_
=
util
.
DecodeULEB128
(
buf
)
if
!
filepath
.
IsAbs
(
entry
.
Path
)
{
if
entry
.
DirIdx
>=
0
&&
entry
.
DirIdx
<
uint64
(
len
(
info
.
IncludeDirs
))
{
entry
.
Path
=
filepath
.
Join
(
info
.
IncludeDirs
[
entry
.
DirIdx
],
entry
.
Path
)
}
}
return
entry
}
pkg/dwarf/line/state_machine.go
浏览文件 @
ce83862d
...
...
@@ -38,6 +38,8 @@ type StateMachine struct {
buf
*
bytes
.
Buffer
// remaining instructions
opcodes
[]
opcodefn
definedFiles
[]
*
FileEntry
// files defined with DW_LINE_define_file
lastAddress
uint64
lastFile
string
lastLine
int
...
...
@@ -335,7 +337,16 @@ func advanceline(sm *StateMachine, buf *bytes.Buffer) {
func
setfile
(
sm
*
StateMachine
,
buf
*
bytes
.
Buffer
)
{
i
,
_
:=
util
.
DecodeULEB128
(
buf
)
sm
.
file
=
sm
.
dbl
.
FileNames
[
i
-
1
]
.
Path
if
i
-
1
<
uint64
(
len
(
sm
.
dbl
.
FileNames
))
{
sm
.
file
=
sm
.
dbl
.
FileNames
[
i
-
1
]
.
Path
}
else
{
j
:=
(
i
-
1
)
-
uint64
(
len
(
sm
.
dbl
.
FileNames
))
if
j
<
uint64
(
len
(
sm
.
definedFiles
))
{
sm
.
file
=
sm
.
definedFiles
[
j
]
.
Path
}
else
{
sm
.
file
=
""
}
}
}
func
setcolumn
(
sm
*
StateMachine
,
buf
*
bytes
.
Buffer
)
{
...
...
@@ -376,12 +387,6 @@ func setaddress(sm *StateMachine, buf *bytes.Buffer) {
}
func
definefile
(
sm
*
StateMachine
,
buf
*
bytes
.
Buffer
)
{
var
(
_
,
_
=
util
.
ParseString
(
buf
)
_
,
_
=
util
.
DecodeULEB128
(
buf
)
_
,
_
=
util
.
DecodeULEB128
(
buf
)
_
,
_
=
util
.
DecodeULEB128
(
buf
)
)
// Don't do anything here yet.
entry
:=
readFileEntry
(
sm
.
dbl
,
sm
.
buf
,
false
)
sm
.
definedFiles
=
append
(
sm
.
definedFiles
,
entry
)
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录