Slightly better version check for gdb server on newer macOS (arm64) (#2461)

* proc: Slightly better version check for gdb server on newer macOS

* Adjusted version to be >= 1200 and <= 1205
This commit is contained in:
Christian Banse 2021-05-04 21:33:10 +02:00 committed by GitHub
parent 9ed4ba0c49
commit 4bd16ad756
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -330,8 +330,11 @@ func (p *gdbProcess) Connect(conn net.Conn, path string, pid int, debugInfoDirs
// Workaround for darwin arm64. Apple's debugserver seems to have a problem
// with not selecting the correct thread in the 'g' command and the returned
// registers are empty / an E74 error is thrown.
if v[len("version:"):] == "1200" && p.bi.Arch.Name == "arm64" {
// registers are empty / an E74 error is thrown. This was reported to LLVM
// as https://bugs.llvm.org/show_bug.cgi?id=50169
version, err := strconv.ParseInt(v[len("version:"):], 10, 32)
if err == nil && version >= 1200 && version <= 1205 && p.bi.Arch.Name == "arm64" {
p.gcmdok = false
}
}