*: Change comments to match common Go standarts (#3221)
This commit is contained in:
parent
753cb4cc3b
commit
9523849883
@ -36,7 +36,7 @@ type dataFormat interface {
|
||||
addrsize() int
|
||||
}
|
||||
|
||||
// Some parts of DWARF have no data format, e.g., abbrevs.
|
||||
// UnknownFormat is a struct for some parts of DWARF that have no data format, e.g., abbrevs.
|
||||
type UnknownFormat struct{}
|
||||
|
||||
func (u UnknownFormat) version() int {
|
||||
@ -66,7 +66,7 @@ func (b *buf) Uint8() uint8 {
|
||||
return val
|
||||
}
|
||||
|
||||
// Read a varint, which is 7 bits per byte, little endian.
|
||||
// Varint reads a varint, which is 7 bits per byte, little endian.
|
||||
// the 0x80 bit means read another byte.
|
||||
func (b *buf) Varint() (c uint64, bits uint) {
|
||||
for i := 0; i < len(b.data); i++ {
|
||||
@ -82,13 +82,13 @@ func (b *buf) Varint() (c uint64, bits uint) {
|
||||
return 0, 0
|
||||
}
|
||||
|
||||
// Unsigned int is just a varint.
|
||||
// Uint is just a varint.
|
||||
func (b *buf) Uint() uint64 {
|
||||
x, _ := b.Varint()
|
||||
return x
|
||||
}
|
||||
|
||||
// Signed int is a sign-extended varint.
|
||||
// Int is a sign-extended varint.
|
||||
func (b *buf) Int() int64 {
|
||||
ux, bits := b.Varint()
|
||||
x := int64(ux)
|
||||
|
@ -491,8 +491,8 @@ func SubstitutePath(path string, rules [][2]string) string {
|
||||
// On windows paths returned from headless server are as c:/dir/dir
|
||||
// though os.PathSeparator is '\\'
|
||||
|
||||
separator := "/" //make it default
|
||||
if strings.Contains(path, "\\") { //dependent on the path
|
||||
separator := "/" // make it default
|
||||
if strings.Contains(path, "\\") { // dependent on the path
|
||||
separator = "\\"
|
||||
}
|
||||
for _, r := range rules {
|
||||
|
@ -223,7 +223,7 @@ func arm64SwitchStack(it *stackIterator, callFrameRegs *op.DwarfRegisters) bool
|
||||
it.atend = true
|
||||
return true
|
||||
case "crosscall2":
|
||||
//The offsets get from runtime/cgo/asm_arm64.s:10
|
||||
// The offsets get from runtime/cgo/asm_arm64.s:10
|
||||
bpoff := uint64(14)
|
||||
lroff := uint64(15)
|
||||
if producer := it.bi.Producer(); producer != "" && goversion.ProducerAfterOrEqual(producer, 1, 19) {
|
||||
|
@ -43,7 +43,7 @@ func arm64AsmDecode(asmInst *AsmInstruction, mem []byte, regs *op.DwarfRegisters
|
||||
func resolveCallArgARM64(inst *arm64asm.Inst, instAddr uint64, currentGoroutine bool, regs *op.DwarfRegisters, mem MemoryReadWriter, bininfo *BinaryInfo) *Location {
|
||||
switch inst.Op {
|
||||
case arm64asm.BL, arm64asm.BLR, arm64asm.B, arm64asm.BR:
|
||||
//ok
|
||||
// ok
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
|
@ -396,7 +396,7 @@ func (t *thread) SetDX(uint64) error {
|
||||
return ErrChangeRegisterCore
|
||||
}
|
||||
|
||||
// ChangeRegs will always return an error, you cannot
|
||||
// SetReg will always return an error, you cannot
|
||||
// change register values when debugging core files.
|
||||
func (t *thread) SetReg(regNum uint64, reg *op.DwarfRegister) error {
|
||||
return ErrChangeRegisterCore
|
||||
|
@ -64,7 +64,7 @@ type RecordingManipulation interface {
|
||||
// Recorded returns true if the current process is a recording and the path
|
||||
// to the trace directory.
|
||||
Recorded() (recorded bool, tracedir string)
|
||||
// Direction changes execution direction.
|
||||
// ChangeDirection changes execution direction.
|
||||
ChangeDirection(Direction) error
|
||||
// GetDirection returns the current direction of execution.
|
||||
GetDirection() Direction
|
||||
|
@ -1,4 +1,4 @@
|
||||
// This package contains functions and data structures used by both the
|
||||
// Package linutil contains functions and data structures used by both the
|
||||
// linux implementation of the native backend and the core backend to deal
|
||||
// with structures used by the linux kernel.
|
||||
package linutil
|
||||
|
@ -10,11 +10,11 @@ import (
|
||||
|
||||
// ARM64Registers is a wrapper for sys.PtraceRegs.
|
||||
type ARM64Registers struct {
|
||||
Regs *ARM64PtraceRegs //general-purpose registers
|
||||
Regs *ARM64PtraceRegs // general-purpose registers
|
||||
iscgo bool
|
||||
tpidr_el0 uint64
|
||||
Fpregs []proc.Register //Formatted floating point registers
|
||||
Fpregset []byte //holding all floating point register values
|
||||
Fpregs []proc.Register // Formatted floating point registers
|
||||
Fpregset []byte // holding all floating point register values
|
||||
|
||||
loadFpRegs func(*ARM64Registers) error
|
||||
}
|
||||
|
@ -1047,7 +1047,7 @@ func TestKill(t *testing.T) {
|
||||
}
|
||||
if runtime.GOOS == "linux" {
|
||||
if runtime.GOARCH == "arm64" {
|
||||
//there is no any sync between signal sended(tracee handled) and open /proc/%d/. It may fail on arm64
|
||||
// there is no any sync between signal sended(tracee handled) and open /proc/%d/. It may fail on arm64
|
||||
return
|
||||
}
|
||||
_, err := os.Open(fmt.Sprintf("/proc/%d/", p.Pid()))
|
||||
@ -4693,7 +4693,7 @@ func TestPluginStepping(t *testing.T) {
|
||||
|
||||
func TestIssue1601(t *testing.T) {
|
||||
protest.MustHaveCgo(t)
|
||||
//Tests that recursive types involving C qualifiers and typedefs are parsed correctly
|
||||
// Tests that recursive types involving C qualifiers and typedefs are parsed correctly
|
||||
withTestProcess("issue1601", t, func(p *proc.Target, fixture protest.Fixture) {
|
||||
assertNoError(p.Continue(), t, "Continue")
|
||||
evalVariable(p, t, "C.globalq")
|
||||
|
@ -81,7 +81,7 @@ const (
|
||||
// the variable is the return value of a function call and allocated on a
|
||||
// frame that no longer exists)
|
||||
VariableFakeAddress
|
||||
// VariableCPrt means the variable is a C pointer
|
||||
// VariableCPtr means the variable is a C pointer
|
||||
VariableCPtr
|
||||
// VariableCPURegister means this variable is a CPU register.
|
||||
VariableCPURegister
|
||||
|
Loading…
Reference in New Issue
Block a user