Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typo (dwarf) in the codebase #2367

Merged
merged 1 commit into from
Jul 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions core/iwasm/compilation/aot.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ typedef WASMType AOTFuncType;
typedef WASMExport AOTExport;

#if WASM_ENABLE_DEBUG_AOT != 0
typedef void *dwar_extractor_handle_t;
typedef void *dwarf_extractor_handle_t;
#endif

typedef enum AOTIntCond {
Expand Down Expand Up @@ -285,7 +285,7 @@ typedef struct AOTCompData {

WASMModule *wasm_module;
#if WASM_ENABLE_DEBUG_AOT != 0
dwar_extractor_handle_t extractor;
dwarf_extractor_handle_t extractor;
#endif
} AOTCompData;

Expand Down
32 changes: 16 additions & 16 deletions core/iwasm/compilation/debug/dwarf_extractor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,25 @@

using namespace lldb;

typedef struct dwar_extractor {
typedef struct dwarf_extractor {
SBDebugger debugger;
SBTarget target;
SBModule module;

} dwar_extractor;
} dwarf_extractor;

#define TO_HANDLE(extractor) (dwar_extractor_handle_t)(extractor)
#define TO_HANDLE(extractor) (dwarf_extractor_handle_t)(extractor)

#define TO_EXTACTOR(handle) (dwar_extractor *)(handle)
#define TO_EXTACTOR(handle) (dwarf_extractor *)(handle)

static bool is_debugger_initialized;

dwar_extractor_handle_t
dwarf_extractor_handle_t
create_dwarf_extractor(AOTCompData *comp_data, char *file_name)
{
char *arch = NULL;
char *platform = NULL;
dwar_extractor *extractor = NULL;
dwarf_extractor *extractor = NULL;

//__attribute__((constructor)) may be better?
if (!is_debugger_initialized) {
Expand All @@ -61,7 +61,7 @@ create_dwarf_extractor(AOTCompData *comp_data, char *file_name)
SBError error;
SBFileSpec exe_file_spec(file_name, true);

if (!(extractor = new dwar_extractor())) {
if (!(extractor = new dwarf_extractor())) {
LOG_ERROR("Create Dwarf Extractor error: failed to allocate memory");
goto fail3;
}
Expand Down Expand Up @@ -101,9 +101,9 @@ create_dwarf_extractor(AOTCompData *comp_data, char *file_name)
}

void
destroy_dwarf_extractor(dwar_extractor_handle_t handle)
destroy_dwarf_extractor(dwarf_extractor_handle_t handle)
{
dwar_extractor *extractor = TO_EXTACTOR(handle);
dwarf_extractor *extractor = TO_EXTACTOR(handle);
if (!extractor)
return;
extractor->debugger.DeleteTarget(extractor->target);
Expand All @@ -116,7 +116,7 @@ destroy_dwarf_extractor(dwar_extractor_handle_t handle)
LLVMMetadataRef
dwarf_gen_file_info(const AOTCompContext *comp_ctx)
{
dwar_extractor *extractor;
dwarf_extractor *extractor;
int units_number;
LLVMMetadataRef file_info = NULL;
const char *file_name;
Expand Down Expand Up @@ -193,7 +193,7 @@ dwarf_gen_mock_vm_info(AOTCompContext *comp_ctx)
LLVMMetadataRef
dwarf_gen_comp_unit_info(const AOTCompContext *comp_ctx)
{
dwar_extractor *extractor;
dwarf_extractor *extractor;
int units_number;
LLVMMetadataRef comp_unit = NULL;

Expand Down Expand Up @@ -292,7 +292,7 @@ lldb_function_to_function_dbi(const AOTCompContext *comp_ctx,
SBTypeList function_args = function.GetType().GetFunctionArgumentTypes();
SBType return_type = function.GetType().GetFunctionReturnType();
const size_t num_function_args = function_args.GetSize();
dwar_extractor *extractor;
dwarf_extractor *extractor;

if (!(extractor = TO_EXTACTOR(comp_ctx->comp_data->extractor)))
return NULL;
Expand Down Expand Up @@ -393,7 +393,7 @@ dwarf_gen_func_info(const AOTCompContext *comp_ctx,
const AOTFuncContext *func_ctx)
{
LLVMMetadataRef func_info = NULL;
dwar_extractor *extractor;
dwarf_extractor *extractor;
uint64_t vm_offset;
AOTFunc *func = func_ctx->aot_func;

Expand Down Expand Up @@ -423,7 +423,7 @@ dwarf_get_func_name(const AOTCompContext *comp_ctx,
const AOTFuncContext *func_ctx, char *name, int len)
{
LLVMMetadataRef func_info = NULL;
dwar_extractor *extractor;
dwarf_extractor *extractor;
uint64_t vm_offset;
AOTFunc *func = func_ctx->aot_func;

Expand Down Expand Up @@ -454,7 +454,7 @@ dwarf_gen_location(const AOTCompContext *comp_ctx,
const AOTFuncContext *func_ctx, uint64_t vm_offset)
{
LLVMMetadataRef location_info = NULL;
dwar_extractor *extractor;
dwarf_extractor *extractor;
AOTFunc *func = func_ctx->aot_func;

if (!(extractor = TO_EXTACTOR(comp_ctx->comp_data->extractor)))
Expand Down Expand Up @@ -493,7 +493,7 @@ dwarf_gen_func_ret_location(const AOTCompContext *comp_ctx,
const AOTFuncContext *func_ctx)
{
LLVMMetadataRef func_info = NULL;
dwar_extractor *extractor;
dwarf_extractor *extractor;
uint64_t vm_offset;
AOTFunc *func = func_ctx->aot_func;
LLVMMetadataRef location_info = NULL;
Expand Down
4 changes: 2 additions & 2 deletions core/iwasm/compilation/debug/dwarf_extractor.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ typedef unsigned int LLDBLangType;

struct AOTCompData;
typedef struct AOTCompData *aot_comp_data_t;
typedef void *dwar_extractor_handle_t;
typedef void *dwarf_extractor_handle_t;

struct AOTCompContext;
typedef struct AOTCompContext AOTCompContext;

struct AOTFuncContext;

typedef struct AOTFuncContext AOTFuncContext;
dwar_extractor_handle_t
dwarf_extractor_handle_t
create_dwarf_extractor(aot_comp_data_t comp_data, char *file_name);

LLVMMetadataRef
Expand Down
4 changes: 2 additions & 2 deletions core/iwasm/include/aot_export.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ void
aot_destroy_comp_data(aot_comp_data_t comp_data);

#if WASM_ENABLE_DEBUG_AOT != 0
typedef void *dwar_extractor_handle_t;
dwar_extractor_handle_t
typedef void *dwarf_extractor_handle_t;
dwarf_extractor_handle_t
create_dwarf_extractor(aot_comp_data_t comp_data, char *file_name);
#endif

Expand Down