From 686989e1b3d996ce44c6b5dd8cd77c21cbe15013 Mon Sep 17 00:00:00 2001 From: Augusto Yao <727004611@qq.com> Date: Tue, 13 Jul 2021 23:37:26 +0800 Subject: [PATCH] =?UTF-8?q?debugserver:=20fix=20typo=20in=20checking=20whe?= =?UTF-8?q?ther=20debugserver=20support=20unmask=5F=E2=80=A6=20(#2581)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * debugserver: fix typo in checking whether debugserver support unmask_signals * gdbserver.go: fix issues in deepsource:go --- pkg/proc/gdbserial/gdbserver.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkg/proc/gdbserial/gdbserver.go b/pkg/proc/gdbserial/gdbserver.go index 7a72910d..d079bcd1 100644 --- a/pkg/proc/gdbserial/gdbserver.go +++ b/pkg/proc/gdbserial/gdbserver.go @@ -395,7 +395,7 @@ func getDebugServerAbsolutePath() string { func canUnmaskSignals(debugServerExecutable string) bool { checkCanUnmaskSignalsOnce.Do(func() { - buf, _ := exec.Command(debugServerExecutable, "--unmask-singals").CombinedOutput() + buf, _ := exec.Command(debugServerExecutable, "--unmask-signals").CombinedOutput() canUnmaskSignalsCached = !strings.Contains(string(buf), "unrecognized option") }) return canUnmaskSignalsCached @@ -897,7 +897,7 @@ func (p *gdbProcess) findThreadByStrID(threadID string) *gdbThread { // and returns true if we should stop execution in response to one of the // signals and return control to the user. // Adjusts trapthread to a thread that we actually want to stop at. -func (p *gdbProcess) handleThreadSignals(trapthread *gdbThread) (trapthreadOut *gdbThread, atstart bool, shouldStop bool) { +func (p *gdbProcess) handleThreadSignals(trapthread *gdbThread) (trapthreadOut *gdbThread, atstart, shouldStop bool) { var trapthreadCandidate *gdbThread for _, th := range p.threads { @@ -1575,8 +1575,7 @@ func (t *gdbThread) reloadRegisters() error { } } - switch t.p.bi.GOOS { - case "linux": + if t.p.bi.GOOS == "linux" { if reg, hasFsBase := t.regs.regs[t.p.regnames.FsBase]; hasFsBase { t.regs.gaddr = 0 t.regs.tls = binary.LittleEndian.Uint64(reg.value)