1 /**
2 * Copyright (c) 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 #include "assemblyDebugProto.h"
17
18 namespace panda::proto {
Serialize(const panda::pandasm::debuginfo::Ins & debug,protoPanda::DebuginfoIns & protoDebug)19 void DebuginfoIns::Serialize(const panda::pandasm::debuginfo::Ins &debug, protoPanda::DebuginfoIns &protoDebug)
20 {
21 protoDebug.set_linenumber(debug.line_number);
22 protoDebug.set_columnnumber(debug.column_number);
23 protoDebug.set_wholeline(debug.whole_line);
24 protoDebug.set_boundleft(debug.bound_left);
25 protoDebug.set_boundright(debug.bound_right);
26 }
27
Deserialize(const protoPanda::DebuginfoIns & protoDebug,panda::pandasm::debuginfo::Ins & debug)28 void DebuginfoIns::Deserialize(const protoPanda::DebuginfoIns &protoDebug, panda::pandasm::debuginfo::Ins &debug)
29 {
30 debug.line_number = protoDebug.linenumber();
31 debug.column_number = protoDebug.columnnumber();
32 debug.whole_line = protoDebug.wholeline();
33 debug.bound_left = protoDebug.boundleft();
34 debug.bound_right = protoDebug.boundright();
35 }
36
Serialize(const panda::pandasm::debuginfo::LocalVariable & debug,protoPanda::LocalVariable & protoDebug)37 void LocalVariable::Serialize(const panda::pandasm::debuginfo::LocalVariable &debug,
38 protoPanda::LocalVariable &protoDebug)
39 {
40 protoDebug.set_name(debug.name);
41 protoDebug.set_signature(debug.signature);
42 protoDebug.set_signaturetype(debug.signature_type);
43 protoDebug.set_reg(debug.reg);
44 protoDebug.set_start(debug.start);
45 protoDebug.set_length(debug.length);
46 }
47
Deserialize(const protoPanda::LocalVariable & protoDebug,panda::pandasm::debuginfo::LocalVariable & debug)48 void LocalVariable::Deserialize(const protoPanda::LocalVariable &protoDebug,
49 panda::pandasm::debuginfo::LocalVariable &debug)
50 {
51 debug.name = protoDebug.name();
52 debug.signature = protoDebug.signature();
53 debug.signature_type = protoDebug.signaturetype();
54 debug.reg = protoDebug.reg();
55 debug.start = protoDebug.start();
56 debug.length = protoDebug.length();
57 }
58 } // panda::proto
59