-
Notifications
You must be signed in to change notification settings - Fork 3
update delve version #68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The builder is currently spending 15 to 20 minutes installing gcc and upgrading packages every time we run the tests. Because of this the build fails sometimes by running out of time. This change reduces that to 5 minutes by: * switching from curl to wget (which seems to have fewer dependencies) * not installing gcc on ppc64le * skipping tests that depend on gcc or other binutils
Add automatic paging to the output of print, vars, args and locals. Fixes go-delve#3615
The flake manifests as an error where the variable i can not be found in frame 1 and happens in go1.22rc1 between 0.1% and 0.5% of the time (it is highly dependent on CPU contention) This problem is caused by the new code in evalop.PushLocal referencing the stale value of SelectedGoroutine. This happens because: - evalop.PushLocal calls ConvertEvalScope - ConvertEvalScope calls FindGoroutine - FindGoroutine checks the value of selectedGoroutine When breakpoint conditions are evaluated both the value of selectedGoroutine and currentThread are stale because we can only set their definitive value *after* all breakpoint conditions have been evaluated. The fact that it only happens in 1.22rc1 is coincidental, it's probably caused by the fact that 1.22rc1 migrates goroutines between threads more in this particular circumstance. This commit fixes the problem in two ways: 1. selectedGoroutine and currentThread are given temprorary non-stale values before breakpoint conditions are evaluated 2. evalop.PushLocal is changed so it takes a stack trace of the current thread rather than resolving it through the selected goroutine. Either one would suffice however I think we should do both, (2) ensures that the runtime.frame(n).var will work even if the current thread is not running any goroutine and (1) ensures that we don't accidentally reference a stale selectedGoroutine in the future.
With the glibc loader the link map entry for the static executable has an empty name field and address equal to 0x0. This case was already handled by the check in bininfo.go AddImage for names to be valid paths. With the musl loader however the first entry, corresponding to the static executable, has a valid path with address equal to 0x0, since we record a real address for the image corresponding to the static executable this results in having two entries for the executable when musl is used to link go programs. Change the code scanning the debug link map so that the first entry is skipped if it has address equal to zero. Fixes go-delve#3617
The first frame after sigpanic didn't execute a call so we shouldn't decrement the PC address to look up its location. Fixes go-delve#3634
Removes unnecessary code from nonative_darwin.go
…elve#3636) Adds a support sentinel file for building on FreeBSD with cgo disabled. Makes the build error for FreeBSD easier to understand. Fixes go-delve#3630
go-delve#3644) _fixtures/fncall.go was made to support TestCallFunction in pkg/proc and new things must be added to fncall.go to test new features. Having a test depend on precise line numbers makes the process tedious.
…3642) The test can never work on development versions of Go.
We used to autoremove the trace recorded by rr but as a result of various refactorings done to implement follow exec mode this broke. Restore the functionality. Also remove the _fixtures/testfnpos.go file which is autogenerated during testing.
When the users uses a reslice operation load the whole resliced variable, ignoring the MaxArrayValues setting. Only apply this when the 'high' part is specified and a literal and the 'low' part is either unspecified or a literal. Fixes go-delve#3600
) Add a waitfor option for 'dap attach' that waits for a process with a given name to appear before attaching to it. This recovers PR go-delve#3584, originally by @muggle-nil, which was fine except for a broken test.
Add support for listening on a unix domain socket in headless mode and in the 'connect' command. Fixes go-delve#3654
Adds configurable highlighting for function names and filenames in stack traces. Fixes go-delve#720
Add option to configure prompt color. Fixes go-delve#3603
…lve#3660) If /proc/net/tcp contains a large number of entries (>9999), parsing lines with len(sl) > 4 fails with the fixed width pattern. In that case the lines are silently ignored.
It did not terminate the section with the required 0 byte.
- skip staticcheck on go1.23 for now - fix reading interface values in go1.23 - sync list of waitreasons from go1.23
Add ability to write out section headers to elfwriter.
The next-instruction (nexti) command behaves like step-instruction (stepi) however, similar to the `next` command it will step over function calls.
| echo Finding latest patch version for $version | ||
| echo "Go $version on $arch" | ||
| version=$(curl 'https://go.dev/dl/?mode=json&include=all' | jq '.[].version' --raw-output | egrep ^$version'($|\.|beta|rc)' | sort -rV | head -1) | ||
| version=$(wget -q -O - 'https://go.dev/dl/?mode=json&include=all' | jq '.[].version' --raw-output | egrep ^$version'($|\.|beta|rc)' | sort -rV | head -1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: egrep is non-standard and deprecated. Use grep -E instead. [SC2196]
Details
lint 解释
egrep 是一个非标准的命令,已经被弃用。建议使用 grep -E 作为替代。
错误用法
# 错误示例:使用 egrep 命令
egrep "pattern" file.txt正确用法
# 正确示例:使用 grep -E 命令
grep -E "pattern" file.txt💡 以上内容由 AI 辅助生成,如有疑问欢迎反馈交流
| echo "Go $version on $arch" | ||
| version=$(curl 'https://go.dev/dl/?mode=json&include=all' | jq '.[].version' --raw-output | egrep ^$version'($|\.|beta|rc)' | sort -rV | head -1) | ||
| version=$(wget -q -O - 'https://go.dev/dl/?mode=json&include=all' | jq '.[].version' --raw-output | egrep ^$version'($|\.|beta|rc)' | sort -rV | head -1) | ||
| if [ "x$version" = "x" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: Avoid x-prefix in comparisons as it no longer serves a purpose. [SC2268]
Details
lint 解释
这个lint结果提示你避免在比较中使用x前缀,因为该前缀不再有实际用途。
错误用法
if [[ $var == x123 ]]; then
echo "Match"
fi在这个例子中,x123中的x前缀是不必要的。
正确用法
if [[ $var == 123 ]]; then
echo "Match"
fi在这个正确的例子中,我们直接使用了123,没有使用x前缀。
💡 以上内容由 AI 辅助生成,如有疑问欢迎反馈交流
| version=$(wget -q -O - 'https://go.dev/dl/?mode=json&include=all' | jq '.[].version' --raw-output | egrep ^$version'($|\.|beta|rc)' | sort -rV | head -1) | ||
| if [ "x$version" = "x" ]; then | ||
| version=$(curl 'https://go.dev/dl/?mode=json&include=all' | jq '.[].version' --raw-output | egrep ^$version'($|\.)' | sort -rV | head -1) | ||
| version=$(wget -q -O - 'https://go.dev/dl/?mode=json&include=all' | jq '.[].version' --raw-output | egrep ^$version'($|\.)' | sort -rV | head -1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: egrep is non-standard and deprecated. Use grep -E instead. [SC2196]
Details
lint 解释
egrep 是一个非标准的命令,已经被弃用。建议使用 grep -E 作为替代。
错误用法
# 错误示例:使用 egrep 命令
egrep "pattern" file.txt正确用法
# 正确示例:使用 grep -E 命令
grep -E "pattern" file.txt💡 以上内容由 AI 辅助生成,如有疑问欢迎反馈交流
| @@ -19,9 +19,9 @@ def splitver(x): | |||
| return v | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bad indentation. Found 1 spaces, expected 4 (bad-indentation)
Details
lint 解释
这个lint结果表明在代码中发现了不正确的缩进。具体来说,发现了一个使用了1个空格进行缩进的地方,而预期的缩进应该是4个空格。
错误用法
def example_function():
print("Hello, World!")在这个例子中,print("Hello, World!") 这一行代码没有正确缩进,使用了1个空格进行缩进,而不是预期的4个空格。
正确用法
def example_function():
print("Hello, World!")在这个例子中,print("Hello, World!") 这一行代码正确地使用了4个空格进行了缩进。
💡 以上内容由 AI 辅助生成,如有疑问欢迎反馈交流
| for x in ds: | ||
| if x['version'][:len(ver)] == ver: | ||
| print x['version'] | ||
| print(x['version']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bad indentation. Found 2 spaces, expected 8 (bad-indentation)
Details
lint 解释
这个lint结果表明在代码中发现了不正确的缩进。具体来说,发现了一个使用了2个空格进行缩进的地方,而预期的缩进应该是8个空格。
错误用法
def example_function():
print("This is an incorrect indentation.")在这个例子中,print语句的缩进是2个空格,这是不正确的。
正确用法
def example_function():
print("This is the correct indentation.")在这个例子中,print语句的缩进是8个空格,这是正确的。
💡 以上内容由 AI 辅助生成,如有疑问欢迎反馈交流
| @@ -1,6 +1,6 @@ | |||
| #!/usr/bin/python | |||
| #!/usr/bin/python3 | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing module docstring (missing-module-docstring)
Details
lint 解释
missing-module-docstring 是一个常见的代码质量检查,用于确保模块(即Python文件)的顶部包含文档字符串(docstring)。文档字符串是用三引号括起来的字符串,通常位于模块、类或函数的开头,用于描述其用途和功能。
错误用法
以下是一个缺少模块文档字符串的示例:
# scripts/latestver.py
def get_latest_version():
"""获取最新版本"""
return "1.0.0"在这个例子中,虽然函数 get_latest_version 有文档字符串,但模块本身没有文档字符串。
正确用法
以下是一个包含模块文档字符串的示例:
# scripts/latestver.py
"""这是一个脚本文件, 用于获取最新版本信息"""
def get_latest_version():
"""获取最新版本"""
return "1.0.0"在这个例子中,模块顶部添加了一个文档字符串,描述了该脚本的功能。
💡 以上内容由 AI 辅助生成,如有疑问欢迎反馈交流
|
|
||
| ver = sys.argv[1] | ||
| d = json.loads(urllib.urlopen('https://go.dev/dl/?mode=json&include=all').read()) | ||
| d = json.loads(urllib.request.urlopen('https://go.dev/dl/?mode=json&include=all').read()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using 'with' for resource-allocating operations (consider-using-with)
Details
lint 解释
这个lint结果提示你使用with语句来处理资源分配操作,以确保资源在使用完毕后能够正确释放。这样可以避免资源泄漏,并提高代码的健壮性。
错误用法
以下是一个错误的示例,展示了不使用with语句的情况:
# 错误用法示例
file = open('example.txt', 'r')
data = file.read()
file.close() # 忘记关闭文件在这个例子中,文件在读取后没有被正确关闭,可能会导致资源泄漏。
正确用法
以下是一个正确的示例,展示了使用with语句的情况:
# 正确用法示例
with open('example.txt', 'r') as file:
data = file.read()
# 文件在with块结束后会自动关闭在这个例子中,文件在读取后会被正确关闭,即使发生异常也会确保文件被关闭。
💡 以上内容由 AI 辅助生成,如有疑问欢迎反馈交流
| if x['version'][:len(ver)] == ver: | ||
| print x['version'] | ||
| print(x['version']) | ||
| exit(0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using 'sys.exit' instead (consider-using-sys-exit)
Details
lint 解释
这个lint结果提示你使用 sys.exit 代替当前的退出方式。sys.exit 是Python标准库中的一个函数,用于正常退出程序,并且可以传递一个状态码来表示程序的退出情况。
错误用法
import os
# 错误示例:使用os._exit
os._exit(0)在这个错误示例中,os._exit 是一个底层的退出函数,它会立即终止进程,不会执行任何清理操作。这可能会导致资源泄漏或其他不可预见的问题。
正确用法
import sys
# 正确示例:使用sys.exit
sys.exit(0)在这个正确示例中,sys.exit 是一个更安全的退出方式。它会执行必要的清理操作,并且可以传递一个状态码来表示程序的退出情况。通常,状态码为0表示成功,非零值表示错误。
💡 以上内容由 AI 辅助生成,如有疑问欢迎反馈交流
| d = json.loads(urllib.request.urlopen('https://go.dev/dl/?mode=json&include=all').read()) | ||
| ds = sorted(d, reverse=True, key=lambda it: splitver(it['version'][2:])) | ||
| for x in ds: | ||
| if x['version'][:len(ver)] == ver: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bad indentation. Found 1 spaces, expected 4 (bad-indentation)
Details
lint 解释
这个lint结果表明在代码中发现了不正确的缩进。具体来说,发现了一个使用了1个空格进行缩进的地方,而预期的缩进应该是4个空格。
错误用法
def example_function():
print("Hello, World!")在这个例子中,print("Hello, World!") 这一行代码没有正确缩进,使用了1个空格进行缩进,而不是预期的4个空格。
正确用法
def example_function():
print("Hello, World!")在这个例子中,print("Hello, World!") 这一行代码正确地使用了4个空格进行了缩进。
💡 以上内容由 AI 辅助生成,如有疑问欢迎反馈交流
| ) | ||
|
|
||
| var ( | ||
| ErrFuncCallNotAllowed = errors.New("function calls not allowed without using 'call'") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is your code not properly formatted? Here are some suggestions below
| ErrFuncCallNotAllowed = errors.New("function calls not allowed without using 'call'") | |
| ErrFuncCallNotAllowed = errors.New("function calls not allowed without using 'call'") |
Details
lint 解释
这个lint结果提示你的代码没有正确格式化。具体来说,它建议你使用errors.New函数创建错误时,应该在字符串前加上双引号。
错误用法
ErrFuncCallNotAllowed = errors.New("function calls not allowed without using 'call'")正确用法
ErrFuncCallNotAllowed = errors.New("function calls not allowed without using 'call'")💡 以上内容由 AI 辅助生成,如有疑问欢迎反馈交流
a2ba0db to
e60bc64
Compare
|
|
||
| zmmval := rest | ||
| zmmpos := _XSAVE_AVX512_ZMM_REGION_START + (n * 32) | ||
| zmmpos := xstate.zmmHi256offset + (n * 32) //TODO: change this!!! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A Note is recommended to use "MARKER(uid): note body" format.
Details
lint 解释
这个lint结果提示在注释中使用特定的格式,即“MARKER(uid): note body”,以确保注释的一致性和可读性。
错误用法
// 这是一个错误的注释格式正确用法
// MARKER(12345): 这是一个正确的注释格式,包含一个标记和注释内容💡 以上内容由 AI 辅助生成,如有疑问欢迎反馈交流
| fixtures := protest.FindFixturesDir() | ||
| // We always set breakpoints on some runtime functions at startup, so this would return with | ||
| // a breakpoints exists error. | ||
| // TODO: Perhaps we shouldn't be setting these default breakpoints in trace mode, however. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A Note is recommended to use "MARKER(uid): note body" format.
Details
lint 解释
这个lint结果提示建议使用“MARKER(uid): note body”格式来编写注释。
错误用法
// 这是一个错误的注释示例正确用法
// MARKER(12345): 这是一个正确的注释示例💡 以上内容由 AI 辅助生成,如有疑问欢迎反馈交流
| if err != nil { | ||
| return true | ||
| } | ||
| //TODO: this needs to be > hashTophashEmptyOne for go >= 1.12 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A Note is recommended to use "MARKER(uid): note body" format.
Details
lint 解释
这个lint结果提示在注释中使用“MARKER(uid): note body”格式是一个建议。这意味着在编写注释时,应该遵循这种特定的格式来提高代码的可读性和一致性。
错误用法
以下是一个错误的注释示例:
// 这是一个错误的注释示例正确用法
以下是一个正确的注释示例:
// MARKER(12345): 这是一个正确的注释示例💡 以上内容由 AI 辅助生成,如有疑问欢迎反馈交流
| @@ -2189,7 +2273,7 @@ func setVar(t *Term, ctx callContext, args string) error { | |||
| // HACK: in go '=' is not an operator, we detect the error and try to recover from it by splitting the input string | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A Note is recommended to use "MARKER(uid): note body" format.
Details
lint 解释
这个lint结果提示在注释中使用“MARKER(uid): note body”格式是一个推荐的做法。这意味着在编写注释时,应该遵循特定的格式来提高代码的可读性和一致性。
错误用法
以下是一个错误的注释示例:
// 这是一个错误的注释示例正确用法
以下是一个正确的注释示例:
// MARKER(12345): 这是一个正确的注释示例💡 以上内容由 AI 辅助生成,如有疑问欢迎反馈交流
| @@ -116,7 +117,7 @@ func rep(rl *liner.State, thread *starlark.Thread, globals starlark.StringDict, | |||
| if expr := soleExpr(f); expr != nil { | |||
| //TODO: check for 'exit' | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A Note is recommended to use "MARKER(uid): note body" format.
Details
lint 解释
这个lint结果提示在注释中使用“MARKER(uid): note body”格式是一个推荐的做法。这意味着在编写注释时,应该遵循这种特定的格式来提高代码的可读性和一致性。
错误用法
以下是一个错误的注释示例:
// 这是一个注释正确用法
以下是一个正确的注释示例:
// MARKER(12345): 这是一个注释💡 以上内容由 AI 辅助生成,如有疑问欢迎反馈交流
|
|
||
| func (ti *TrickyIterator) iterAll(s []int) Seq2[int, int] { | ||
| return func(yield func(int, int) bool) { | ||
| // NOTE: storing the yield func in the iterator has been removed because |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A Note is recommended to use "MARKER(uid): note body" format.
Details
lint 解释
这个lint结果提示你建议使用“MARKER(uid): note body”格式来编写注释。这意味着在代码中添加注释时,应该遵循这种特定的格式,以便于识别和理解。
错误用法
以下是一个错误的注释示例:
// 这是一个错误的注释示例正确用法
以下是一个正确的注释示例:
// MARKER(12345): 这是一个正确的注释示例💡 以上内容由 AI 辅助生成,如有疑问欢迎反馈交流
| @@ -888,14 +903,15 @@ continueLoop: | |||
| // NOTE: because debugserver will sometimes send two stop packets after a | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A Note is recommended to use "MARKER(uid): note body" format.
Details
lint 解释
这个lint结果提示建议使用“MARKER(uid): note body”格式来编写注释。
错误用法
// 这是一个错误的注释示例正确用法
// MARKER(12345): 这是一个正确的注释示例💡 以上内容由 AI 辅助生成,如有疑问欢迎反馈交流
|
|
||
| // TLS returns the address of the thread local storage memory segment. | ||
| func (r *RISCV64Registers) TLS() uint64 { | ||
| // TODO: calling cgo may overwrite $x27, read it from the kernel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A Note is recommended to use "MARKER(uid): note body" format.
Details
lint 解释
这个lint结果提示建议使用“MARKER(uid): note body”格式来编写注释。
错误用法
// 这是一个错误的注释示例正确用法
// MARKER(12345): 这是一个正确的注释示例💡 以上内容由 AI 辅助生成,如有疑问欢迎反馈交流
| } | ||
|
|
||
| func (it *mapIteratorSwiss) slotIsEmptyOrDeleted(k uint32) bool { | ||
| //TODO: check that this hasn't changed after it's merged and the TODO is deleted |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A Note is recommended to use "MARKER(uid): note body" format.
Details
lint 解释
这个lint结果提示在注释中使用“MARKER(uid): note body”格式是一个建议。这意味着在编写注释时,应该遵循这种特定的格式来提高代码的可读性和一致性。
错误用法
以下是一个错误的注释示例:
// 这是一个错误的注释示例正确用法
以下是一个正确的注释示例:
// MARKER(12345): 这是一个正确的注释示例💡 以上内容由 AI 辅助生成,如有疑问欢迎反馈交流
No description provided.