*: 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
|
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{}
|
type UnknownFormat struct{}
|
||||||
|
|
||||||
func (u UnknownFormat) version() int {
|
func (u UnknownFormat) version() int {
|
||||||
@ -66,7 +66,7 @@ func (b *buf) Uint8() uint8 {
|
|||||||
return val
|
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.
|
// the 0x80 bit means read another byte.
|
||||||
func (b *buf) Varint() (c uint64, bits uint) {
|
func (b *buf) Varint() (c uint64, bits uint) {
|
||||||
for i := 0; i < len(b.data); i++ {
|
for i := 0; i < len(b.data); i++ {
|
||||||
@ -82,13 +82,13 @@ func (b *buf) Varint() (c uint64, bits uint) {
|
|||||||
return 0, 0
|
return 0, 0
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unsigned int is just a varint.
|
// Uint is just a varint.
|
||||||
func (b *buf) Uint() uint64 {
|
func (b *buf) Uint() uint64 {
|
||||||
x, _ := b.Varint()
|
x, _ := b.Varint()
|
||||||
return x
|
return x
|
||||||
}
|
}
|
||||||
|
|
||||||
// Signed int is a sign-extended varint.
|
// Int is a sign-extended varint.
|
||||||
func (b *buf) Int() int64 {
|
func (b *buf) Int() int64 {
|
||||||
ux, bits := b.Varint()
|
ux, bits := b.Varint()
|
||||||
x := int64(ux)
|
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
|
// On windows paths returned from headless server are as c:/dir/dir
|
||||||
// though os.PathSeparator is '\\'
|
// though os.PathSeparator is '\\'
|
||||||
|
|
||||||
separator := "/" //make it default
|
separator := "/" // make it default
|
||||||
if strings.Contains(path, "\\") { //dependent on the path
|
if strings.Contains(path, "\\") { // dependent on the path
|
||||||
separator = "\\"
|
separator = "\\"
|
||||||
}
|
}
|
||||||
for _, r := range rules {
|
for _, r := range rules {
|
||||||
|
@ -223,7 +223,7 @@ func arm64SwitchStack(it *stackIterator, callFrameRegs *op.DwarfRegisters) bool
|
|||||||
it.atend = true
|
it.atend = true
|
||||||
return true
|
return true
|
||||||
case "crosscall2":
|
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)
|
bpoff := uint64(14)
|
||||||
lroff := uint64(15)
|
lroff := uint64(15)
|
||||||
if producer := it.bi.Producer(); producer != "" && goversion.ProducerAfterOrEqual(producer, 1, 19) {
|
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 {
|
func resolveCallArgARM64(inst *arm64asm.Inst, instAddr uint64, currentGoroutine bool, regs *op.DwarfRegisters, mem MemoryReadWriter, bininfo *BinaryInfo) *Location {
|
||||||
switch inst.Op {
|
switch inst.Op {
|
||||||
case arm64asm.BL, arm64asm.BLR, arm64asm.B, arm64asm.BR:
|
case arm64asm.BL, arm64asm.BLR, arm64asm.B, arm64asm.BR:
|
||||||
//ok
|
// ok
|
||||||
default:
|
default:
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -396,7 +396,7 @@ func (t *thread) SetDX(uint64) error {
|
|||||||
return ErrChangeRegisterCore
|
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.
|
// change register values when debugging core files.
|
||||||
func (t *thread) SetReg(regNum uint64, reg *op.DwarfRegister) error {
|
func (t *thread) SetReg(regNum uint64, reg *op.DwarfRegister) error {
|
||||||
return ErrChangeRegisterCore
|
return ErrChangeRegisterCore
|
||||||
|
@ -64,7 +64,7 @@ type RecordingManipulation interface {
|
|||||||
// Recorded returns true if the current process is a recording and the path
|
// Recorded returns true if the current process is a recording and the path
|
||||||
// to the trace directory.
|
// to the trace directory.
|
||||||
Recorded() (recorded bool, tracedir string)
|
Recorded() (recorded bool, tracedir string)
|
||||||
// Direction changes execution direction.
|
// ChangeDirection changes execution direction.
|
||||||
ChangeDirection(Direction) error
|
ChangeDirection(Direction) error
|
||||||
// GetDirection returns the current direction of execution.
|
// GetDirection returns the current direction of execution.
|
||||||
GetDirection() Direction
|
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
|
// linux implementation of the native backend and the core backend to deal
|
||||||
// with structures used by the linux kernel.
|
// with structures used by the linux kernel.
|
||||||
package linutil
|
package linutil
|
||||||
|
@ -10,11 +10,11 @@ import (
|
|||||||
|
|
||||||
// ARM64Registers is a wrapper for sys.PtraceRegs.
|
// ARM64Registers is a wrapper for sys.PtraceRegs.
|
||||||
type ARM64Registers struct {
|
type ARM64Registers struct {
|
||||||
Regs *ARM64PtraceRegs //general-purpose registers
|
Regs *ARM64PtraceRegs // general-purpose registers
|
||||||
iscgo bool
|
iscgo bool
|
||||||
tpidr_el0 uint64
|
tpidr_el0 uint64
|
||||||
Fpregs []proc.Register //Formatted floating point registers
|
Fpregs []proc.Register // Formatted floating point registers
|
||||||
Fpregset []byte //holding all floating point register values
|
Fpregset []byte // holding all floating point register values
|
||||||
|
|
||||||
loadFpRegs func(*ARM64Registers) error
|
loadFpRegs func(*ARM64Registers) error
|
||||||
}
|
}
|
||||||
|
@ -1047,7 +1047,7 @@ func TestKill(t *testing.T) {
|
|||||||
}
|
}
|
||||||
if runtime.GOOS == "linux" {
|
if runtime.GOOS == "linux" {
|
||||||
if runtime.GOARCH == "arm64" {
|
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
|
return
|
||||||
}
|
}
|
||||||
_, err := os.Open(fmt.Sprintf("/proc/%d/", p.Pid()))
|
_, err := os.Open(fmt.Sprintf("/proc/%d/", p.Pid()))
|
||||||
@ -4693,7 +4693,7 @@ func TestPluginStepping(t *testing.T) {
|
|||||||
|
|
||||||
func TestIssue1601(t *testing.T) {
|
func TestIssue1601(t *testing.T) {
|
||||||
protest.MustHaveCgo(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) {
|
withTestProcess("issue1601", t, func(p *proc.Target, fixture protest.Fixture) {
|
||||||
assertNoError(p.Continue(), t, "Continue")
|
assertNoError(p.Continue(), t, "Continue")
|
||||||
evalVariable(p, t, "C.globalq")
|
evalVariable(p, t, "C.globalq")
|
||||||
|
@ -81,7 +81,7 @@ const (
|
|||||||
// the variable is the return value of a function call and allocated on a
|
// the variable is the return value of a function call and allocated on a
|
||||||
// frame that no longer exists)
|
// frame that no longer exists)
|
||||||
VariableFakeAddress
|
VariableFakeAddress
|
||||||
// VariableCPrt means the variable is a C pointer
|
// VariableCPtr means the variable is a C pointer
|
||||||
VariableCPtr
|
VariableCPtr
|
||||||
// VariableCPURegister means this variable is a CPU register.
|
// VariableCPURegister means this variable is a CPU register.
|
||||||
VariableCPURegister
|
VariableCPURegister
|
||||||
|
Loading…
Reference in New Issue
Block a user