MCPcopy Create free account
hub / github.com/lief-project/LIEF / Variable>

Method Variable>

api/python/src/DWARF/editor/pyVariable.cpp:8–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6namespace LIEF::dwarf::py {
7template<>
8void create<dw::editor::Variable>(nb::module_& m) {
9 nb::class_<dw::editor::Variable> V(m, "Variable",
10 R"doc(
11 This class represents an **editable** DWARF variable which can be
12 scoped by a function or a compilation unit (``DW_TAG_variable``)
13 )doc"_doc
14 );
15
16 V
17 .def("set_addr", &dw::editor::Variable::set_addr,
18 R"doc(
19 Set the global address of this variable. Setting this address is only
20 revelant in the case of a static global variable. For stack variable, you
21 should use :meth:`~.Variable.set_stack_offset`.
22
23 This function set the ``DW_AT_location`` attribute
24 )doc"_doc, "addr"_a, nb::rv_policy::reference_internal)
25
26 .def("set_stack_offset", &dw::editor::Variable::set_stack_offset,
27 R"doc(
28 Set the stack offset of this variable.
29
30 This function set the ``DW_AT_location`` attribute
31 )doc"_doc, "offset"_a, nb::rv_policy::reference_internal)
32
33 .def("set_external", &dw::editor::Variable::set_external,
34 R"doc(
35 Mark this variable as **imported**
36 )doc"_doc, nb::rv_policy::reference_internal)
37
38 .def("set_type", &dw::editor::Variable::set_type,
39 R"doc(
40 Set the type of the current variable
41 )doc"_doc, "type"_a, nb::rv_policy::reference_internal)
42 ;
43}
44
45}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected