mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-14 09:18:09 +00:00
STAP copy functions
This commit is contained in:
@@ -436,3 +436,22 @@ stap_read_arg_f(STAP_Arg arg, Arch arch, void *reg_block, STAP_MemoryRead *memor
|
||||
return stap_read_arg(arg, arch, reg_block, memory_read, memory_read_ctx, f_out);
|
||||
}
|
||||
|
||||
internal STAP_Arg
|
||||
stap_arg_copy(STAP_Arg *src)
|
||||
{
|
||||
return *src;
|
||||
}
|
||||
|
||||
internal STAP_ArgArray
|
||||
stap_arg_array_copy(Arena *arena, STAP_ArgArray arr)
|
||||
{
|
||||
STAP_ArgArray result = {0};
|
||||
result.count = arr.count;
|
||||
result.v = push_array(arena, STAP_Arg, arr.count);
|
||||
for EachIndex(arg_idx, arr.count)
|
||||
{
|
||||
result.v[arg_idx] = stap_arg_copy(&arr.v[arg_idx]);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ typedef struct STAP_Arg
|
||||
B8 is_alias;
|
||||
} reg;
|
||||
struct {
|
||||
S64 disp;
|
||||
S64 disp;
|
||||
struct {
|
||||
U32 reg_code;
|
||||
B8 is_alias;
|
||||
@@ -41,7 +41,7 @@ typedef struct STAP_Arg
|
||||
U32 reg_code;
|
||||
B8 is_alias;
|
||||
} index;
|
||||
U64 scale;
|
||||
U64 scale;
|
||||
} memory_ref;
|
||||
};
|
||||
} STAP_Arg;
|
||||
@@ -78,5 +78,8 @@ internal B32 stap_read_arg_u(STAP_Arg arg, Arch arch, void *reg_block, STAP_Memo
|
||||
internal B32 stap_read_arg_s(STAP_Arg arg, Arch arch, void *reg_block, STAP_MemoryRead *memory_read, void *memory_read_ctx, S64 *s_out);
|
||||
internal B32 stap_read_arg_f(STAP_Arg arg, Arch arch, void *reg_block, STAP_MemoryRead *memory_read, void *memory_read_ctx, F64 *f_out);
|
||||
|
||||
internal STAP_Arg stap_arg_copy(STAP_Arg *src);
|
||||
internal STAP_ArgArray stap_arg_array_copy(Arena *arena, STAP_ArgArray arr);
|
||||
|
||||
#endif // STAP_PARSE_H
|
||||
|
||||
|
||||
Reference in New Issue
Block a user