提交 464a6b96 编写于 作者: D Derek Parker

Fix FDE lookup at function entry

Also, rearrange and cleanup file a bit.

Fixes #72
上级 d4d8f1ce
......@@ -18,15 +18,6 @@ type CommonInformationEntry struct {
InitialInstructions []byte
}
// Returns whether or not the given address is within the
// bounds of this frame.
func (fde *FrameDescriptionEntry) Cover(addr uint64) bool {
if (addr - fde.begin) < fde.end {
return true
}
return false
}
// Represents a Frame Descriptor Entry in the
// Dwarf .debug_frame section.
type FrameDescriptionEntry struct {
......@@ -36,6 +27,15 @@ type FrameDescriptionEntry struct {
begin, end uint64
}
// Returns whether or not the given address is within the
// bounds of this frame.
func (fde *FrameDescriptionEntry) Cover(addr uint64) bool {
if (addr - fde.begin) < fde.end {
return true
}
return false
}
// Address of first location for this frame.
func (fde *FrameDescriptionEntry) Begin() uint64 {
return fde.begin
......@@ -81,10 +81,6 @@ func (fdes FrameDescriptionEntries) FDEForPC(pc uint64) (*FrameDescriptionEntry,
return fdes[idx], nil
}
func (frame *FrameDescriptionEntry) Less(pc uint64) bool {
return frame.Begin() > pc
}
func (frame *FrameDescriptionEntry) More(pc uint64) bool {
return frame.End() < pc
return frame.End() <= pc
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册