Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
pubx
delve
提交
4f813b81
D
delve
项目概览
pubx
/
delve
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
delve
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4f813b81
编写于
10月 27, 2017
作者:
A
aarzilli
提交者:
Derek Parker
12月 13, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
proc, terminal: use DW_AT_producer to warn user about optimized code
上级
07c71681
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
25 addition
and
4 deletion
+25
-4
pkg/proc/bininfo.go
pkg/proc/bininfo.go
+6
-0
pkg/proc/types.go
pkg/proc/types.go
+4
-0
pkg/terminal/command.go
pkg/terminal/command.go
+8
-0
service/api/conversions.go
service/api/conversions.go
+5
-4
service/api/types.go
service/api/types.go
+2
-0
未找到文件。
pkg/proc/bininfo.go
浏览文件 @
4f813b81
...
...
@@ -72,6 +72,7 @@ type compileUnit struct {
Name
string
// univocal name for non-go compile units
lineInfo
*
line
.
DebugLineInfo
// debug_line segment associated with this compile unit
LowPC
,
HighPC
uint64
optimized
bool
// this compile unit is optimized
}
// Function describes a function in the target program.
...
...
@@ -126,6 +127,11 @@ func (fn *Function) BaseName() string {
return
fn
.
Name
}
// Optimized returns true if the function was optimized by the compiler.
func
(
fn
*
Function
)
Optimized
()
bool
{
return
fn
.
cu
.
optimized
}
type
constantsMap
map
[
dwarf
.
Offset
]
*
constantType
type
constantType
struct
{
...
...
pkg/proc/types.go
浏览文件 @
4f813b81
...
...
@@ -204,6 +204,10 @@ func (bi *BinaryInfo) loadDebugInfoMaps(debugLineBytes []byte, wg *sync.WaitGrou
if
lineInfoOffset
>=
0
&&
lineInfoOffset
<
int64
(
len
(
debugLineBytes
))
{
cu
.
lineInfo
=
line
.
Parse
(
compdir
,
bytes
.
NewBuffer
(
debugLineBytes
[
lineInfoOffset
:
]))
}
if
producer
,
_
:=
entry
.
Val
(
dwarf
.
AttrProducer
)
.
(
string
);
cu
.
isgo
&&
producer
!=
""
{
semicolon
:=
strings
.
Index
(
producer
,
";"
)
cu
.
optimized
=
semicolon
<
0
||
!
strings
.
Contains
(
producer
[
semicolon
:
],
"-N"
)
||
!
strings
.
Contains
(
producer
[
semicolon
:
],
"-l"
)
}
bi
.
compileUnits
=
append
(
bi
.
compileUnits
,
cu
)
case
dwarf
.
TagArrayType
,
dwarf
.
TagBaseType
,
dwarf
.
TagClassType
,
dwarf
.
TagStructType
,
dwarf
.
TagUnionType
,
dwarf
.
TagConstType
,
dwarf
.
TagVolatileType
,
dwarf
.
TagRestrictType
,
dwarf
.
TagEnumerationType
,
dwarf
.
TagPointerType
,
dwarf
.
TagSubroutineType
,
dwarf
.
TagTypedef
,
dwarf
.
TagUnspecifiedType
:
...
...
pkg/terminal/command.go
浏览文件 @
4f813b81
...
...
@@ -23,6 +23,8 @@ import (
"github.com/derekparker/delve/service/debugger"
)
const
optimizedFunctionWarning
=
"Warning: debugging optimized function"
type
cmdPrefix
int
const
(
...
...
@@ -1353,6 +1355,9 @@ func printcontextThread(t *Term, th *api.Thread) {
if
th
.
Breakpoint
==
nil
{
fmt
.
Printf
(
"> %s() %s:%d (PC: %#v)
\n
"
,
fn
.
Name
,
ShortenFilePath
(
th
.
File
),
th
.
Line
,
th
.
PC
)
if
th
.
Function
!=
nil
&&
th
.
Function
.
Optimized
{
fmt
.
Println
(
optimizedFunctionWarning
)
}
return
}
...
...
@@ -1391,6 +1396,9 @@ func printcontextThread(t *Term, th *api.Thread) {
th
.
Breakpoint
.
TotalHitCount
,
th
.
PC
)
}
if
th
.
Function
!=
nil
&&
th
.
Function
.
Optimized
{
fmt
.
Println
(
optimizedFunctionWarning
)
}
if
th
.
BreakpointInfo
!=
nil
{
bp
:=
th
.
Breakpoint
...
...
service/api/conversions.go
浏览文件 @
4f813b81
...
...
@@ -212,10 +212,11 @@ func ConvertFunction(fn *proc.Function) *Function {
// those fields is not documented their value was replaced with 0 when
// gosym.Func was replaced by debug_info entries.
return
&
Function
{
Name
:
fn
.
Name
,
Type
:
0
,
Value
:
fn
.
Entry
,
GoType
:
0
,
Name
:
fn
.
Name
,
Type
:
0
,
Value
:
fn
.
Entry
,
GoType
:
0
,
Optimized
:
fn
.
Optimized
(),
}
}
...
...
service/api/types.go
浏览文件 @
4f813b81
...
...
@@ -148,6 +148,8 @@ type Function struct {
Value
uint64
`json:"value"`
Type
byte
`json:"type"`
GoType
uint64
`json:"goType"`
// Optimized is true if the function was optimized
Optimized
bool
`json:"optimized"`
}
// VariableFlags is the type of the Flags field of Variable.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录