File tree Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -168,7 +168,9 @@ namespace detail {
168
168
const auto & sections = sections_res.unwrap_value ();
169
169
for (const auto & section : sections) {
170
170
if (string_view (strtab.data () + section.sh_name ) == " .text" ) {
171
- vec.push_back (pc_range{section.sh_addr , section.sh_addr + section.sh_size });
171
+ vec.push_back (
172
+ pc_range{to<frame_ptr>(section.sh_addr ), to<frame_ptr>(section.sh_addr + section.sh_size )}
173
+ );
172
174
}
173
175
}
174
176
return vec;
@@ -330,7 +332,10 @@ namespace detail {
330
332
return internal_error (" requested strtab section not a strtab (requested {} of {})" , index, file->path ());
331
333
}
332
334
entry.data .resize (section.sh_size + 1 );
333
- auto read_res = file->read_bytes (span<char >{entry.data .data (), section.sh_size }, section.sh_offset );
335
+ auto read_res = file->read_bytes (
336
+ span<char >{entry.data .data (), to<std::size_t >(section.sh_size )},
337
+ section.sh_offset
338
+ );
334
339
if (!read_res) {
335
340
return read_res.unwrap_error ();
336
341
}
Original file line number Diff line number Diff line change 15
15
16
16
CPPTRACE_BEGIN_NAMESPACE
17
17
namespace detail {
18
- using Elf_Addr = std::uintptr_t ;
19
- using Elf_Off = std::uintptr_t ;
20
- using Elf_Xword = std::size_t ;
21
-
22
18
// TODO: make methods const and a bunch of members mutable
23
19
class elf {
24
20
std::unique_ptr<base_file> file;
@@ -40,10 +36,10 @@ namespace detail {
40
36
struct section_info {
41
37
uint32_t sh_name;
42
38
uint32_t sh_type;
43
- Elf_Addr sh_addr;
44
- Elf_Off sh_offset;
45
- Elf_Xword sh_size;
46
- Elf_Xword sh_entsize;
39
+ uint64_t sh_addr;
40
+ uint64_t sh_offset;
41
+ uint64_t sh_size;
42
+ uint64_t sh_entsize;
47
43
uint32_t sh_link;
48
44
};
49
45
bool tried_to_load_sections = false ;
You can’t perform that action at this time.
0 commit comments