Пример #1
0
func defcfasf(frame *FrameContext) {
	reg, _ := util.DecodeULEB128(frame.buf)
	offset, _ := util.DecodeSLEB128(frame.buf)

	frame.cfa.register = reg
	frame.cfa.offset = offset * frame.dataAlignment
}
Пример #2
0
func parseCIE(ctx *parseContext) parsefunc {
	data := ctx.buf.Next(int(ctx.length))
	buf := bytes.NewBuffer(data)
	// parse version
	ctx.common.Version = data[0]

	// parse augmentation
	ctx.common.Augmentation, _ = util.ParseString(buf)

	// parse code alignment factor
	ctx.common.CodeAlignmentFactor, _ = util.DecodeULEB128(buf)

	// parse data alignment factor
	ctx.common.DataAlignmentFactor, _ = util.DecodeSLEB128(buf)

	// parse return address register
	ctx.common.ReturnAddressRegister, _ = util.DecodeULEB128(buf)

	// parse initial instructions
	// The rest of this entry consists of the instructions
	// so we can just grab all of the data from the buffer
	// cursor to length.
	ctx.common.InitialInstructions = buf.Bytes() //ctx.buf.Next(int(ctx.length))
	ctx.length = 0

	return parselength
}
Пример #3
0
func valoffsetsf(frame *FrameContext) {
	var (
		reg, _    = util.DecodeULEB128(frame.buf)
		offset, _ = util.DecodeSLEB128(frame.buf)
	)

	frame.regs[reg] = DWRule{offset: offset * frame.dataAlignment, rule: rule_valoffset}
}
Пример #4
0
Файл: op.go Проект: no2key/delve
func consts(buf *bytes.Buffer, stack []int64, cfa int64) ([]int64, error) {
	num, _ := util.DecodeSLEB128(buf)
	return append(stack, num), nil
}
Пример #5
0
func defcfaoffsetsf(frame *FrameContext) {
	offset, _ := util.DecodeSLEB128(frame.buf)
	offset *= frame.dataAlignment
	frame.cfa.offset = offset
}
Пример #6
0
func advanceline(sm *StateMachine, buf *bytes.Buffer) {
	line, _ := util.DecodeSLEB128(buf)
	sm.line += int(line)
	sm.lastDelta = int(line)
}