Skip to content

Commit cd897fc

Browse files
committed
Update framehop, object, gimli and addr2line.
1 parent 4256aaa commit cd897fc

13 files changed

+94
-86
lines changed

Cargo.lock

+48-11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samply-symbols/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,18 @@ partial_read_stats = ["bytesize", "bitvec"]
1717
[dependencies.addr2line]
1818
default-features = false
1919
features = ["std", "fallible-iterator"]
20-
version = "0.21.0"
20+
version = "0.22"
2121
# path = "../../addr2line"
2222

2323
[dependencies.gimli]
2424
default-features = false
2525
features = ["read"]
26-
version = "0.28.1"
26+
version = "0.29"
2727

2828
[dependencies.object]
2929
default-features = false
3030
features = ["std", "read_core", "archive", "elf", "macho", "pe", "unaligned", "compression"]
31-
version = "0.34"
31+
version = "0.35"
3232

3333
[dependencies]
3434
#pdb-addr2line = { path = "../../pdb-addr2line" }

samply-symbols/src/debugid_util.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,7 @@ impl DebugIdExt for DebugId {
6666
/// Tries to obtain a DebugId for an object. This uses the build ID, if available,
6767
/// and falls back to hashing the first page of the text section otherwise.
6868
/// Returns None on failure.
69-
pub fn debug_id_for_object<'data: 'file, 'file>(
70-
obj: &'file impl Object<'data, 'file>,
71-
) -> Option<DebugId> {
69+
pub fn debug_id_for_object<'data>(obj: &impl Object<'data>) -> Option<DebugId> {
7270
// Windows
7371
if let Ok(Some(pdb_info)) = obj.pdb_info() {
7472
return Some(DebugId::from_guid_age(&pdb_info.guid(), pdb_info.age()).unwrap());
@@ -102,9 +100,7 @@ pub fn debug_id_for_object<'data: 'file, 'file>(
102100
/// Tries to obtain a CodeId for an object.
103101
///
104102
/// This currently only handles mach-O and ELF.
105-
pub fn code_id_for_object<'data: 'file, 'file>(
106-
obj: &'file impl Object<'data, 'file>,
107-
) -> Option<CodeId> {
103+
pub fn code_id_for_object<'data>(obj: &impl Object<'data>) -> Option<CodeId> {
108104
// ELF
109105
if let Ok(Some(build_id)) = obj.build_id() {
110106
return Some(CodeId::ElfBuildId(ElfBuildId::from_bytes(build_id)));

samply-symbols/src/dwarf.rs

+17-26
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,14 @@ pub enum SingleSectionData<'data, T: ReadRef<'data>> {
7474
Owned(Vec<u8>),
7575
}
7676

77-
pub fn try_get_section_data<'data, 'file, O, T>(
77+
pub fn try_get_section_data<'data, O, T>(
7878
data: T,
79-
file: &'file O,
79+
file: &O,
8080
section_id: SectionId,
8181
is_for_dwo_dwp: bool,
8282
) -> Option<SingleSectionData<'data, T>>
8383
where
84-
'data: 'file,
85-
O: object::Object<'data, 'file>,
84+
O: object::Object<'data>,
8685
T: ReadRef<'data>,
8786
{
8887
use object::ObjectSection;
@@ -175,19 +174,17 @@ impl Addr2lineContextData {
175174
}
176175
}
177176

178-
fn sect<'data, 'ctxdata, 'file, O, R>(
177+
fn sect<'data, 'ctxdata, O, R>(
179178
&'ctxdata self,
180179
data: R,
181-
obj: &'file O,
180+
obj: &O,
182181
section_id: SectionId,
183182
endian: RunTimeEndian,
184183
is_for_dwo_dwp: bool,
185184
) -> EndianSlice<'ctxdata, RunTimeEndian>
186185
where
187-
'data: 'file,
188186
'data: 'ctxdata,
189-
'ctxdata: 'file,
190-
O: object::Object<'data, 'file>,
187+
O: object::Object<'data>,
191188
R: ReadRef<'data>,
192189
{
193190
let slice: &[u8] = match try_get_section_data(data, obj, section_id, is_for_dwo_dwp) {
@@ -202,18 +199,16 @@ impl Addr2lineContextData {
202199
EndianSlice::new(slice, endian)
203200
}
204201

205-
pub fn make_context<'data, 'ctxdata, 'file, O, R>(
202+
pub fn make_context<'data, 'ctxdata, O, R>(
206203
&'ctxdata self,
207204
data: R,
208-
obj: &'file O,
205+
obj: &O,
209206
sup_data: Option<R>,
210-
sup_obj: Option<&'file O>,
207+
sup_obj: Option<&O>,
211208
) -> Result<addr2line::Context<EndianSlice<'ctxdata, RunTimeEndian>>, Error>
212209
where
213-
'data: 'file,
214210
'data: 'ctxdata,
215-
'ctxdata: 'file,
216-
O: object::Object<'data, 'file>,
211+
O: object::Object<'data>,
217212
R: ReadRef<'data>,
218213
{
219214
let e = if obj.is_little_endian() {
@@ -233,18 +228,16 @@ impl Addr2lineContextData {
233228
Ok(context)
234229
}
235230

236-
pub fn make_package<'data, 'ctxdata, 'file, O, R>(
231+
pub fn make_package<'data, 'ctxdata, O, R>(
237232
&'ctxdata self,
238233
data: R,
239-
obj: &'file O,
234+
obj: &O,
240235
dwp_data: Option<R>,
241-
dwp_obj: Option<&'file O>,
236+
dwp_obj: Option<&O>,
242237
) -> Result<Option<DwarfPackage<EndianSlice<'ctxdata, RunTimeEndian>>>, Error>
243238
where
244-
'data: 'file,
245239
'data: 'ctxdata,
246-
'ctxdata: 'file,
247-
O: object::Object<'data, 'file>,
240+
O: object::Object<'data>,
248241
R: ReadRef<'data>,
249242
{
250243
let e = if obj.is_little_endian() {
@@ -270,16 +263,14 @@ impl Addr2lineContextData {
270263
Ok(package)
271264
}
272265

273-
pub fn make_dwarf_for_dwo<'data, 'ctxdata, 'file, O, R>(
266+
pub fn make_dwarf_for_dwo<'data, 'ctxdata, O, R>(
274267
&'ctxdata self,
275268
data: R,
276-
obj: &'file O,
269+
obj: &O,
277270
) -> Result<addr2line::gimli::Dwarf<EndianSlice<'ctxdata, RunTimeEndian>>, Error>
278271
where
279-
'data: 'file,
280272
'data: 'ctxdata,
281-
'ctxdata: 'file,
282-
O: object::Object<'data, 'file>,
273+
O: object::Object<'data>,
283274
R: ReadRef<'data>,
284275
{
285276
let e = if obj.is_little_endian() {

samply-symbols/src/elf.rs

+3-7
Original file line numberDiff line numberDiff line change
@@ -482,13 +482,9 @@ impl<T: FileContents + 'static> ObjectSymbolMapOuter<T> for ElfSymbolMapDataAndO
482482
}
483483
}
484484

485-
fn compute_function_addresses_elf<'data, 'file, O>(
486-
object_file: &'file O,
487-
) -> (Option<Vec<u32>>, Option<Vec<u32>>)
488-
where
489-
'data: 'file,
490-
O: object::Object<'data, 'file>,
491-
{
485+
fn compute_function_addresses_elf<'data, O: object::Object<'data>>(
486+
object_file: &O,
487+
) -> (Option<Vec<u32>>, Option<Vec<u32>>) {
492488
// Get an approximation of the list of function start addresses by
493489
// iterating over the exception handling info. Every FDE roughly
494490
// maps to one function.

samply-symbols/src/macho.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -535,13 +535,12 @@ where
535535
Ok(image)
536536
}
537537

538-
fn compute_function_addresses_macho<'data, 'file, O, R>(
539-
macho_data: &'file MachOData<'data, R>,
540-
object_file: &'file O,
538+
fn compute_function_addresses_macho<'data, O, R>(
539+
macho_data: &MachOData<'data, R>,
540+
object_file: &O,
541541
) -> (Option<Vec<u32>>, Option<Vec<u32>>)
542542
where
543-
'data: 'file,
544-
O: object::Object<'data, 'file>,
543+
O: object::Object<'data>,
545544
R: ReadRef<'data>,
546545
{
547546
// Get function start addresses from LC_FUNCTION_STARTS

samply-symbols/src/shared.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -575,9 +575,7 @@ impl SourceFilePath {
575575
/// 0xffffffff81000000. Moreover, the base address seems to coincide with the
576576
/// vmaddr of the .text section, which is readily-available in perf.data files
577577
/// (in a synthetic mapping called "[kernel.kallsyms]_text").
578-
pub fn relative_address_base<'data: 'file, 'file>(
579-
object_file: &'file impl object::Object<'data, 'file>,
580-
) -> u64 {
578+
pub fn relative_address_base<'data>(object_file: &impl object::Object<'data>) -> u64 {
581579
use object::read::ObjectSegment;
582580
if let Some(text_segment) = object_file
583581
.segments()

samply-symbols/src/symbol_map_object.rs

+5-6
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ impl<'a, Symbol: object::ObjectSymbol<'a> + 'a> SymbolList<'a, Symbol> {
8989
) -> Self
9090
where
9191
'a: 'file,
92-
O: object::Object<'a, 'file, Symbol = Symbol>,
92+
O: object::Object<'a, Symbol<'file> = Symbol>,
9393
{
9494
let mut entries: Vec<_> = Vec::new();
9595

@@ -308,9 +308,7 @@ impl SvmaFileRange {
308308
struct SvmaFileRanges(Vec<SvmaFileRange>);
309309

310310
impl SvmaFileRanges {
311-
pub fn from_object<'data: 'file, 'file, O: object::Object<'data, 'file>>(
312-
object_file: &'file O,
313-
) -> Self {
311+
pub fn from_object<'data, O: object::Object<'data>>(object_file: &O) -> Self {
314312
let mut svma_file_ranges: Vec<SvmaFileRange> = object_file
315313
.segments()
316314
.map(SvmaFileRange::from_segment)
@@ -647,7 +645,7 @@ pub struct ObjectSymbolMapInnerWrapper<'data, FC>(
647645
);
648646

649647
impl<'a, FC: FileContents + 'static> ObjectSymbolMapInnerWrapper<'a, FC> {
650-
pub fn new<'file, O, Symbol, DDM: DwoDwarfMaker<FC> + Sync>(
648+
pub fn new<'file, O, Symbol, DDM>(
651649
object_file: &'file O,
652650
addr2line_context: Option<addr2line::Context<EndianSlice<'a, RunTimeEndian>>>,
653651
dwp_package: Option<addr2line::gimli::DwarfPackage<EndianSlice<'a, RunTimeEndian>>>,
@@ -658,8 +656,9 @@ impl<'a, FC: FileContents + 'static> ObjectSymbolMapInnerWrapper<'a, FC> {
658656
) -> Self
659657
where
660658
'a: 'file,
661-
O: object::Object<'a, 'file, Symbol = Symbol>,
659+
O: object::Object<'a, Symbol<'file> = Symbol>,
662660
Symbol: object::ObjectSymbol<'a> + Send + Sync + 'a,
661+
DDM: DwoDwarfMaker<FC> + Sync,
663662
{
664663
let base_address = relative_address_base(object_file);
665664
let list = SymbolList::new(

samply-symbols/src/windows.rs

+3-7
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,9 @@ impl<T: FileContents + 'static> ObjectSymbolMapOuter<T> for PeSymbolMapDataAndOb
141141
}
142142
}
143143

144-
fn compute_function_addresses_pe<'data, 'file, O>(
145-
object_file: &'file O,
146-
) -> (Option<Vec<u32>>, Option<Vec<u32>>)
147-
where
148-
'data: 'file,
149-
O: object::Object<'data, 'file>,
150-
{
144+
fn compute_function_addresses_pe<'data, O: object::Object<'data>>(
145+
object_file: &O,
146+
) -> (Option<Vec<u32>>, Option<Vec<u32>>) {
151147
// Get function start and end addresses from the function list in .pdata.
152148
use object::ObjectSection;
153149
if let Some(pdata) = object_file

0 commit comments

Comments
 (0)