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 }
24
Deserialize(const protoPanda::DebuginfoIns & protoDebug,panda::pandasm::debuginfo::Ins & debug)25 void DebuginfoIns::Deserialize(const protoPanda::DebuginfoIns &protoDebug, panda::pandasm::debuginfo::Ins &debug)
26 {
27 debug.line_number = protoDebug.linenumber();
28 debug.column_number = protoDebug.columnnumber();
29 }
30
Serialize(const panda::pandasm::debuginfo::LocalVariable & debug,protoPanda::LocalVariable & protoDebug)31 void LocalVariable::Serialize(const panda::pandasm::debuginfo::LocalVariable &debug,
32 protoPanda::LocalVariable &protoDebug)
33 {
34 protoDebug.set_name(debug.name);
35 protoDebug.set_signature(debug.signature);
36 protoDebug.set_signaturetype(debug.signature_type);
37 protoDebug.set_reg(debug.reg);
38 protoDebug.set_start(debug.start);
39 protoDebug.set_length(debug.length);
40 }
41
Deserialize(const protoPanda::LocalVariable & protoDebug,panda::pandasm::debuginfo::LocalVariable & debug)42 void LocalVariable::Deserialize(const protoPanda::LocalVariable &protoDebug,
43 panda::pandasm::debuginfo::LocalVariable &debug)
44 {
45 debug.name = protoDebug.name();
46 debug.signature = protoDebug.signature();
47 debug.signature_type = protoDebug.signaturetype();
48 debug.reg = protoDebug.reg();
49 debug.start = protoDebug.start();
50 debug.length = protoDebug.length();
51 }
52 } // panda::proto
53