IDA C++ SDK 9.2
Loading...
Searching...
No Matches
tryblks.hpp File Reference

Architecture independent exception handling info. More...

Go to the source code of this file.

Classes

struct  try_handler_t
struct  seh_t
struct  catch_t
class  tryblk_t

Typedefs

typedef qvector< catch_tcatchvec_t
typedef qvector< tryblk_ttryblks_t

Functions

 DECLARE_TYPE_AS_MOVABLE (try_handler_t)
 DECLARE_TYPE_AS_MOVABLE (seh_t)
 DECLARE_TYPE_AS_MOVABLE (catch_t)
 DECLARE_TYPE_AS_MOVABLE (tryblk_t)
idaman size_t ida_export get_tryblks (tryblks_t *tbv, const range_t &range)
idaman void ida_export del_tryblks (const range_t &range)
 Delete try block information in the specified range.
idaman int ida_export add_tryblk (const tryblk_t &tb)
 Add one try block information.
idaman ea_t ida_export find_syseh (ea_t ea)
 Find the start address of the system eh region including the argument.
idaman bool ida_export is_ea_tryblks (ea_t ea, uint32 flags)
 Check if the given address ea is part of tryblks description.

Detailed Description

Architecture independent exception handling info.

Try blocks have the following general properties:

  • A try block specifies a possibly fragmented guarded code region.
  • Each try block has always at least one catch/except block description
  • Each catch block contains its boundaries and a filter.
  • Additionally a catch block can hold sp adjustment and the offset to the exception object offset (C++).
  • Try blocks can be nested. Nesting is automatically calculated at the retrieval time.
  • There may be (nested) multiple try blocks starting at the same address.

See examples in tests/input/src/eh_tests.

Typedef Documentation

◆ catchvec_t

◆ tryblks_t

Function Documentation

◆ DECLARE_TYPE_AS_MOVABLE() [1/4]

DECLARE_TYPE_AS_MOVABLE ( try_handler_t )

◆ DECLARE_TYPE_AS_MOVABLE() [2/4]

DECLARE_TYPE_AS_MOVABLE ( seh_t )

◆ DECLARE_TYPE_AS_MOVABLE() [3/4]

DECLARE_TYPE_AS_MOVABLE ( catch_t )

◆ DECLARE_TYPE_AS_MOVABLE() [4/4]

DECLARE_TYPE_AS_MOVABLE ( tryblk_t )

◆ get_tryblks()

idaman size_t ida_export get_tryblks ( tryblks_t * tbv,
const range_t & range )

Retrieve try block information from the specified address range. Try blocks are sorted by starting address and their nest levels calculated.

Parameters
tbvoutput buffer; may be nullptr
rangeaddress range to change
Returns
number of found try blocks

◆ del_tryblks()

idaman void ida_export del_tryblks ( const range_t & range)

Delete try block information in the specified range.

Parameters
rangethe range to be cleared

◆ add_tryblk()

idaman int ida_export add_tryblk ( const tryblk_t & tb)

Add one try block information.

Parameters
tbtry block to add.
Returns
error code; 0 means good

◆ find_syseh()

idaman ea_t ida_export find_syseh ( ea_t ea)

Find the start address of the system eh region including the argument.

Parameters
easearch address
Returns
start address of surrounding tryblk, otherwise BADADDR

◆ is_ea_tryblks()

idaman bool ida_export is_ea_tryblks ( ea_t ea,
uint32 flags )

Check if the given address ea is part of tryblks description.

Parameters
eaaddress to check
flagscombination of flags for is_ea_tryblks()