@@ -4,7 +4,7 @@ export ObjectHandle, SectionRef, SymbolRef, debugsections
4
4
5
5
export printfield, printentry, printfield_with_color, deref,
6
6
sectionaddress, sectionoffset, sectionsize, sectionname,
7
- load_strtab
7
+ load_strtab, readmeta
8
8
9
9
import Base: read, seek, readbytes, position, show
10
10
@@ -148,70 +148,6 @@ function readbytes{T<:ObjectHandle,S}(oh::T,sec::Section{S})
148
148
end
149
149
readbytes (sec:: SectionRef ) = readbytes (handle (sec),deref (sec))
150
150
151
- # # # DWARF support
152
- #
153
- # Whether or not this is the right place to put this is up for debate, but
154
- # this way, DWARF does not need to be concerned with the specific notion of
155
- # being embedded in an object file.
156
- #
157
- # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
158
-
159
- using DWARF
160
-
161
- function read {T<:ObjectHandle,S} (oh:: T ,sec:: Section{S} ,:: Type{DWARF.ARTable} )
162
- @assert T <: S
163
- seek (oh, sec)
164
- ret = DWARF. ARTable (Array (DWARF. ARTableSet,0 ))
165
- while position (oh) < sectionoffset (sec) + sectionsize (sec)
166
- push! (ret. sets, read (oh, DWARF. ARTableSet, endianness (oh)))
167
- end
168
- ret
169
- end
170
-
171
- function read {T<:ObjectHandle,S} (oh:: T ,sec:: Section{S} ,:: Type{DWARF.PUBTable} )
172
- @assert T <: S
173
- seek (oh, sec)
174
- ret = DWARF. PUBTable (Array (DWARF. PUBTableSet,0 ))
175
- while position (oh) < sectionoffset (sec) + sectionsize (sec)
176
- push! (ret. sets,read (oh,DWARF. PUBTableSet, endianness (oh)))
177
- end
178
- ret
179
- end
180
-
181
- function read {T<:ObjectHandle,S} (oh:: T , sec:: Section{S} ,
182
- :: Type{DWARF.AbbrevTableSet} )
183
- @assert T <: S
184
- seek (oh, sec)
185
- read (oh, AbbrevTableSet, endianness (oh))
186
- end
187
-
188
- function read {T<:ObjectHandle,S} (oh:: T ,debug_info:: Section{S} ,
189
- s:: DWARF.PUBTableSet ,:: Type{DWARF.DWARFCUHeader} )
190
- @assert T <: S
191
- seek (oh,sectionoffset (debug_info)+ s. header. debug_info_offset)
192
- read (oh,DWARF. DWARFCUHeader, endianness (oh))
193
- end
194
-
195
- function read {T<:ObjectHandle,S} (oh:: T , debug_info:: Section{S} , s:: DWARF.DWARFCUHeader ,
196
- :: Type{DWARF.AbbrevTableSet} )
197
- @assert T <: S
198
- seek (oh,sectionoffset (debug_info)+ s. debug_abbrev_offset)
199
- read (oh,DWARF. AbbrevTableSet, endianness (oh))
200
- end
201
-
202
- function read {T<:ObjectHandle,S} (oh:: T ,
203
- debug_info:: Section{S} , debug_abbrev:: Section{S} ,
204
- s:: DWARF.PUBTableSet , e:: DWARF.PUBTableEntry ,
205
- header:: DWARF.DWARFCUHeader , :: Type{DWARF.DIETree} )
206
-
207
- @assert T <: S
208
- ats = read (oh,debug_abbrev,header,DWARF. AbbrevTableSet)
209
- seek (oh,sectionoffset (debug_info)+ s. header. debug_info_offset+ e. offset)
210
- ret = DWARF. DIETree (Array (DWARF. DIETreeNode,0 ))
211
- read (oh,header,ats,ret,DWARF. DIETreeNode,:LittleEndian )
212
- ret
213
- end
214
-
215
151
typealias Maybe{T} Union (T,Nothing)
216
152
217
153
# # # Higher level debug info support
0 commit comments