Skip to content

Commit 374b737

Browse files
committed
Factor out a couple more things
1 parent 8f6862c commit 374b737

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

src/ObjFileBase.jl

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ export ObjectHandle, SectionRef, SymbolRef, debugsections
55

66
export printfield, printentry, printfield_with_color, deref,
77
sectionaddress, sectionoffset, sectionsize, sectionname,
8-
load_strtab, readmeta, StrTab, symname, Sections, symbolvalue
8+
load_strtab, readmeta, StrTab, symname, Sections, symbolvalue,
9+
isundef
910

1011
import Base: read, seek, readbytes, position, show, showcompact
1112

@@ -123,12 +124,6 @@ deref(section::Section) = section
123124
abstract SymbolRef{T<:ObjectHandle}
124125
abstract SymtabEntry{T<:ObjectHandle}
125126

126-
function symname
127-
end
128-
function symbolvalue
129-
end
130-
131-
symbolnum(x::SymbolRef) = symbolnum(deref(x))
132127

133128
"""
134129
The size of the actual data contained in the section. This should exclude any
@@ -157,6 +152,15 @@ function load_strtab
157152
end
158153
@mustimplement strtab_lookup(s::StrTab, offset)
159154

155+
# Symbol properties
156+
function symname
157+
end
158+
function symbolvalue
159+
end
160+
161+
symbolnum(x::SymbolRef) = symbolnum(deref(x))
162+
isundef(x::SymbolRef) = isundef(deref(x))
163+
160164
################################# Utilities ####################################
161165

162166
typealias SectionOrRef{T} Union{Section{T},SectionRef{T}}
@@ -192,8 +196,8 @@ immutable DebugSections{T<:ObjectHandle, Sect}
192196
debug_ranges::Maybe{Sect}
193197
debug_str::Maybe{Sect}
194198
debug_types::Maybe{Sect}
195-
196199
end
200+
handle(dbgs::DebugSections) = dbgs.oh
197201

198202
function DebugSections{T}(oh::T; debug_abbrev = nothing, debug_aranges = nothing,
199203
debug_frame = nothing, debug_info = nothing, debug_line = nothing,

0 commit comments

Comments
 (0)