summaryrefslogtreecommitdiffstats
path: root/lib/Utils
diff options
context:
space:
mode:
authorKarel Klic <kklic@redhat.com>2010-03-31 15:12:41 +0200
committerKarel Klic <kklic@redhat.com>2010-03-31 15:12:41 +0200
commit41d165340e8367d66719d5e306cdf55164f6b3c3 (patch)
tree08295a240a5d2fa584c7bd03dac14b1cb09bfac4 /lib/Utils
parentd97ff74a7c897122d4789418efa451bee2f0b784 (diff)
downloadabrt-41d165340e8367d66719d5e306cdf55164f6b3c3.tar.gz
abrt-41d165340e8367d66719d5e306cdf55164f6b3c3.tar.xz
abrt-41d165340e8367d66719d5e306cdf55164f6b3c3.zip
Removed trailing whitespaces.
Diffstat (limited to 'lib/Utils')
-rw-r--r--lib/Utils/backtrace.c84
-rw-r--r--lib/Utils/backtrace.h42
-rw-r--r--lib/Utils/backtrace_parser.y318
-rw-r--r--lib/Utils/strbuf.c10
4 files changed, 227 insertions, 227 deletions
diff --git a/lib/Utils/backtrace.c b/lib/Utils/backtrace.c
index 746a1cd0..3708eb17 100644
--- a/lib/Utils/backtrace.c
+++ b/lib/Utils/backtrace.c
@@ -77,7 +77,7 @@ static void frame_append_str(struct frame *frame, struct strbuf *str, bool verbo
if (frame->signal_handler_called)
strbuf_append_str(str, " <signal handler called>");
-
+
strbuf_append_str(str, "\n");
}
@@ -98,7 +98,7 @@ static bool frame_is_abort_frame(struct frame *frame)
if (!frame->function || !frame->sourcefile)
return false;
- if (0 == strcmp(frame->function, "raise")
+ if (0 == strcmp(frame->function, "raise")
&& (NULL != strstr(frame->sourcefile, "pt-raise.c")
|| NULL != strstr(frame->sourcefile, "/libc.so.6")))
return true;
@@ -111,7 +111,7 @@ static bool frame_is_abort_frame(struct frame *frame)
return true;
else if (frame_is_exit_handler(frame))
return true;
-
+
return false;
}
@@ -134,57 +134,57 @@ static bool frame_is_noncrash_frame(struct frame *frame)
return false;
/* GDK */
- if (0 == strcmp(frame->function, "gdk_x_error")
+ if (0 == strcmp(frame->function, "gdk_x_error")
&& 0 == strcmp(frame->sourcefile, "gdkmain-x11.c"))
return true;
/* X.org */
- if (0 == strcmp(frame->function, "_XReply")
+ if (0 == strcmp(frame->function, "_XReply")
&& 0 == strcmp(frame->sourcefile, "xcb_io.c"))
return true;
- if (0 == strcmp(frame->function, "_XError")
+ if (0 == strcmp(frame->function, "_XError")
&& 0 == strcmp(frame->sourcefile, "XlibInt.c"))
return true;
- if (0 == strcmp(frame->function, "XSync")
+ if (0 == strcmp(frame->function, "XSync")
&& 0 == strcmp(frame->sourcefile, "Sync.c"))
return true;
- if (0 == strcmp(frame->function, "process_responses")
+ if (0 == strcmp(frame->function, "process_responses")
&& 0 == strcmp(frame->sourcefile, "xcb_io.c"))
return true;
/* glib */
- if (0 == strcmp(frame->function, "IA__g_log")
+ if (0 == strcmp(frame->function, "IA__g_log")
&& 0 == strcmp(frame->sourcefile, "gmessages.c"))
return true;
- if (0 == strcmp(frame->function, "IA__g_logv")
+ if (0 == strcmp(frame->function, "IA__g_logv")
&& 0 == strcmp(frame->sourcefile, "gmessages.c"))
return true;
- if (0 == strcmp(frame->function, "IA__g_assertion_message")
+ if (0 == strcmp(frame->function, "IA__g_assertion_message")
&& 0 == strcmp(frame->sourcefile, "gtestutils.c"))
return true;
- if (0 == strcmp(frame->function, "IA__g_assertion_message_expr")
+ if (0 == strcmp(frame->function, "IA__g_assertion_message_expr")
&& 0 == strcmp(frame->sourcefile, "gtestutils.c"))
return true;
/* DBus */
- if (0 == strcmp(frame->function, "gerror_to_dbus_error_message")
+ if (0 == strcmp(frame->function, "gerror_to_dbus_error_message")
&& 0 == strcmp(frame->sourcefile, "dbus-gobject.c"))
return true;
- if (0 == strcmp(frame->function, "dbus_g_method_return_error")
+ if (0 == strcmp(frame->function, "dbus_g_method_return_error")
&& 0 == strcmp(frame->sourcefile, "dbus-gobject.c"))
return true;
/* libstdc++ */
- if (0 == strcmp(frame->function, "__gnu_cxx::__verbose_terminate_handler")
+ if (0 == strcmp(frame->function, "__gnu_cxx::__verbose_terminate_handler")
&& NULL != strstr(frame->sourcefile, "/vterminate.cc"))
return true;
- if (0 == strcmp(frame->function, "__cxxabiv1::__terminate")
+ if (0 == strcmp(frame->function, "__cxxabiv1::__terminate")
&& NULL != strstr(frame->sourcefile, "/eh_terminate.cc"))
return true;
- if (0 == strcmp(frame->function, "std::terminate")
+ if (0 == strcmp(frame->function, "std::terminate")
&& NULL != strstr(frame->sourcefile, "/eh_terminate.cc"))
return true;
- if (0 == strcmp(frame->function, "__cxxabiv1::__cxa_throw")
+ if (0 == strcmp(frame->function, "__cxxabiv1::__cxa_throw")
&& NULL != strstr(frame->sourcefile, "/eh_throw.cc"))
return true;
@@ -259,7 +259,7 @@ static void thread_append_str(struct thread *thread, struct strbuf *str, bool ve
/*
* Checks whether the thread it contains some known "abort" function.
* If a frame with the function is found, it is returned.
- * If there are multiple frames with abort function, the lowest
+ * If there are multiple frames with abort function, the lowest
* one is returned.
* Nonrecursive.
*/
@@ -271,7 +271,7 @@ struct frame *thread_find_abort_frame(struct thread *thread)
{
if (frame_is_abort_frame(frame))
result = frame;
-
+
frame = frame->next;
}
@@ -307,7 +307,7 @@ static void thread_remove_noncrash_frames(struct thread *thread)
{
if (frame_is_noncrash_frame(cur))
{
- /* This frame must be skipped, because it will
+ /* This frame must be skipped, because it will
be deleted. */
if (prev)
prev->next = cur->next;
@@ -316,7 +316,7 @@ static void thread_remove_noncrash_frames(struct thread *thread)
frame_free(cur);
- /* Set cur to be valid, as it will be used to
+ /* Set cur to be valid, as it will be used to
advance to next item. */
if (prev)
cur = prev;
@@ -332,11 +332,11 @@ static void thread_remove_noncrash_frames(struct thread *thread)
}
}
-/* Counts the number of quality frames and the number of all frames
+/* Counts the number of quality frames and the number of all frames
* in a thread.
* @param ok_count
* @param all_count
- * Not zeroed. This function just adds the numbers to
+ * Not zeroed. This function just adds the numbers to
* ok_count and all_count.
*/
static void thread_rating(struct thread *thread, int *ok_count, int *all_count)
@@ -345,7 +345,7 @@ static void thread_rating(struct thread *thread, int *ok_count, int *all_count)
while (frame)
{
*all_count += 1;
- if (frame->signal_handler_called ||
+ if (frame->signal_handler_called ||
(frame->function && 0 != strcmp(frame->function, "??")))
{
*ok_count += 1;
@@ -413,7 +413,7 @@ struct strbuf *backtrace_tree_as_str(struct backtrace *backtrace, bool verbose)
strbuf_append_str(str, "Crash frame: ");
frame_append_str(backtrace->crash, str, verbose);
}
-
+
struct thread *thread = backtrace->threads;
while (thread)
{
@@ -424,7 +424,7 @@ struct strbuf *backtrace_tree_as_str(struct backtrace *backtrace, bool verbose)
return str;
}
-void backtrace_remove_threads_except_one(struct backtrace *backtrace,
+void backtrace_remove_threads_except_one(struct backtrace *backtrace,
struct thread *one)
{
while (backtrace->threads)
@@ -443,7 +443,7 @@ void backtrace_remove_threads_except_one(struct backtrace *backtrace,
* Loop through all threads and if a single one contains the crash frame on the top,
* return it. Otherwise, return NULL.
*
- * If require_abort is true, it is also required that the thread containing
+ * If require_abort is true, it is also required that the thread containing
* the crash frame contains some known "abort" function. In this case there can be
* multiple threads with the crash frame on the top, but only one of them might
* contain the abort function to succeed.
@@ -462,7 +462,7 @@ static struct thread *backtrace_find_crash_thread_from_crash_frame(struct backtr
struct thread *thread = backtrace->threads;
while (thread)
{
- if (thread->frames
+ if (thread->frames
&& thread->frames->function
&& 0 == strcmp(thread->frames->function, backtrace->crash->function)
&& (!require_abort || thread_find_abort_frame(thread)))
@@ -478,7 +478,7 @@ static struct thread *backtrace_find_crash_thread_from_crash_frame(struct backtr
thread = thread->next;
}
-
+
return result;
}
@@ -487,25 +487,25 @@ struct thread *backtrace_find_crash_thread(struct backtrace *backtrace)
/* If there is no thread, be silent and report NULL. */
if (!backtrace->threads)
return NULL;
-
+
/* If there is just one thread, it is simple. */
if (!backtrace->threads->next)
return backtrace->threads;
- /* If we have a crash frame *and* there is just one thread which has
- * this frame on the top, it is also simple.
+ /* If we have a crash frame *and* there is just one thread which has
+ * this frame on the top, it is also simple.
*/
struct thread *thread;
thread = backtrace_find_crash_thread_from_crash_frame(backtrace, false);
if (thread)
return thread;
- /* There are multiple threads with a frame indistinguishable from
+ /* There are multiple threads with a frame indistinguishable from
* the crash frame on the top of stack.
* Try to search for known abort functions.
*/
thread = backtrace_find_crash_thread_from_crash_frame(backtrace, true);
-
+
return thread; /* result or null */
}
@@ -555,7 +555,7 @@ void backtrace_remove_exit_handlers(struct backtrace *backtrace)
{
thread_remove_exit_handlers(thread);
thread = thread->next;
- }
+ }
}
void backtrace_remove_noncrash_frames(struct backtrace *backtrace)
@@ -638,7 +638,7 @@ struct strbuf *independent_backtrace(const char *input)
if (bk[0] == '#'
&& bk[1] >= '0' && bk[1] <= '7'
&& bk[2] == ' ' /* take only #0...#7 (8 last stack frames) */
- && !in_quote)
+ && !in_quote)
{
if (in_header && !has_filename)
strbuf_clear(header);
@@ -702,10 +702,10 @@ struct strbuf *independent_backtrace(const char *input)
has_filename = true;
else if (in_header && !in_digit && !in_quote && !in_bracket)
strbuf_append_char(header, *bk);
-
+
bk++;
}
-
+
strbuf_free(header);
struct strbuf *result = strbuf_new();
@@ -758,7 +758,7 @@ static enum line_rating rate_line(const char *line)
}
/* just a fallback function, to be removed one day */
-int backtrace_rate_old(const char *backtrace)
+int backtrace_rate_old(const char *backtrace)
{
int i, len;
int multiplier = 0;
@@ -777,7 +777,7 @@ int backtrace_rate_old(const char *backtrace)
{
if (backtrace[i] == '#'
&& (backtrace[i+1] >= '0' && backtrace[i+1] <= '9') /* #N */
- && (i == 0 || backtrace[i-1] == '\n')) /* it's at line start */
+ && (i == 0 || backtrace[i-1] == '\n')) /* it's at line start */
{
/* For one, "#0 xxx" always repeats, skip repeats */
if (backtrace[i+1] == last_lvl)
@@ -801,7 +801,7 @@ int backtrace_rate_old(const char *backtrace)
multiplier++;
rating += lrate * multiplier;
best_possible_rating += BestRating * multiplier;
- //log("lrate:%d rating:%d best_possible_rating:%d s:'%-.40s'",
+ //log("lrate:%d rating:%d best_possible_rating:%d s:'%-.40s'",
// lrate, rating, best_possible_rating, s);
free(s);
len = 0; /* starting new line */
diff --git a/lib/Utils/backtrace.h b/lib/Utils/backtrace.h
index dd6d69c2..df5def56 100644
--- a/lib/Utils/backtrace.h
+++ b/lib/Utils/backtrace.h
@@ -1,10 +1,10 @@
/*
Backtrace parsing and processing.
-
- If we transform analyzer plugins to separate applications one day,
- this functionality should be moved to CCpp analyzer, which will
- then easily provide what abrt-backtrace utility provides now. Currently
- the code is used by abrt-backtrace, so it is shared in the utils
+
+ If we transform analyzer plugins to separate applications one day,
+ this functionality should be moved to CCpp analyzer, which will
+ then easily provide what abrt-backtrace utility provides now. Currently
+ the code is used by abrt-backtrace, so it is shared in the utils
library.
Copyright (C) 2009, 2010 RedHat inc.
@@ -57,8 +57,8 @@ struct thread
struct backtrace
{
struct thread *threads;
- /*
- * The frame where the crash happened according to GDB.
+ /*
+ * The frame where the crash happened according to GDB.
* It might be that we can not tell to which thread this frame belongs,
* because all threads end with mutually indistinguishable frames.
*/
@@ -83,16 +83,16 @@ extern void backtrace_print_tree(struct backtrace *backtrace, bool verbose);
/* Returns the backtrace tree string representation. */
extern struct strbuf *backtrace_tree_as_str(struct backtrace *backtrace, bool verbose);
-/*
- * Frees all threads except the one provided as parameters.
+/*
+ * Frees all threads except the one provided as parameters.
* It does not check whether one is a member of backtrace.
* Caller must know that.
*/
-extern void backtrace_remove_threads_except_one(struct backtrace *backtrace,
+extern void backtrace_remove_threads_except_one(struct backtrace *backtrace,
struct thread *one);
-/*
- * Search all threads and tries to find the one that caused the crash.
+/*
+ * Search all threads and tries to find the one that caused the crash.
* It might return NULL if the thread cannot be determined.
*/
extern struct thread *backtrace_find_crash_thread(struct backtrace *backtrace);
@@ -105,24 +105,24 @@ extern void backtrace_limit_frame_depth(struct backtrace *backtrace, int depth);
extern void backtrace_remove_exit_handlers(struct backtrace *backtrace);
/*
- * Removes frames known as not causing crash, but that are often
+ * Removes frames known as not causing crash, but that are often
* a part of a backtrace.
*/
extern void backtrace_remove_noncrash_frames(struct backtrace *backtrace);
/* Parses the backtrace and stores it to a structure.
- * @returns
+ * @returns
* Returns the backtrace struct representation, or NULL if the parser failed.
* Caller of this function is responsible for backtrace_free()ing the returned value.
* Defined in backtrace_parser.y.
*/
extern struct backtrace *backtrace_parse(char *input, bool debug_parser, bool debug_scanner);
-/* Reads the input file and calculates "independent" backtrace from it. "Independent" means
- * that the memory addresses that differ from run to run are removed from the backtrace, and
+/* Reads the input file and calculates "independent" backtrace from it. "Independent" means
+ * that the memory addresses that differ from run to run are removed from the backtrace, and
* also variable names and values are removed.
- *
- * This function can be called when backtrace_parse() call fails. It provides a shorter
+ *
+ * This function can be called when backtrace_parse() call fails. It provides a shorter
* version of backtrace, with a chance that hash calculated from the returned value can be used
* to detect duplicates. However, this kind of duplicate detection is very low-quality.
* @returns
@@ -131,16 +131,16 @@ extern struct backtrace *backtrace_parse(char *input, bool debug_parser, bool de
*/
extern struct strbuf *independent_backtrace(const char *input);
-/* Get the quality of backtrace, as a number of "stars".
+/* Get the quality of backtrace, as a number of "stars".
* @returns
* Value 0 to 4.
*/
extern int backtrace_rate_old(const char *backtrace);
-/* Evaluates the quality of the backtrace, meaning the ratio of frames
+/* Evaluates the quality of the backtrace, meaning the ratio of frames
* with function name fully known to all frames.
* @returns
- * A number between 0 and 1. 0 means the lowest quality,
+ * A number between 0 and 1. 0 means the lowest quality,
* 1 means full backtrace is known.
*/
extern float backtrace_quality(struct backtrace *backtrace);
diff --git a/lib/Utils/backtrace_parser.y b/lib/Utils/backtrace_parser.y
index de81a3eb..8e2fc2b1 100644
--- a/lib/Utils/backtrace_parser.y
+++ b/lib/Utils/backtrace_parser.y
@@ -33,7 +33,7 @@ void yyerror(char const *s)
int yylex();
%}
-
+
/* This defines the type of yylval */
%union {
struct backtrace *backtrace;
@@ -50,35 +50,35 @@ int yylex();
%token END 0 "end of file"
%type <backtrace> backtrace
-%type <thread> threads
+%type <thread> threads
thread
-%type <frame> frames
- frame
- frame_head
- frame_head_1
- frame_head_2
- frame_head_3
- frame_head_4
+%type <frame> frames
+ frame
+ frame_head
+ frame_head_1
+ frame_head_2
+ frame_head_3
+ frame_head_4
frame_head_5
-%type <strbuf> identifier
- hexadecimal_digit_sequence
- hexadecimal_number
- file_name
- file_location
- function_call
- function_name
- digit_sequence
+%type <strbuf> identifier
+ hexadecimal_digit_sequence
+ hexadecimal_number
+ file_name
+ file_location
+ function_call
+ function_name
+ digit_sequence
frame_address_in_function
identifier_braces
identifier_braces_inside
identifier_template
identifier_template_inside
-%type <c> nondigit
- digit
- hexadecimal_digit
- file_name_char
- identifier_char
- identifier_char_no_templates
+%type <c> nondigit
+ digit
+ hexadecimal_digit
+ file_name_char
+ identifier_char
+ identifier_char_no_templates
identifier_first_char
identifier_braces_inside_char
identifier_template_inside_char
@@ -87,12 +87,12 @@ int yylex();
ws
ws_nonl
'(' ')' '+' '-' '/' '.' '_' '~' '[' ']' '\r' '?' '{' '}'
- 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l'
- 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 'u' 'v' 'w' 'x' 'y' 'z'
- 'A' 'B' 'C' 'D' 'E' 'F' 'G' 'H' 'I' 'J' 'K' 'L' 'M' 'N'
- 'O' 'P' 'Q' 'R' 'S' 'T' 'U' 'V' 'W' 'X' 'Y' 'Z'
+ 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l'
+ 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 'u' 'v' 'w' 'x' 'y' 'z'
+ 'A' 'B' 'C' 'D' 'E' 'F' 'G' 'H' 'I' 'J' 'K' 'L' 'M' 'N'
+ 'O' 'P' 'Q' 'R' 'S' 'T' 'U' 'V' 'W' 'X' 'Y' 'Z'
'0' '1' '2' '3' '4' '5' '6' '7' '8' '9'
- '\'' '`' ',' '#' '@' '<' '>' '=' ':' '"' ';' ' '
+ '\'' '`' ',' '#' '@' '<' '>' '=' ':' '"' ';' ' '
'\n' '\t' '\\' '!' '*' '%' '|' '^' '&' '$'
%type <num> frame_start
@@ -107,23 +107,23 @@ int yylex();
%% /* The grammar follows. */
-backtrace : /* empty */ %dprec 1
+backtrace : /* empty */ %dprec 1
{ $$ = g_backtrace = backtrace_new(); }
| threads wsa %dprec 2
- {
- $$ = g_backtrace = backtrace_new();
- $$->threads = $1;
+ {
+ $$ = g_backtrace = backtrace_new();
+ $$->threads = $1;
}
| frame_head wss threads wsa %dprec 4
- {
- $$ = g_backtrace = backtrace_new();
- $$->threads = $3;
+ {
+ $$ = g_backtrace = backtrace_new();
+ $$->threads = $3;
$$->crash = $1;
}
| frame wss threads wsa %dprec 3
- {
- $$ = g_backtrace = backtrace_new();
- $$->threads = $3;
+ {
+ $$ = g_backtrace = backtrace_new();
+ $$->threads = $3;
$$->crash = $1;
}
;
@@ -132,11 +132,11 @@ threads : thread
| threads '\n' thread { $$ = thread_add_sibling($1, $3); }
;
-thread : keyword_thread wss digit_sequence wsa '(' keyword_thread wss digit_sequence wsa ')' ':' wsa frames
- {
- $$ = thread_new();
- $$->frames = $13;
-
+thread : keyword_thread wss digit_sequence wsa '(' keyword_thread wss digit_sequence wsa ')' ':' wsa frames
+ {
+ $$ = thread_new();
+ $$->frames = $13;
+
if (sscanf($3->buf, "%d", &$$->number) != 1)
{
printf("Error while parsing thread number '%s'", $3->buf);
@@ -153,110 +153,110 @@ frames : frame { $$ = $1; }
frame : frame_head_1 wss variables %dprec 3
| frame_head_2 wss variables %dprec 4
- | frame_head_3 wss variables %dprec 5
- | frame_head_4 wss variables %dprec 2
+ | frame_head_3 wss variables %dprec 5
+ | frame_head_4 wss variables %dprec 2
| frame_head_5 wss variables %dprec 1
;
-frame_head : frame_head_1 %dprec 3
- | frame_head_2 %dprec 4
- | frame_head_3 %dprec 5
- | frame_head_4 %dprec 2
+frame_head : frame_head_1 %dprec 3
+ | frame_head_2 %dprec 4
+ | frame_head_3 %dprec 5
+ | frame_head_4 %dprec 2
| frame_head_5 %dprec 1
;
frame_head_1 : frame_start wss function_call wsa keyword_at wss file_location
- {
- $$ = frame_new();
- $$->number = $1;
- $$->function = $3->buf;
- strbuf_free_nobuf($3);
+ {
+ $$ = frame_new();
+ $$->number = $1;
+ $$->function = $3->buf;
+ strbuf_free_nobuf($3);
$$->sourcefile = $7->buf;
- strbuf_free_nobuf($7);
+ strbuf_free_nobuf($7);
}
;
frame_head_2 : frame_start wss frame_address_in_function wss keyword_at wss file_location
- {
- $$ = frame_new();
- $$->number = $1;
- $$->function = $3->buf;
- strbuf_free_nobuf($3);
+ {
+ $$ = frame_new();
+ $$->number = $1;
+ $$->function = $3->buf;
+ strbuf_free_nobuf($3);
$$->sourcefile = $7->buf;
- strbuf_free_nobuf($7);
+ strbuf_free_nobuf($7);
}
;
frame_head_3 : frame_start wss frame_address_in_function wss keyword_from wss file_location
- {
- $$ = frame_new();
- $$->number = $1;
- $$->function = $3->buf;
- strbuf_free_nobuf($3);
+ {
+ $$ = frame_new();
+ $$->number = $1;
+ $$->function = $3->buf;
+ strbuf_free_nobuf($3);
$$->sourcefile = $7->buf;
- strbuf_free_nobuf($7);
+ strbuf_free_nobuf($7);
}
;
frame_head_4 : frame_start wss frame_address_in_function
- {
- $$ = frame_new();
- $$->number = $1;
- $$->function = $3->buf;
- strbuf_free_nobuf($3);
+ {
+ $$ = frame_new();
+ $$->number = $1;
+ $$->function = $3->buf;
+ strbuf_free_nobuf($3);
}
;
frame_head_5 : frame_start wss keyword_sighandler
- {
- $$ = frame_new();
- $$->number = $1;
+ {
+ $$ = frame_new();
+ $$->number = $1;
$$->signal_handler_called = true;
}
-frame_start: '#' digit_sequence
- {
+frame_start: '#' digit_sequence
+ {
if (sscanf($2->buf, "%d", &$$) != 1)
{
printf("Error while parsing frame number '%s'.\n", $2->buf);
exit(5);
}
- strbuf_free($2);
+ strbuf_free($2);
}
;
-frame_address_in_function : hexadecimal_number wss keyword_in wss function_call
+frame_address_in_function : hexadecimal_number wss keyword_in wss function_call
{
- strbuf_free($1);
- $$ = $5;
+ strbuf_free($1);
+ $$ = $5;
}
| hexadecimal_number wss keyword_in wss keyword_vtable wss keyword_for wss function_call
{
- strbuf_free($1);
- $$ = $9;
+ strbuf_free($1);
+ $$ = $9;
}
;
-file_location : file_name ':' digit_sequence
+file_location : file_name ':' digit_sequence
{
- $$ = $1;
+ $$ = $1;
strbuf_free($3); /* line number not needed for now */
}
| file_name
;
variables : variables_line '\n'
- | variables_line END
- | variables_line wss_nonl '\n'
- | variables_line wss_nonl END
- | variables variables_line '\n'
- | variables variables_line END
- | variables variables_line wss_nonl '\n'
- | variables variables_line wss_nonl END
+ | variables_line END
+ | variables_line wss_nonl '\n'
+ | variables_line wss_nonl END
+ | variables variables_line '\n'
+ | variables variables_line END
+ | variables variables_line wss_nonl '\n'
+ | variables variables_line wss_nonl END
| variables wss_nonl variables_line '\n'
- | variables wss_nonl variables_line END
- | variables wss_nonl variables_line wss_nonl '\n'
- | variables wss_nonl variables_line wss_nonl END
+ | variables wss_nonl variables_line END
+ | variables wss_nonl variables_line wss_nonl '\n'
+ | variables wss_nonl variables_line wss_nonl END
;
variables_line : variables_char_no_framestart
@@ -269,10 +269,10 @@ variables_char : '#' | variables_char_no_framestart
/* Manually synchronized with function_args_char_base, except the first line. */
variables_char_no_framestart : digit | nondigit | '"' | '(' | ')' | '\\'
- | '+' | '-' | '<' | '>' | '/' | '.'
- | '[' | ']' | '?' | '\'' | '`' | ','
+ | '+' | '-' | '<' | '>' | '/' | '.'
+ | '[' | ']' | '?' | '\'' | '`' | ','
| '=' | '{' | '}' | '^' | '&' | '$'
- | ':' | ';' | '!' | '@' | '*'
+ | ':' | ';' | '!' | '@' | '*'
| '%' | '|' | '~'
;
@@ -287,10 +287,10 @@ return_type : identifier { strbuf_free($1); }
;
function_name : identifier
- | '?' '?'
- {
- $$ = strbuf_new();
- strbuf_append_str($$, "??");
+ | '?' '?'
+ {
+ $$ = strbuf_new();
+ strbuf_append_str($$, "??");
}
;
@@ -311,13 +311,13 @@ function_args_string : '"' wsa function_args_string_sequence wsa '"'
;
/* Manually synchronized with variables_char_no_framestart,
- * except the first line.
+ * except the first line.
*/
function_args_char_base : digit | nondigit | '#'
- | '+' | '-' | '<' | '>' | '/' | '.'
- | '[' | ']' | '?' | '\'' | '`' | ','
+ | '+' | '-' | '<' | '>' | '/' | '.'
+ | '[' | ']' | '?' | '\'' | '`' | ','
| '=' | '{' | '}' | '^' | '&' | '$'
- | ':' | ';' | '!' | '@' | '*'
+ | ':' | ';' | '!' | '@' | '*'
| '%' | '|' | '~'
;
function_args_escaped_char : '\\' function_args_char_base
@@ -344,42 +344,42 @@ file_name : file_name_char { $$ = strbuf_new(); strbuf_append_char($$, $1); }
file_name_char : digit | nondigit | '-' | '+' | '/' | '.'
;
- /* Function name, sometimes mangled.
+ /* Function name, sometimes mangled.
* Example: something@GLIB_2_2
* CClass::operator=
*/
identifier : identifier_first_char %dprec 1
{
- $$ = strbuf_new();
- strbuf_append_char($$, $1);
+ $$ = strbuf_new();
+ strbuf_append_char($$, $1);
}
| identifier_braces %dprec 1 /* e.g. (anonymous namespace)::WorkerThread */
| identifier identifier_char %dprec 1
{ $$ = strbuf_append_char($1, $2); }
| identifier identifier_braces %dprec 1
- {
- $$ = strbuf_append_str($1, $2->buf);
+ {
+ $$ = strbuf_append_str($1, $2->buf);
strbuf_free($2);
}
| identifier identifier_template %dprec 2
- {
- $$ = strbuf_append_str($1, $2->buf);
+ {
+ $$ = strbuf_append_str($1, $2->buf);
strbuf_free($2);
}
;
-identifier_first_char: nondigit
+identifier_first_char: nondigit
| '~' /* destructor */
| '*'
;
-identifier_char_no_templates : digit | nondigit | '@' | '.' | ':' | '='
+identifier_char_no_templates : digit | nondigit | '@' | '.' | ':' | '='
| '!' | '*' | '+' | '-' | '[' | ']'
| '~' | '&' | '/' | '%' | '^'
| '|' | ','
;
-/* Most of the special characters are required to support C++
+/* Most of the special characters are required to support C++
* operator overloading.
*/
identifier_char : identifier_char_no_templates | '<'| '>'
@@ -391,7 +391,7 @@ identifier_braces : '(' ')'
strbuf_append_char($$, $1);
strbuf_append_char($$, $2);
}
- | '(' identifier_braces_inside ')'
+ | '(' identifier_braces_inside ')'
{
$$ = strbuf_new();
strbuf_append_char($$, $1);
@@ -403,28 +403,28 @@ identifier_braces : '(' ')'
identifier_braces_inside : identifier_braces_inside_char %dprec 1
{
- $$ = strbuf_new();
- strbuf_append_char($$, $1);
- }
+ $$ = strbuf_new();
+ strbuf_append_char($$, $1);
+ }
| identifier_braces_inside identifier_braces_inside_char %dprec 1
{ $$ = strbuf_append_char($1, $2); }
| identifier_braces_inside '(' identifier_braces_inside ')' %dprec 1
- {
- $$ = strbuf_append_char($1, $2);
- $$ = strbuf_append_str($1, $3->buf);
+ {
+ $$ = strbuf_append_char($1, $2);
+ $$ = strbuf_append_str($1, $3->buf);
strbuf_free($3);
- $$ = strbuf_append_char($1, $4);
+ $$ = strbuf_append_char($1, $4);
}
| identifier_braces_inside '(' ')' %dprec 1
- {
- $$ = strbuf_append_char($1, $2);
- $$ = strbuf_append_char($1, $3);
+ {
+ $$ = strbuf_append_char($1, $2);
+ $$ = strbuf_append_char($1, $3);
}
| identifier_braces_inside identifier_template %dprec 2
{
- $$ = strbuf_append_str($1, $2->buf);
+ $$ = strbuf_append_str($1, $2->buf);
strbuf_free($2);
- }
+ }
;
identifier_braces_inside_char : identifier_char | ws_nonl
@@ -442,23 +442,23 @@ identifier_template : '<' identifier_template_inside '>'
identifier_template_inside : identifier_template_inside_char
{
- $$ = strbuf_new();
- strbuf_append_char($$, $1);
- }
+ $$ = strbuf_new();
+ strbuf_append_char($$, $1);
+ }
| identifier_template_inside identifier_template_inside_char
{ $$ = strbuf_append_char($1, $2); }
| identifier_template_inside '<' identifier_template_inside '>'
- {
- $$ = strbuf_append_char($1, $2);
- $$ = strbuf_append_str($1, $3->buf);
+ {
+ $$ = strbuf_append_char($1, $2);
+ $$ = strbuf_append_str($1, $3->buf);
strbuf_free($3);
- $$ = strbuf_append_char($1, $4);
+ $$ = strbuf_append_char($1, $4);
}
| identifier_template_inside identifier_braces
{
- $$ = strbuf_append_str($1, $2->buf);
+ $$ = strbuf_append_str($1, $2->buf);
strbuf_free($2);
- }
+ }
;
identifier_template_inside_char : identifier_char_no_templates | ws_nonl
@@ -468,24 +468,24 @@ digit_sequence : digit { $$ = strbuf_new(); strbuf_append_char($$, $1); }
| digit_sequence digit { $$ = strbuf_append_char($1, $2); }
;
-hexadecimal_number : '0' 'x' hexadecimal_digit_sequence
- {
+hexadecimal_number : '0' 'x' hexadecimal_digit_sequence
+ {
$$ = $3;
- strbuf_prepend_str($$, "0x");
+ strbuf_prepend_str($$, "0x");
}
- | '0' 'X' hexadecimal_digit_sequence
- {
+ | '0' 'X' hexadecimal_digit_sequence
+ {
$$ = $3;
- strbuf_prepend_str($$, "0X");
+ strbuf_prepend_str($$, "0X");
}
;
-hexadecimal_digit_sequence : hexadecimal_digit
- {
- $$ = strbuf_new();
- strbuf_append_char($$, $1);
+hexadecimal_digit_sequence : hexadecimal_digit
+ {
+ $$ = strbuf_new();
+ strbuf_append_char($$, $1);
}
- | hexadecimal_digit_sequence hexadecimal_digit
+ | hexadecimal_digit_sequence hexadecimal_digit
{ $$ = strbuf_append_char($1, $2); }
;
@@ -499,7 +499,7 @@ digit : '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'
nondigit : 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'h' | 'i' | 'j' | 'k'
| 'l' | 'm' | 'n' | 'o' | 'p' | 'q' | 'r' | 's' | 't' | 'u' | 'v' | 'w'
- | 'x' | 'y' | 'z'
+ | 'x' | 'y' | 'z'
| 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G' | 'H' | 'I' | 'J' | 'K'
| 'L' | 'M' | 'N' | 'O' | 'P' | 'Q' | 'R' | 'S' | 'T' | 'U' | 'V' | 'W'
| 'X' | 'Y' | 'Z'
@@ -523,9 +523,9 @@ wss_nonl : ws_nonl
wss : ws
| wss ws
;
-
+
/* whitespace sequence allowed */
-wsa :
+wsa :
| wss
;
@@ -572,7 +572,7 @@ int yylex()
return c;
}
-/* This is the function that is actually called from outside.
+/* This is the function that is actually called from outside.
* @returns
* Backtrace structure. Caller is responsible for calling
* backtrace_free() on this.
@@ -622,15 +622,15 @@ struct backtrace *backtrace_parse(char *input, bool debug_parser, bool debug_sca
* RuntimeError: Cannot access memory at address 0x11
*
* __PRETTY_FUNCTION__ = "sync_deletions"
- * #2 0x0000000000423e6b in refresh_folder (stub=0x1b77f10 [MailStubExchange],
+ * #2 0x0000000000423e6b in refresh_folder (stub=0x1b77f10 [MailStubExchange],
* ...
*
* The code removes every empty line (also those containing only spaces),
* which is not followed by a new Thread section.
- *
+ *
* rhbz#555251 contains empty lines with spaces
*/
- char *empty_line = btnoheader;
+ char *empty_line = btnoheader;
char *c = btnoheader;
while (*c)
{
@@ -649,7 +649,7 @@ struct backtrace *backtrace_parse(char *input, bool debug_parser, bool debug_sca
if (0 != strncmp(empty_line, "\n\nThread", strlen("\n\nThread")))
{
/* Remove the empty line by converting the first newline to char. */
- empty_line[0] = 'X';
+ empty_line[0] = 'X';
}
++empty_line;
}
@@ -665,10 +665,10 @@ struct backtrace *backtrace_parse(char *input, bool debug_parser, bool debug_sca
/* Parse. */
int failure = yyparse();
-
+
/* Separate debugging output. */
if (scanner_echo)
- putchar('\n');
+ putchar('\n');
if (failure)
{
diff --git a/lib/Utils/strbuf.c b/lib/Utils/strbuf.c
index 6153ffe1..ab872543 100644
--- a/lib/Utils/strbuf.c
+++ b/lib/Utils/strbuf.c
@@ -63,7 +63,7 @@ static void strbuf_grow(struct strbuf *strbuf, int num)
{
while (strbuf->len + num + 1 > strbuf->alloc)
strbuf->alloc *= 2; /* huge grow = infinite loop */
-
+
strbuf->buf = realloc(strbuf->buf, strbuf->alloc);
if (!strbuf->buf)
{
@@ -105,11 +105,11 @@ struct strbuf *strbuf_append_strf(struct strbuf *strbuf, const char *format, ...
{
va_list p;
char *string_ptr;
-
+
va_start(p, format);
string_ptr = xvasprintf(format, p);
va_end(p);
-
+
strbuf_append_str(strbuf, string_ptr);
free(string_ptr);
return strbuf;
@@ -119,11 +119,11 @@ struct strbuf *strbuf_prepend_strf(struct strbuf *strbuf, const char *format, ..
{
va_list p;
char *string_ptr;
-
+
va_start(p, format);
string_ptr = xvasprintf(format, p);
va_end(p);
-
+
strbuf_prepend_str(strbuf, string_ptr);
free(string_ptr);
return strbuf;