mirror of
https://github.com/go-delve/delve.git
synced 2025-11-02 04:36:29 +08:00
Implement initial next implementation
This current implementation does not cover the following:
* Setting correct breakpoint when exiting loop
* Setting correct breakpoint when returning from function
* All facilities are available for this, it just is not taken into
account in the current `next` implementation.
This commit is contained in:
40
dwarf/frame/frame_parser_test.go
Normal file
40
dwarf/frame/frame_parser_test.go
Normal file
@ -0,0 +1,40 @@
|
||||
package frame_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/derekparker/dbg/dwarf/frame"
|
||||
)
|
||||
|
||||
func TestParse(t *testing.T) {
|
||||
var (
|
||||
data = grabDebugFrameSection("../../_fixtures/testprog", t)
|
||||
fe = frame.Parse(data)[0]
|
||||
ce = fe.CIE
|
||||
)
|
||||
|
||||
if ce.Length != 16 {
|
||||
t.Error("Length was not parsed correctly, got ", ce.Length)
|
||||
}
|
||||
|
||||
if ce.Version != 0x3 {
|
||||
t.Fatalf("Version was not parsed correctly expected %#v got %#v", 0x3, ce.Version)
|
||||
}
|
||||
|
||||
if ce.Augmentation != "" {
|
||||
t.Fatal("Augmentation was not parsed correctly")
|
||||
}
|
||||
|
||||
if ce.CodeAlignmentFactor != 0x1 {
|
||||
t.Fatal("Code Alignment Factor was not parsed correctly")
|
||||
}
|
||||
|
||||
if ce.DataAlignmentFactor != -4 {
|
||||
t.Fatalf("Data Alignment Factor was not parsed correctly got %#v", ce.DataAlignmentFactor)
|
||||
}
|
||||
|
||||
if fe.Length != 32 {
|
||||
t.Fatal("Length was not parsed correctly, got ", fe.Length)
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user