Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
pubx
delve
提交
d756eba1
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,发现更多精彩内容 >>
提交
d756eba1
编写于
1月 26, 2016
作者:
L
Luke Hoban
提交者:
Derek Parker
1月 26, 2016
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[service/debugger] Case-insensitive paths on Windows
Fixes #370.
上级
39bc379d
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
19 addition
and
6 deletion
+19
-6
proc/proc.go
proc/proc.go
+1
-1
proc/test/support.go
proc/test/support.go
+6
-2
service/debugger/debugger.go
service/debugger/debugger.go
+1
-1
service/debugger/locations.go
service/debugger/locations.go
+11
-2
未找到文件。
proc/proc.go
浏览文件 @
d756eba1
...
...
@@ -161,8 +161,8 @@ func (dbp *Process) LoadInformation(path string) error {
}
// FindFileLocation returns the PC for a given file:line.
// Assumes that `file` is normailzed to lower case and '/' on Windows.
func
(
dbp
*
Process
)
FindFileLocation
(
fileName
string
,
lineno
int
)
(
uint64
,
error
)
{
fileName
=
filepath
.
ToSlash
(
fileName
)
pc
,
_
,
err
:=
dbp
.
goSymTable
.
LineToPC
(
fileName
,
lineno
)
if
err
!=
nil
{
return
0
,
err
...
...
proc/test/support.go
浏览文件 @
d756eba1
...
...
@@ -7,8 +7,9 @@ import (
"os"
"os/exec"
"path/filepath"
"testing"
"runtime"
"strings"
"testing"
)
// Fixture is a test binary.
...
...
@@ -64,7 +65,10 @@ func BuildFixture(name string) Fixture {
source
,
_
:=
filepath
.
Abs
(
path
)
source
=
filepath
.
ToSlash
(
source
)
if
runtime
.
GOOS
==
"windows"
{
source
=
strings
.
ToLower
(
source
)
}
Fixtures
[
name
]
=
Fixture
{
Name
:
name
,
Path
:
tmpfile
,
Source
:
source
}
return
Fixtures
[
name
]
}
...
...
service/debugger/debugger.go
浏览文件 @
d756eba1
...
...
@@ -149,7 +149,7 @@ func (d *Debugger) CreateBreakpoint(requestedBp *api.Breakpoint) (*api.Breakpoin
)
switch
{
case
len
(
requestedBp
.
File
)
>
0
:
addr
,
err
=
d
.
process
.
FindFileLocation
(
requestedBp
.
File
,
requestedBp
.
Line
)
addr
,
err
=
d
.
process
.
FindFileLocation
(
normalizePath
(
requestedBp
.
File
)
,
requestedBp
.
Line
)
case
len
(
requestedBp
.
FunctionName
)
>
0
:
if
requestedBp
.
Line
>=
0
{
addr
,
err
=
d
.
process
.
FindFunctionLocation
(
requestedBp
.
FunctionName
,
false
,
requestedBp
.
Line
)
...
...
service/debugger/locations.go
浏览文件 @
d756eba1
...
...
@@ -6,6 +6,7 @@ import (
"go/constant"
"path/filepath"
"reflect"
"runtime"
"strconv"
"strings"
...
...
@@ -49,6 +50,13 @@ type FuncLocationSpec struct {
BaseName
string
}
func
normalizePath
(
path
string
)
string
{
if
runtime
.
GOOS
!=
"windows"
{
return
path
}
return
strings
.
ToLower
(
filepath
.
ToSlash
(
path
))
}
func
parseLocationSpec
(
locStr
string
)
(
LocationSpec
,
error
)
{
rest
:=
locStr
...
...
@@ -98,7 +106,7 @@ func parseLocationSpecDefault(locStr, rest string) (LocationSpec, error) {
v
:=
strings
.
Split
(
rest
,
":"
)
if
len
(
v
)
>
2
{
// On Windows, path may contain ":", so split only on last ":"
v
=
[]
string
{
strings
.
Join
(
v
[
0
:
len
(
v
)
-
1
],
":"
),
v
[
len
(
v
)
-
1
]
}
v
=
[]
string
{
strings
.
Join
(
v
[
0
:
len
(
v
)
-
1
],
":"
),
v
[
len
(
v
)
-
1
]
}
}
if
len
(
v
)
==
1
{
...
...
@@ -111,7 +119,6 @@ func parseLocationSpecDefault(locStr, rest string) (LocationSpec, error) {
spec
:=
&
NormalLocationSpec
{}
spec
.
Base
=
v
[
0
]
spec
.
Base
=
filepath
.
ToSlash
(
spec
.
Base
)
spec
.
FuncBase
=
parseFuncLocationSpec
(
spec
.
Base
)
if
len
(
v
)
<
2
{
...
...
@@ -284,6 +291,8 @@ func (loc *NormalLocationSpec) FileMatch(path string) bool {
}
func
partialPathMatch
(
expr
,
path
string
)
bool
{
expr
=
normalizePath
(
expr
)
path
=
normalizePath
(
path
)
if
len
(
expr
)
<
len
(
path
)
-
1
{
return
strings
.
HasSuffix
(
path
,
expr
)
&&
(
path
[
len
(
path
)
-
len
(
expr
)
-
1
]
==
'/'
)
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录