Rizin
unix-like reverse engineering framework and cli tools
serialize_debug.c
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2021 Dhruv Maroo <dhruvmaru007@gmail.com>
2 // SPDX-License-Identifier: LGPL-3.0-only
3 
4 #include <rz_debug.h>
5 #include <rz_bp.h>
6 #include <rz_util/rz_serialize.h>
7 
15  rz_return_if_fail(db && dbg);
16  rz_serialize_bp_save(sdb_ns(db, "breakpoints", true), dbg->bp);
17 }
18 
28  rz_return_val_if_fail(db && dbg, false);
29  bool ret = false;
30 #define SUB(ns, call) RZ_SERIALIZE_SUB_DO(db, subdb, res, ns, call, goto heaven;)
31 
32  Sdb *subdb;
33  SUB("breakpoints", rz_serialize_bp_load(subdb, dbg->bp, res));
34 
35  ret = true;
36 heaven:
37  return ret;
38 }
#define RZ_API
RzDebug * dbg
Definition: desil.c:30
RZ_API Sdb * sdb_ns(Sdb *s, const char *name, int create)
Definition: ns.c:186
#define rz_return_if_fail(expr)
Definition: rz_assert.h:100
#define rz_return_val_if_fail(expr, val)
Definition: rz_assert.h:108
#define RZ_NULLABLE
Definition: rz_types.h:65
#define RZ_NONNULL
Definition: rz_types.h:64
RZ_API bool rz_serialize_bp_load(RZ_NONNULL Sdb *db, RZ_NONNULL RzBreakpoint *bp, RZ_NULLABLE RzSerializeResultInfo *res)
Load a serialized breakpoints to a RzBreakpoint instance.
Definition: serialize_bp.c:302
RZ_API void rz_serialize_bp_save(RZ_NONNULL Sdb *db, RZ_NONNULL RzBreakpoint *bp)
serialize and save the breakpoints in a sdb
Definition: serialize_bp.c:13
RZ_API void rz_serialize_debug_save(RZ_NONNULL Sdb *db, RZ_NONNULL RzDebug *dbg)
Serialize debug state (RzDebug) and save to a sdb.
RZ_API bool rz_serialize_debug_load(RZ_NONNULL Sdb *db, RZ_NONNULL RzDebug *dbg, RZ_NULLABLE RzSerializeResultInfo *res)
Load a serialized debug state to a RzDebug instance.
#define SUB(ns, call)
RzBreakpoint * bp
Definition: rz_debug.h:288
Definition: sdb.h:63