debugserver: fix typo in checking whether debugserver support unmask_… (#2581)

* debugserver: fix typo in checking whether debugserver support unmask_signals

* gdbserver.go: fix issues in deepsource:go
This commit is contained in:
Augusto Yao 2021-07-13 23:37:26 +08:00 committed by GitHub
parent 569b772b82
commit 686989e1b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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)