diff --git a/include/libpst-types.h b/include/libpst-types.h index 2add1df..7be8108 100644 --- a/include/libpst-types.h +++ b/include/libpst-types.h @@ -22,7 +22,7 @@ typedef enum { IS_PUBLIC = 0x00000040, ///< public member of class } pst_fun_flags; - +/// @brief information about function typedef struct { char* name; ///< demangled name of the function. NULL if function name resolution failed char* file; ///< file name where the function is defined. NULL if library failed to get file name @@ -70,6 +70,7 @@ typedef enum { PARAM_TYPE_FUNCPTR = 0x04000000, ///< pointer to function } pst_param_flags; +/// @brief information about parameter typedef struct { char* name; ///< parameter's name char* type_name; ///< name of parameter's type diff --git a/include/libpst.h b/include/libpst.h index 1b5760d..94772d9 100644 --- a/include/libpst.h +++ b/include/libpst.h @@ -84,9 +84,10 @@ const pst_function_info* pst_get_function_info(pst_function* function); int pst_get_register(pst_function* function, int regno, unw_word_t* val); /** - * @brief Check memory range of process to validity (i.e. that process has access to this range) + * @brief Check memory range of process for validity (i.e. that process has access to this range) * @param p pointer to start of range * @param size size of range to check + * @return zero if range of memory pointed by 'p' is valid */ int pst_pointer_valid(void *p, uint32_t size); diff --git a/src/dwarf/dwarf_call_site.c b/src/dwarf/dwarf_call_site.c index 353d7e8..680a70b 100644 --- a/src/dwarf/dwarf_call_site.c +++ b/src/dwarf/dwarf_call_site.c @@ -125,7 +125,7 @@ bool call_site_handle_dwarf(pst_call_site* site, Dwarf_Die* child) pst_dwarf_expr_fini(&loc); pst_log(SEVERITY_DEBUG, " DW_AT_GNU_call_site_value:\"%s\" ==> 0x%lX", site->ctx->buff, param->value); } else { - pst_log(SEVERITY_ERROR, "Failed to calculate DW_AT_location expression: %s", site->ctx->buff); + pst_log(SEVERITY_WARNING, "Failed to calculate DW_AT_location expression: %s", site->ctx->buff); del_param(param); pst_dwarf_expr_fini(&loc); return false; diff --git a/src/dwarf/dwarf_function.c b/src/dwarf/dwarf_function.c index 1e79201..84dae1c 100644 --- a/src/dwarf/dwarf_function.c +++ b/src/dwarf/dwarf_function.c @@ -158,7 +158,7 @@ static bool handle_lexical_block(pst_function* fn, Dwarf_Die* result) pst_log(SEVERITY_DEBUG, "Skipping Lexical block tag 'DW_TAG_inlined_subroutine'"); break; default: - pst_log(SEVERITY_DEBUG, "Unknown Lexical block tag 0x%X", dwarf_tag(&child)); + pst_log(SEVERITY_WARNING, "Unknown Lexical block tag 0x%X", dwarf_tag(&child)); break; } }while (dwarf_siblingof (&child, &child) == 0); @@ -372,7 +372,7 @@ bool function_handle_dwarf(pst_function * fn, Dwarf_Die* d) // Also handle: // DW_AT_inline default: - pst_log(SEVERITY_DEBUG, "Unknown TAG of function: 0x%X", dwarf_tag(&result)); + pst_log(SEVERITY_WARNING, "Unknown TAG of function: 0x%X", dwarf_tag(&result)); break; } } while(dwarf_siblingof(&result, &result) == 0); @@ -464,7 +464,7 @@ void pst_function_fini(pst_function* fn) clear(fn); if(fn->frame) { - // use free here because it was allocated out of our control by libdw + // use free() here because it was allocated out of our control by libdw free(fn->frame); } diff --git a/src/dwarf/dwarf_operations.c b/src/dwarf/dwarf_operations.c index 932158f..120034b 100644 --- a/src/dwarf/dwarf_operations.c +++ b/src/dwarf/dwarf_operations.c @@ -16,6 +16,7 @@ // not implemented operations static bool dw_op_notimpl(pst_dwarf_stack* stack, const dwarf_op_map* map, Dwarf_Word op1, Dwarf_Word op2) { + pst_log(SEVERITY_WARNING, "Not implemented DWARF operation %s(0x%X)", map->op_name, map->op_num); return false; } diff --git a/src/dwarf/dwarf_parameter.c b/src/dwarf/dwarf_parameter.c index e7639f8..3d3fe46 100644 --- a/src/dwarf/dwarf_parameter.c +++ b/src/dwarf/dwarf_parameter.c @@ -423,7 +423,7 @@ bool parameter_handle_dwarf(pst_parameter* param, Dwarf_Die* result, pst_functio param->info.value = param->location.value; param->info.flags |= PARAM_HAS_VALUE; } else { - pst_log(SEVERITY_ERROR, "Failed to calculate DW_AT_location expression: %s", param->ctx->buff); + pst_log(SEVERITY_WARNING, "Failed to calculate DW_AT_location expression: %s", param->ctx->buff); } } else if(dwarf_hasattr(result, DW_AT_const_value)) { param->info.flags |= PARAM_CONST;