summaryrefslogtreecommitdiffstats
path: root/src/Backtrace
diff options
context:
space:
mode:
authorKarel Klic <kklic@redhat.com>2009-11-26 10:34:39 +0100
committerKarel Klic <kklic@redhat.com>2009-11-26 10:34:39 +0100
commit3189f5f1dec5b19e24af444230859358eb45d742 (patch)
treebcde9c9790bdb11a172581a8bd33c7cd172566e4 /src/Backtrace
parentc885d01dd06b0119ab0f784e64e72ce3f94d6882 (diff)
downloadabrt-3189f5f1dec5b19e24af444230859358eb45d742.tar.gz
abrt-3189f5f1dec5b19e24af444230859358eb45d742.tar.xz
abrt-3189f5f1dec5b19e24af444230859358eb45d742.zip
Support more corner cases in the parser. Added more broken backtraces.
Diffstat (limited to 'src/Backtrace')
-rwxr-xr-xsrc/Backtrace/abrt-bz-downloader3
-rw-r--r--src/Backtrace/parser.y124
2 files changed, 103 insertions, 24 deletions
diff --git a/src/Backtrace/abrt-bz-downloader b/src/Backtrace/abrt-bz-downloader
index 2e21ab51..f68fa005 100755
--- a/src/Backtrace/abrt-bz-downloader
+++ b/src/Backtrace/abrt-bz-downloader
@@ -58,7 +58,8 @@ for buginfo in buginfos:
523793, 523798, 523847, 523863,
523866, 523890, 523994, 524088, 524128, 524294,
524322,
- 524341, 524700, 524715, 525094, 525674 ]
+ 524341, 524700, 524715, 525094, 525674,
+ 539374, 539378, 539422, 539440, 539452 ]
if buginfo.bug_id in broken_backtrace_bugs:
continue
diff --git a/src/Backtrace/parser.y b/src/Backtrace/parser.y
index b2dade69..e2131344 100644
--- a/src/Backtrace/parser.y
+++ b/src/Backtrace/parser.y
@@ -49,19 +49,44 @@ void yyerror(char const *s)
%token END 0 "end of file"
%type <backtrace> backtrace
-%type <thread> threads thread
-%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 frame_address_in_function
-%type <c> nondigit digit hexadecimal_digit file_name_char
- '(' ')' '+' '-' '/' '.' '_' '~'
- '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
+%type <thread> threads
+ thread
+%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
+ frame_address_in_function
+ identifier_braces
+ identifier_braces_inside
+%type <c> nondigit
+ digit
+ hexadecimal_digit
+ file_name_char
+ identifier_char
+ identifier_braces_inside_char
+ ws
+ ws_nonl
+ '(' ')' '+' '-' '/' '.' '_' '~' '[' ']'
+ '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
%destructor { thread_free($$); } <thread>
%destructor { frame_free($$); } <frame>
@@ -236,7 +261,7 @@ variables_char_no_framestart : digit | nondigit | '"' | '(' | ')'
| '%' | '|' | '~'
;
-function_call : function_name wsa function_args
+function_call : function_name wss function_args
;
function_name : identifier
@@ -275,8 +300,7 @@ function_args_char : digit | nondigit | '#'
function_args_string_sequence : function_args_string_char
| function_args_string_sequence function_args_string_char
- | function_args_string_sequence '\t' function_args_string_char
- | function_args_string_sequence ' ' function_args_string_char
+ | function_args_string_sequence wss_nonl function_args_string_char
;
function_args_string_char : function_args_char | '(' | ')'
@@ -290,13 +314,67 @@ file_name : file_name_char { $$ = strbuf_new(); strbuf_append_char($$, $1); }
file_name_char : digit | nondigit | '-' | '+' | '/' | '.'
;
- /* Mangled function name. */
-identifier : nondigit { $$ = strbuf_new(); strbuf_append_char($$, $1); }
- | identifier nondigit { $$ = strbuf_append_char($1, $2); }
- | identifier digit { $$ = strbuf_append_char($1, $2); }
- | identifier '@' { $$ = strbuf_append_char($1, $2); }
- | identifier '.' { $$ = strbuf_append_char($1, $2); }
- | identifier ':' { $$ = strbuf_append_char($1, $2); }
+ /* Function name, sometimes mangled.
+ * Example: something@GLIB_2_2
+ * CClass::operator=
+ */
+identifier : nondigit
+ {
+ $$ = strbuf_new();
+ strbuf_append_char($$, $1);
+ }
+ | identifier_braces /* e.g. (anonymous namespace)::WorkerThread */
+ | identifier identifier_char
+ { $$ = strbuf_append_char($1, $2); }
+ | identifier identifier_braces
+ {
+ $$ = strbuf_append_str($1, $2->buf);
+ strbuf_free($2);
+ }
+;
+
+/* Most of the special characters are required to support C++
+ * operator overloading.
+ */
+identifier_char : digit | nondigit | '@' | '.' | ':' | '='
+ | '!' | '>' | '<' | '*' | '+' | '-' | '[' | ']'
+ | '~' | '&' | '/' | '%' | '^'
+ | '|' | ','
+;
+
+identifier_braces : '(' ')'
+ {
+ $$ = strbuf_new();
+ strbuf_append_char($$, $1);
+ strbuf_append_char($$, $2);
+ }
+ | '(' identifier_braces_inside ')'
+ {
+ $$ = strbuf_new();
+ strbuf_append_char($$, $1);
+ strbuf_append_str($$, $2->buf);
+ strbuf_free($2);
+ strbuf_append_char($$, $3);
+ }
+;
+
+identifier_braces_inside : identifier_braces_inside_char
+ {
+ $$ = strbuf_new();
+ strbuf_append_char($$, $1);
+ }
+ | identifier_braces_inside identifier_braces_inside_char
+ { $$ = strbuf_append_char($1, $2); }
+ | identifier_braces_inside '(' identifier_braces_inside ')'
+ {
+ $$ = strbuf_append_char($1, $2);
+ $$ = strbuf_append_str($1, $3->buf);
+ strbuf_free($3);
+ $$ = strbuf_append_char($1, $4);
+ }
+;
+
+identifier_braces_inside_char : identifier_char | ws_nonl
;
digit_sequence : digit { $$ = strbuf_new(); strbuf_append_char($$, $1); }