| IDA SDK

Public Member Functions | List of all members
source_item_t Class Referenceabstract
Debugger functions » Source information providers

## Detailed Description

Describes a subdivision of source information.

Inherits qrefcnt_obj_t.

## Public Member Functions
virtual void idaapi | release () override=0
| Call this function to free source_item_t. More...
virtual source_file_iterator idaapi | get_source_files ()=0
| Get source files of the item.
virtual bool idaapi | get_name (qstring *buf) const =0
| Get name of the item.
virtual int idaapi | get_lnnum () const =0
| Get line number of the item (1-based)
virtual int idaapi | get_end_lnnum () const =0
| Get ending line number (1-based.) The returned line number is the next line after the expression.
virtual int idaapi | get_colnum () const =0
| Get column number of the item. More...
virtual int idaapi | get_end_colnum () const =0
| Get ending column number. More...
virtual ea_t idaapi | get_ea () const =0
| Get starting address of the item.
virtual asize_t idaapi | get_size () const =0
| Get size of the item in bytes. More...
virtual bool idaapi | get_item_bounds (rangeset_t *set) const =0
| Get item boundaries as a set of ranges. More...
virtual source_item_ptr idaapi | get_parent (src_item_kind_t max_kind) const =0
| Get parent of the item. More...
virtual source_item_iterator idaapi | create_children_iterator ()=0
| Create an iterator to enumerate all children of the item.
virtual bool idaapi | get_hint (qstring *hint, const eval_ctx_t *ctx, int *nlines) const =0
| Calculate a string to display as a hint. More...
virtual bool idaapi | evaluate (const eval_ctx_t *ctx, idc_value_t *res, qstring *errbuf) const =0
| Evaluate item value (meaningful only for expression items). More...
virtual bool idaapi | equals (const source_item_t *other) const =0
| Do these two items have the same source?. More...
Getters (for modification)
The following functions can be used to extract the item information in order to modify it. For example, if the user wants to modify a variable we will find what exactly needs to be modified.
virtual src_item_kind_t idaapi | get_item_kind (const eval_ctx_t *) const newapi
| Get item kind.
bool | is_stmt (const eval_ctx_t *ctx) const
| Does this source item represent a statement?
bool | is_module (const eval_ctx_t *ctx) const
| Does this source item represent a module?
bool | is_func (const eval_ctx_t *ctx) const
| Does this source item represent a function?
bool | is_expr (const eval_ctx_t *ctx) const
| Does this source item represent an expression?
bool | is_locvar (const eval_ctx_t *ctx) const
| Does this source item represent a stack, register, or register-relative local variable or parameter?
bool | is_sttvar (const eval_ctx_t *ctx) const
| Does this source item represent a static variable or code?
virtual srcinfo_provider_t *idaapi | get_provider (void) const =0
| Get source info provider. More...
virtual bool idaapi | get_location (argloc_t *, const eval_ctx_t *) const newapi
| Get the location for this source item.
virtual bool idaapi | get_expr_tinfo (tinfo_t *tif) const =0
| Get expression type.
Public Member Functions inherited from qrefcnt_obj_t
| qrefcnt_obj_t (void)
| Constructor.
virtual void idaapi | release (void)=0
| Call destructor. More...

## Additional Inherited Members
Public Attributes inherited from qrefcnt_obj_t
int | refcnt
| counter

## Member Function Documentation

## ◆ release()

virtual void idaapi source_item_t::release | ( |  | ) |
| override pure virtual

Call this function to free source_item_t.

Implements qrefcnt_obj_t.

## ◆ get_colnum()

virtual int idaapi source_item_t::get_colnum | ( |  | ) | const
| pure virtual

Get column number of the item.

If unknown, return -1

## ◆ get_end_colnum()

virtual int idaapi source_item_t::get_end_colnum | ( |  | ) | const
| pure virtual

Get ending column number.

The returned column number is the next column after the expression. If unknown, return -1

## ◆ get_size()

virtual asize_t idaapi source_item_t::get_size | ( |  | ) | const
| pure virtual

Get size of the item in bytes.

If the item is fragmented, return size of the main fragment. if unknown, return 0. On error, return (asize_t) -1.

## ◆ get_item_bounds()

virtual bool idaapi source_item_t::get_item_bounds | ( | rangeset_t * | set | ) | const
| pure virtual

Get item boundaries as a set of ranges.

This function will be used to determine what breakpoints to set for stepping into/stepping over the item.

## ◆ get_parent()

virtual source_item_ptr idaapi source_item_t::get_parent | ( | src_item_kind_t | max_kind | ) | const
| pure virtual

Get parent of the item.

Parameters

  max_kind | maximal source item kind we are interested in. for example, if max_kinds==SRCIT_STMT, we are not interested in expressions, only in the enclosing statement or function

## ◆ get_hint()

virtual bool idaapi source_item_t::get_hint | ( | qstring * | hint,
|  | const eval_ctx_t * | ctx,
|  | int * | nlines
| ) |  | const
| pure virtual

Calculate a string to display as a hint.

Parameters

  hint | output buffer for the hint (may by multiline & with colors)
  ctx | execution context. nullptr means missing context.
  nlines | number of important lines in the hint

## ◆ evaluate()

virtual bool idaapi source_item_t::evaluate | ( | const eval_ctx_t * | ctx,
|  | idc_value_t * | res,
|  | qstring * | errbuf
| ) |  | const
| pure virtual

Evaluate item value (meaningful only for expression items).

Parameters

  ctx | execution context. nullptr means missing context.
  res | buffer for the result (or exception if evaluation failed)
  errbuf | buffer for the error message

## ◆ equals()

virtual bool idaapi source_item_t::equals | ( | const source_item_t * | other | ) | const
| pure virtual

Do these two items have the same source?.

Return values

  false | the source of the underlying data differs between the two items.
  true | when either the source of the underlying data is the same for the two items, or when such information is not available.

E.g., A DWARF implementation of source_item_t will return true if the two items are backed by DIEs that have the same file offset.

## ◆ get_provider()

virtual srcinfo_provider_t *idaapi source_item_t::get_provider | ( | void |  | ) | const
| pure virtual

Get source info provider.

The instance shouldn't be freed or released after using

The documentation for this class was generated from the following file:

- dbg.hpp