Trailing whitespaces are getting in the way

This commit is contained in:
ivan tkachenko 2020-12-24 21:13:48 +03:00 committed by pancake
parent 8ba20160e2
commit d5f651a59e
6 changed files with 67 additions and 67 deletions

View File

@ -82,12 +82,12 @@ static RBinDwarfAttrValue *find_attr(const RBinDwarfDie *die, st32 attr_name) {
} }
/** /**
* @brief Pasted from r_strbuf_* * @brief Pasted from r_strbuf_*
* Prepends string before a last occurence of character c * Prepends string before a last occurence of character c
* Used to replicate proper C declaration for function pointers * Used to replicate proper C declaration for function pointers
* @param sb * @param sb
* @param s * @param s
* @param c * @param c
*/ */
static bool strbuf_rev_prepend_char(RStrBuf *sb, const char *s, int c) { static bool strbuf_rev_prepend_char(RStrBuf *sb, const char *s, int c) {
r_return_val_if_fail (sb && s, false); r_return_val_if_fail (sb && s, false);
@ -116,12 +116,12 @@ static bool strbuf_rev_prepend_char(RStrBuf *sb, const char *s, int c) {
return ret; return ret;
} }
/** /**
* @brief Pasted from r_strbuf_* * @brief Pasted from r_strbuf_*
* Appends string after a first occurence of character c * Appends string after a first occurence of character c
* Used to replicate proper C declaration for function pointers * Used to replicate proper C declaration for function pointers
* @param sb * @param sb
* @param s * @param s
* @param needle * @param needle
*/ */
static bool strbuf_rev_append_char(RStrBuf *sb, const char *s, const char *needle) { static bool strbuf_rev_append_char(RStrBuf *sb, const char *s, const char *needle) {
r_return_val_if_fail (sb && s, false); r_return_val_if_fail (sb && s, false);
@ -157,8 +157,8 @@ static inline char *create_type_name_from_offset(ut64 offset) {
/** /**
* @brief Get the DIE name or create unique one from it's offset * @brief Get the DIE name or create unique one from it's offset
* *
* @param die * @param die
* @return char* DIEs name or NULL if error * @return char* DIEs name or NULL if error
*/ */
static char *get_die_name(const RBinDwarfDie *die) { static char *get_die_name(const RBinDwarfDie *die) {
@ -175,7 +175,7 @@ static char *get_die_name(const RBinDwarfDie *die) {
/** /**
* @brief Get the DIE size in bits * @brief Get the DIE size in bits
* *
* @param die * @param die
* @return ut64 size in bits or 0 if not found * @return ut64 size in bits or 0 if not found
*/ */
@ -197,7 +197,7 @@ static ut64 get_die_size(const RBinDwarfDie *die) {
/** /**
* @brief Parses array type entry signature into strbuf * @brief Parses array type entry signature into strbuf
* *
* @param ctx * @param ctx
* @param idx index of the current entry * @param idx index of the current entry
* @param strbuf strbuf to store the type into * @param strbuf strbuf to store the type into
@ -244,13 +244,13 @@ static st32 parse_array_type(Context *ctx, ut64 idx, RStrBuf *strbuf) {
/** /**
* @brief Recursively parses type entry of a certain offset into strbuf * @brief Recursively parses type entry of a certain offset into strbuf
* saves type size into *size * saves type size into *size
* *
* @param ctx * @param ctx
* @param offset offset of the type entry * @param offset offset of the type entry
* @param strbuf string to store the type into * @param strbuf string to store the type into
* @param size ptr to size of a type to fill up (can be NULL if unwanted) * @param size ptr to size of a type to fill up (can be NULL if unwanted)
* @return st32 -1 if error else DW_TAG of the entry * @return st32 -1 if error else DW_TAG of the entry
* *
* TODO make cache for type entries, one type is usually referenced * TODO make cache for type entries, one type is usually referenced
* multiple times which means it's parsed multiple times instead of once * multiple times which means it's parsed multiple times instead of once
*/ */
@ -363,7 +363,7 @@ static st32 parse_type (Context *ctx, const ut64 offset, RStrBuf *strbuf, ut64 *
/** /**
* @brief Parses structured entry into *result RAnalStructMember * @brief Parses structured entry into *result RAnalStructMember
* http://www.dwarfstd.org/doc/DWARF4.pdf#page=102&zoom=100,0,0 * http://www.dwarfstd.org/doc/DWARF4.pdf#page=102&zoom=100,0,0
* *
* @param ctx * @param ctx
* @param idx index of the current entry * @param idx index of the current entry
* @param result ptr to result member to fill up * @param result ptr to result member to fill up
@ -399,9 +399,9 @@ static RAnalStructMember *parse_struct_member (Context *ctx, ut64 idx, RAnalStru
case DW_AT_data_member_location: case DW_AT_data_member_location:
/* /*
2 cases, 1.: If val is integer, it offset in bytes from 2 cases, 1.: If val is integer, it offset in bytes from
the beginning of containing entity. If containing entity has the beginning of containing entity. If containing entity has
a bit offset, member has that bit offset aswell a bit offset, member has that bit offset aswell
2.: value is a location description 2.: value is a location description
http://www.dwarfstd.org/doc/DWARF4.pdf#page=39&zoom=100,0,0 http://www.dwarfstd.org/doc/DWARF4.pdf#page=39&zoom=100,0,0
*/ */
offset = value->uconstant; offset = value->uconstant;
@ -409,7 +409,7 @@ static RAnalStructMember *parse_struct_member (Context *ctx, ut64 idx, RAnalStru
case DW_AT_accessibility: // private, public etc. case DW_AT_accessibility: // private, public etc.
case DW_AT_mutable: // flag is it is mutable case DW_AT_mutable: // flag is it is mutable
case DW_AT_data_bit_offset: case DW_AT_data_bit_offset:
/* /*
int that specifies the number of bits from beginning int that specifies the number of bits from beginning
of containing entity to the beginning of the data member of containing entity to the beginning of the data member
*/ */
@ -442,7 +442,7 @@ cleanup:
/** /**
* @brief Parses enum entry into *result RAnalEnumCase * @brief Parses enum entry into *result RAnalEnumCase
* http://www.dwarfstd.org/doc/DWARF4.pdf#page=110&zoom=100,0,0 * http://www.dwarfstd.org/doc/DWARF4.pdf#page=110&zoom=100,0,0
* *
* @param ctx * @param ctx
* @param idx index of the current entry * @param idx index of the current entry
* @param result ptr to result case to fill up * @param result ptr to result case to fill up
@ -483,9 +483,9 @@ cleanup:
} }
/** /**
* @brief Parses a structured entry (structs, classes, unions) into * @brief Parses a structured entry (structs, classes, unions) into
* RAnalBaseType and saves it using r_anal_save_base_type () * RAnalBaseType and saves it using r_anal_save_base_type ()
* *
* @param ctx * @param ctx
* @param idx index of the current entry * @param idx index of the current entry
*/ */
@ -563,8 +563,8 @@ cleanup:
/** /**
* @brief Parses a enum entry into RAnalBaseType and saves it * @brief Parses a enum entry into RAnalBaseType and saves it
* int Sdb using r_anal_save_base_type () * int Sdb using r_anal_save_base_type ()
* *
* @param ctx * @param ctx
* @param idx index of the current entry * @param idx index of the current entry
*/ */
static void parse_enum_type(Context *ctx, ut64 idx) { static void parse_enum_type(Context *ctx, ut64 idx) {
@ -626,9 +626,9 @@ cleanup:
/** /**
* @brief Parses a typedef entry into RAnalBaseType and saves it * @brief Parses a typedef entry into RAnalBaseType and saves it
* using r_anal_save_base_type () * using r_anal_save_base_type ()
* *
* http://www.dwarfstd.org/doc/DWARF4.pdf#page=96&zoom=100,0,0 * http://www.dwarfstd.org/doc/DWARF4.pdf#page=96&zoom=100,0,0
* *
* @param ctx * @param ctx
* @param idx index of the current entry * @param idx index of the current entry
*/ */
@ -835,7 +835,7 @@ static const char *map_dwarf_reg_to_x86_reg(ut64 reg_num, VariableLocationKind *
case 4: case 4:
*kind = LOCATION_SP; *kind = LOCATION_SP;
return "esp"; return "esp";
case 5: case 5:
*kind = LOCATION_BP; *kind = LOCATION_BP;
return "ebp"; return "ebp";
case 6: return "esi"; case 6: return "esi";
@ -900,7 +900,7 @@ static const char *map_dwarf_reg_to_ppc64_reg(ut64 reg_num, VariableLocationKind
} }
} }
/* returns string literal register name! /* returns string literal register name!
TODO add more arches */ TODO add more arches */
static const char *get_dwarf_reg_name(char *arch, int reg_num, VariableLocationKind *kind, int bits) { static const char *get_dwarf_reg_name(char *arch, int reg_num, VariableLocationKind *kind, int bits) {
if (!strcmp (arch, "x86")) { if (!strcmp (arch, "x86")) {
@ -1066,7 +1066,7 @@ static VariableLocation *parse_dwarf_location (Context *ctx, const RBinDwarfAttr
if (i == block.length - 1) { if (i == block.length - 1) {
return NULL; return NULL;
} }
/* The single operand of the DW_OP_bregn operations provides /* The single operand of the DW_OP_bregn operations provides
signed LEB128 offset from the specified register. */ signed LEB128 offset from the specified register. */
reg_num = block.data[i] - DW_OP_breg0; // get the reg number reg_num = block.data[i] - DW_OP_breg0; // get the reg number
const ut8 *buffer = &block.data[++i]; const ut8 *buffer = &block.data[++i];
@ -1318,7 +1318,7 @@ static void sdb_save_dwarf_function(Function *dwarf_fcn, RList/*<Variable*>*/ *v
/** /**
* @brief Parse function,it's arguments, variables and * @brief Parse function,it's arguments, variables and
* save the information into the Sdb * save the information into the Sdb
* *
* @param ctx * @param ctx
* @param idx Current entry index * @param idx Current entry index
*/ */
@ -1424,8 +1424,8 @@ cleanup:
/** /**
* @brief Get's language from comp unit for demangling * @brief Get's language from comp unit for demangling
* *
* @param die * @param die
* @return char* string literal language represantation for demangling BinDemangle * @return char* string literal language represantation for demangling BinDemangle
*/ */
static char *parse_comp_unit_lang(const RBinDwarfDie *die) { static char *parse_comp_unit_lang(const RBinDwarfDie *die) {
@ -1443,7 +1443,7 @@ static char *parse_comp_unit_lang(const RBinDwarfDie *die) {
switch (val->uconstant) switch (val->uconstant)
{ {
case DW_LANG_Java: case DW_LANG_Java:
return "java"; return "java";
case DW_LANG_ObjC: case DW_LANG_ObjC:
/* subideal, TODO research if dwarf gives me enough info to properly separate C++ and ObjC mangling */ /* subideal, TODO research if dwarf gives me enough info to properly separate C++ and ObjC mangling */
case DW_LANG_ObjC_plus_plus: case DW_LANG_ObjC_plus_plus:
@ -1484,7 +1484,7 @@ static char *parse_comp_unit_lang(const RBinDwarfDie *die) {
/** /**
* @brief Delegates DIE to it's proper parsing method * @brief Delegates DIE to it's proper parsing method
* *
* @param ctx * @param ctx
* @param idx index of the current entry * @param idx index of the current entry
*/ */
@ -1521,9 +1521,9 @@ static void parse_type_entry(Context *ctx, ut64 idx) {
/** /**
* @brief Parses type and function information out of DWARF entries * @brief Parses type and function information out of DWARF entries
* and stores them to the sdb for further use * and stores them to the sdb for further use
* *
* @param anal * @param anal
* @param ctx * @param ctx
*/ */
R_API void r_anal_dwarf_process_info(const RAnal *anal, RAnalDwarfContext *ctx) { R_API void r_anal_dwarf_process_info(const RAnal *anal, RAnalDwarfContext *ctx) {
r_return_if_fail (ctx && anal); r_return_if_fail (ctx && anal);
@ -1557,8 +1557,8 @@ bool filter_sdb_function_names(void *user, const char *k, const char *v) {
* @brief Use parsed DWARF function info from Sdb in the anal functions * @brief Use parsed DWARF function info from Sdb in the anal functions
* XXX right now we only save parsed name and variables, we can't use signature now * XXX right now we only save parsed name and variables, we can't use signature now
* XXX refactor to be more readable * XXX refactor to be more readable
* @param anal * @param anal
* @param dwarf_sdb * @param dwarf_sdb
*/ */
R_API void r_anal_dwarf_integrate_functions(RAnal *anal, RFlag *flags, Sdb *dwarf_sdb) { R_API void r_anal_dwarf_integrate_functions(RAnal *anal, RFlag *flags, Sdb *dwarf_sdb) {
r_return_if_fail (anal && dwarf_sdb); r_return_if_fail (anal && dwarf_sdb);
@ -1582,7 +1582,7 @@ R_API void r_anal_dwarf_integrate_functions(RAnal *anal, RFlag *flags, Sdb *dwar
char *real_name_key = r_str_newf ("fcn.%s.name", func_sname); char *real_name_key = r_str_newf ("fcn.%s.name", func_sname);
char *real_name = sdb_get (dwarf_sdb, real_name_key, 0); char *real_name = sdb_get (dwarf_sdb, real_name_key, 0);
free (real_name_key); free (real_name_key);
char *dwf_name = r_str_newf ("dbg.%s", real_name); char *dwf_name = r_str_newf ("dbg.%s", real_name);
free (real_name); free (real_name);

View File

@ -532,10 +532,10 @@ static vmi_class_type_info *create_vmi_class_type(ut64 vtable_addr, char *name,
/** /**
* @brief Try to parse as much valid looking RTTI as you can * @brief Try to parse as much valid looking RTTI as you can
* *
* @param context * @param context
* @param vtable_addr * @param vtable_addr
* @param rtti_addr * @param rtti_addr
* @return class_type_info* NULL if not even default class RTTI could be parsed or error * @return class_type_info* NULL if not even default class RTTI could be parsed or error
*/ */
static class_type_info *raw_rtti_parse(RVTableContext *context, ut64 vtable_addr, ut64 rtti_addr) { static class_type_info *raw_rtti_parse(RVTableContext *context, ut64 vtable_addr, ut64 rtti_addr) {
@ -544,7 +544,7 @@ static class_type_info *raw_rtti_parse(RVTableContext *context, ut64 vtable_addr
|--------------------------------------| |--------------------------------------|
| type_name | | type_name |
|--------------------------------------| --- enough for __class_type_info |--------------------------------------| --- enough for __class_type_info
| __class_type_info *base_type | | __class_type_info *base_type |
|--------------------------------------| --- enough for __si_class_type_info |--------------------------------------| --- enough for __si_class_type_info
| uint flags | --- must be atleast 16bits, it's 32 bit for 64-bit Itanium ABI | uint flags | --- must be atleast 16bits, it's 32 bit for 64-bit Itanium ABI
|--------------------------------------| |--------------------------------------|
@ -775,9 +775,9 @@ static void recovery_apply_vtable(RVTableContext *context, const char *class_nam
/** /**
* @brief Add any base class information about the type into anal/classes * @brief Add any base class information about the type into anal/classes
* *
* @param context * @param context
* @param cti * @param cti
*/ */
static void add_class_bases(RVTableContext *context, const class_type_info *cti) { static void add_class_bases(RVTableContext *context, const class_type_info *cti) {
class_type_info base_info; class_type_info base_info;

View File

@ -48,7 +48,7 @@
#define dbg (0) #define dbg (0)
#endif #endif
/* Classification of the opcodes for the decoder to print /* Classification of the opcodes for the decoder to print
the instructions. */ the instructions. */
typedef enum typedef enum

View File

@ -3580,7 +3580,7 @@ dsmOneArcInst (bfd_vma addr, struct arcDisState *state, disassemble_info * info)
my_sprintf(state, state->operandBuffer, formatString, fieldB); my_sprintf(state, state->operandBuffer, formatString, fieldB);
break; break;
/* START ARC LOCAL */ /* START ARC LOCAL */
case 44: case 44:
/* rtsc instruction */ /* rtsc instruction */
@ -3771,7 +3771,7 @@ _instName
static void static void
parse_disassembler_options (char *options) parse_disassembler_options (char *options)
{ {
const char *p; const char *p;
for (p = options; p != NULL; ) for (p = options; p != NULL; )
{ {
if (CONST_STRNEQ (p, "simd")) if (CONST_STRNEQ (p, "simd"))
@ -3782,14 +3782,14 @@ parse_disassembler_options (char *options)
{ {
enable_insn_stream = 1; enable_insn_stream = 1;
} }
p = strchr (p, ','); p = strchr (p, ',');
if (p != NULL) { if (p != NULL) {
p++; p++;
} }
} }
} }
/* ARCompact_decodeInstr - Decode an ARCompact instruction returning the /* ARCompact_decodeInstr - Decode an ARCompact instruction returning the
@ -3928,7 +3928,7 @@ ARCompact_decodeInstr (bfd_vma address, /* Address of this instruct
/* We print max bytes for instruction */ /* We print max bytes for instruction */
info->bytes_per_line = 8; info->bytes_per_line = 8;
return bytes; //s.instructionLen; return bytes; //s.instructionLen;
} }
@ -4027,6 +4027,6 @@ arc_print_disassembler_options (FILE *stream)
fprintf (stream, " insn-stream Show the instruction byte stream from most\n"); fprintf (stream, " insn-stream Show the instruction byte stream from most\n");
fprintf (stream, " significant byte to least significant byte (excluding LIMM).\n"); fprintf (stream, " significant byte to least significant byte (excluding LIMM).\n");
fprintf (stream, " This option is useful for viewing the actual encoding of instructions.\n"); fprintf (stream, " This option is useful for viewing the actual encoding of instructions.\n");
fprintf (stream, " simd Enable SIMD instructions disassembly.\n\n"); fprintf (stream, " simd Enable SIMD instructions disassembly.\n\n");
} }

View File

@ -6448,7 +6448,7 @@ select_arm_features (unsigned long mach,
arm_feature_set * features) arm_feature_set * features)
{ {
#undef ARM_SET_FEATURES2 #undef ARM_SET_FEATURES2
//ARM_FEATURE (0, 0, FPU_ARCH_VFP_V4D16) ; //ARM_FEATURE (0, 0, FPU_ARCH_VFP_V4D16) ;
#define ARM_SET_FEATURES2(FSET) \ #define ARM_SET_FEATURES2(FSET) \
{ \ { \
const arm_feature_set fset = FSET; \ const arm_feature_set fset = FSET; \

View File

@ -43,8 +43,8 @@ static void free_pdb_stream(void *stream) {
/** /**
* @brief Create a type name from offset * @brief Create a type name from offset
* *
* @param offset * @param offset
* @return char* Name or NULL if error * @return char* Name or NULL if error
*/ */
static char *create_type_name_from_offset(ut64 offset) { static char *create_type_name_from_offset(ut64 offset) {
@ -646,7 +646,7 @@ static SimpleTypeKind get_simple_type_kind (PDB_SIMPLE_TYPES type) {
/** /**
* @brief Maps simple type into a format string for `pf` * @brief Maps simple type into a format string for `pf`
* *
* @param simple_type * @param simple_type
* @param member_format pointer to assert member format to * @param member_format pointer to assert member format to
* @return int -1 if it's unparsable, -2 if it should be skipped, 0 if all is correct * @return int -1 if it's unparsable, -2 if it should be skipped, 0 if all is correct
@ -795,7 +795,7 @@ static int simple_type_to_format (const SLF_SIMPLE_TYPE *simple_type, char **mem
/** /**
* @brief Creates the format string and puts it into format * @brief Creates the format string and puts it into format
* *
* @param type_info Information about the member type * @param type_info Information about the member type
* @param format buffer for the formatting string * @param format buffer for the formatting string
* @param names buffer for the member names * @param names buffer for the member names
@ -919,7 +919,7 @@ static inline bool is_printable_type(ELeafType type) {
/** /**
* @brief Gets the name of the enum base type * @brief Gets the name of the enum base type
* *
* @param type_info Enum TypeInfo * @param type_info Enum TypeInfo
* @return char* name of the base type * @return char* name of the base type
*/ */
@ -941,7 +941,7 @@ static char *get_enum_base_type_name(STypeInfo *type_info) {
/** /**
* @brief Prints out structure and class leaf types * @brief Prints out structure and class leaf types
* *
* @param name Name of the structure/class * @param name Name of the structure/class
* @param size Size of the structure/class * @param size Size of the structure/class
* @param members List of members * @param members List of members
@ -974,7 +974,7 @@ static void print_struct(const char *name, const int size, const RList *members,
/** /**
* @brief Prints out union leaf type * @brief Prints out union leaf type
* *
* @param name Name of the union * @param name Name of the union
* @param size Size of the union * @param size Size of the union
* @param members List of members * @param members List of members
@ -1007,7 +1007,7 @@ static void print_union(const char *name, const int size, const RList *members,
/** /**
* @brief Prints out enum leaf type * @brief Prints out enum leaf type
* *
* @param name Name of the enum * @param name Name of the enum
* @param type type of the enum * @param type type of the enum
* @param members List of cases * @param members List of cases
@ -1035,7 +1035,7 @@ static void print_enum(const char *name, const char *type, const RList *members,
/** /**
* @brief Prints out types in a default format "idpi" command * @brief Prints out types in a default format "idpi" command
* *
* @param pdb pdb structure for printing function * @param pdb pdb structure for printing function
* @param types List of types * @param types List of types
*/ */
@ -1092,7 +1092,7 @@ static void print_types_regular(const RPdb *pdb, const RList *types) {
/** /**
* @brief Prints out types in a json format - "idpij" command * @brief Prints out types in a json format - "idpij" command
* *
* @param pdb pdb structure for printing function * @param pdb pdb structure for printing function
* @param types List of types * @param types List of types
*/ */
@ -1210,7 +1210,7 @@ static void print_types_json(const RPdb *pdb, PJ *pj, const RList *types) {
/** /**
* @brief Creates pf commands from PDB types - "idpi*" command * @brief Creates pf commands from PDB types - "idpi*" command
* *
* @param pdb pdb structure for printing function * @param pdb pdb structure for printing function
* @param types List of types * @param types List of types
*/ */
@ -1299,7 +1299,7 @@ static void print_types_format(const RPdb *pdb, const RList *types) {
/** /**
* @brief Prints out all the type information in regular,json or pf format * @brief Prints out all the type information in regular,json or pf format
* *
* @param pdb PDB information * @param pdb PDB information
* @param mode printing mode * @param mode printing mode
*/ */