Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libehp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Open Source Software
libehp
Commits
ff803c45
Commit
ff803c45
authored
6 years ago
by
Jason Hiser
Browse files
Options
Downloads
Patches
Plain Diff
new featuers to support IRDB ir-building
parent
59da9c4c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/ehp.hpp
+7
-1
7 additions, 1 deletion
include/ehp.hpp
src/ehp.cpp
+22
-1
22 additions, 1 deletion
src/ehp.cpp
src/ehp_priv.hpp
+9
-4
9 additions, 4 deletions
src/ehp_priv.hpp
with
38 additions
and
6 deletions
include/ehp.hpp
+
7
−
1
View file @
ff803c45
...
...
@@ -26,6 +26,8 @@ class EHProgramInstruction_t
virtual
bool
isRestoreState
()
const
=
0
;
virtual
bool
isRememberState
()
const
=
0
;
virtual
const
EHProgramInstructionByteVector_t
&
getBytes
()
const
=
0
;
virtual
bool
advance
(
uint64_t
&
cur_addr
,
uint64_t
CAF
)
const
=
0
;
};
using
EHProgramInstructionVector_t
=
vector
<
shared_ptr
<
EHProgramInstruction_t
>
>
;
...
...
@@ -98,7 +100,9 @@ class LSDACallSite_t
virtual
void
print
()
const
=
0
;
};
using
CallSiteVector_t
=
vector
<
shared_ptr
<
LSDACallSite_t
>
>
;
using
CallSiteVector_t
=
vector
<
shared_ptr
<
LSDACallSite_t
>
>
;
using
TypeTableVector_t
=
vector
<
shared_ptr
<
LSDATypeTableEntry_t
>
>
;
class
LSDA_t
{
protected:
...
...
@@ -109,6 +113,7 @@ class LSDA_t
virtual
uint8_t
getTTEncoding
()
const
=
0
;
virtual
void
print
()
const
=
0
;
virtual
shared_ptr
<
CallSiteVector_t
>
getCallSites
()
const
=
0
;
virtual
shared_ptr
<
TypeTableVector_t
>
getTypeTable
()
const
=
0
;
};
class
FDEContents_t
...
...
@@ -123,6 +128,7 @@ class FDEContents_t
virtual
const
CIEContents_t
&
getCIE
()
const
=
0
;
virtual
const
EHProgram_t
&
getProgram
()
const
=
0
;
virtual
shared_ptr
<
LSDA_t
>
getLSDA
()
const
=
0
;
virtual
uint64_t
getLSDAAddress
()
const
=
0
;
virtual
void
print
()
const
=
0
;
// move to ostream? toString?
};
...
...
This diff is collapsed.
Click to expand it.
src/ehp.cpp
+
22
−
1
View file @
ff803c45
...
...
@@ -732,7 +732,7 @@ bool eh_program_insn_t<ptrsize>::isRememberState() const
}
template
<
int
ptrsize
>
bool
eh_program_insn_t
<
ptrsize
>::
A
dvance
(
uint64_t
&
cur_addr
,
uint64_t
CAF
)
const
bool
eh_program_insn_t
<
ptrsize
>::
a
dvance
(
uint64_t
&
cur_addr
,
uint64_t
CAF
)
const
{
// make sure uint8_t is an unsigned char.
static_assert
(
std
::
is_same
<
unsigned
char
,
uint8_t
>::
value
,
"uint8_t is not unsigned char"
);
...
...
@@ -1617,6 +1617,27 @@ void split_eh_frame_impl_t<ptrsize>::print() const
}
template
<
int
ptrsize
>
shared_ptr
<
EHProgramInstructionVector_t
>
eh_program_t
<
ptrsize
>::
getInstructions
()
const
{
auto
ret
=
shared_ptr
<
EHProgramInstructionVector_t
>
(
new
EHProgramInstructionVector_t
());
transform
(
ALLOF
(
getInstructionsInternal
()),
back_inserter
(
*
ret
),
[](
const
eh_program_insn_t
<
ptrsize
>
&
a
)
{
return
shared_ptr
<
EHProgramInstruction_t
>
(
new
eh_program_insn_t
<
ptrsize
>
(
a
));});
return
shared_ptr
<
EHProgramInstructionVector_t
>
(
ret
);
}
template
<
int
ptrsize
>
shared_ptr
<
TypeTableVector_t
>
lsda_t
<
ptrsize
>::
getTypeTable
()
const
{
auto
ret
=
shared_ptr
<
TypeTableVector_t
>
(
new
TypeTableVector_t
());
transform
(
ALLOF
(
type_table
),
back_inserter
(
*
ret
),
[](
const
lsda_type_table_entry_t
<
ptrsize
>
&
a
)
{
return
shared_ptr
<
LSDATypeTableEntry_t
>
(
new
lsda_type_table_entry_t
<
ptrsize
>
(
a
));});
return
shared_ptr
<
TypeTableVector_t
>
(
ret
);
}
template
<
int
ptrsize
>
shared_ptr
<
CallSiteVector_t
>
lsda_t
<
ptrsize
>::
getCallSites
()
const
{
...
...
This diff is collapsed.
Click to expand it.
src/ehp_priv.hpp
+
9
−
4
View file @
ff803c45
...
...
@@ -97,7 +97,7 @@ class eh_program_insn_t : public EHProgramInstruction_t
bool
isRestoreState
()
const
;
bool
isRememberState
()
const
;
bool
A
dvance
(
uint64_t
&
cur_addr
,
uint64_t
CAF
)
const
;
bool
a
dvance
(
uint64_t
&
cur_addr
,
uint64_t
CAF
)
const
;
const
std
::
vector
<
uint8_t
>&
getBytes
()
const
;
std
::
vector
<
uint8_t
>&
getBytes
()
;
...
...
@@ -122,7 +122,7 @@ class eh_program_t : public EHProgram_t
const
uint32_t
&
program_start_position
,
const
uint8_t
*
const
data
,
const
uint32_t
&
max_program_pos
);
virtual
shared_ptr
<
EHProgramInstructionVector_t
>
getInstructions
()
const
{
assert
(
0
);
}
virtual
shared_ptr
<
EHProgramInstructionVector_t
>
getInstructions
()
const
;
std
::
vector
<
eh_program_insn_t
<
ptrsize
>
>&
getInstructionsInternal
()
;
const
std
::
vector
<
eh_program_insn_t
<
ptrsize
>
>&
getInstructionsInternal
()
const
;
...
...
@@ -266,6 +266,7 @@ class lsda_call_site_t : public LSDACallSite_t, private eh_frame_util_t<ptrsize>
// short hand for a vector of call sites
template
<
int
ptrsize
>
using
call_site_table_t
=
std
::
vector
<
lsda_call_site_t
<
ptrsize
>
>
;
template
<
int
ptrsize
>
using
lsda_type_table_t
=
std
::
vector
<
lsda_type_table_entry_t
<
ptrsize
>
>
;
template
<
int
ptrsize
>
class
lsda_t
:
public
LSDA_t
,
private
eh_frame_util_t
<
ptrsize
>
...
...
@@ -282,8 +283,8 @@ class lsda_t : public LSDA_t, private eh_frame_util_t<ptrsize>
uint64_t
cs_table_length
;
uint64_t
cs_table_end_addr
;
uint64_t
action_table_start_addr
;
call_site_table_t
<
ptrsize
>
call_site_table
;
std
::
vector
<
lsda_type_table_
entry_t
<
ptrsize
>
>
type_table
;
call_site_table_t
<
ptrsize
>
call_site_table
;
lsda_type_table_
t
<
ptrsize
>
type_table
;
public:
...
...
@@ -300,6 +301,8 @@ class lsda_t : public LSDA_t, private eh_frame_util_t<ptrsize>
shared_ptr
<
CallSiteVector_t
>
getCallSites
()
const
;
const
call_site_table_t
<
ptrsize
>
getCallSitesInternal
()
const
{
return
call_site_table
;}
shared_ptr
<
TypeTableVector_t
>
getTypeTable
()
const
;
};
...
...
@@ -346,6 +349,8 @@ class fde_contents_t : public FDEContents_t, eh_frame_util_t<ptrsize>
shared_ptr
<
LSDA_t
>
getLSDA
()
const
{
return
shared_ptr
<
LSDA_t
>
(
new
lsda_t
<
ptrsize
>
(
lsda
))
;
}
const
lsda_t
<
ptrsize
>&
getLSDAInternal
()
const
{
return
lsda
;
}
uint64_t
getLSDAAddress
()
const
{
return
lsda_addr
;
}
bool
parse_fde
(
const
uint32_t
&
fde_position
,
const
uint32_t
&
cie_position
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment