1/**
2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16#ifndef ASSEMBLER_ASSEMBLY_DEBUG_H
17#define ASSEMBLER_ASSEMBLY_DEBUG_H
18
19#include <string>
20
21namespace panda::pandasm::debuginfo {
22
23struct Ins {
24    size_t line_number = 0;
25    uint32_t column_number = 0;
26    std::string whole_line = "";  // TODO(mbolshov): redundant given file and line_number
27    size_t bound_left = 0;
28    size_t bound_right = 0;
29
30    void SetLineNumber(size_t ln)
31    {
32        line_number = ln;
33    }
34
35    void SetColumnNumber(size_t cn)
36    {
37        column_number = cn;
38    }
39
40    Ins() = default;
41    Ins(size_t l_n, std::string &f_c, size_t b_l, size_t b_r)
42        : line_number(l_n), whole_line(std::move(f_c)), bound_left(b_l), bound_right(b_r)
43    {
44    }
45};
46
47struct LocalVariable {
48    std::string name;
49    std::string signature;
50    std::string signature_type;
51    int32_t reg = 0;
52    uint32_t start = 0;
53    uint32_t length = 0;
54};
55
56}  // namespace panda::pandasm::debuginfo
57
58#endif  // ASSEMBLER_ASSEMBLY_DEBUG_H
59