summaryrefslogtreecommitdiffstats
path: root/lib/btparser
diff options
context:
space:
mode:
authorKarel Klic <kklic@redhat.com>2011-01-31 19:25:09 +0100
committerKarel Klic <kklic@redhat.com>2011-01-31 19:25:09 +0100
commiteae37635056583abad4a3d2aebb70ef8ea9ec22f (patch)
treebb5b1123369cda1604220710743b5d7c59d96d2d /lib/btparser
parente3a4e103cee4f2f0392813d9803239c7d136ea24 (diff)
downloadabrt-eae37635056583abad4a3d2aebb70ef8ea9ec22f.tar.gz
abrt-eae37635056583abad4a3d2aebb70ef8ea9ec22f.tar.xz
abrt-eae37635056583abad4a3d2aebb70ef8ea9ec22f.zip
New supported format of thread header "Thread 8 (Thread 0xb07fdb70 (LWP 6357)):"
Diffstat (limited to 'lib/btparser')
-rw-r--r--lib/btparser/thread.c33
1 files changed, 31 insertions, 2 deletions
diff --git a/lib/btparser/thread.c b/lib/btparser/thread.c
index af480eb3..4d52a9d4 100644
--- a/lib/btparser/thread.c
+++ b/lib/btparser/thread.c
@@ -313,8 +313,15 @@ btp_thread_parse(char **input,
return NULL;
}
- /* Read the thread identification number. */
- digits = btp_skip_unsigned_integer(&local_input);
+ /* Read the thread identification number. It can be either in
+ * decimal or hexadecimal form.
+ * Examples:
+ * "Thread 10 (Thread 2476):"
+ * "Thread 8 (Thread 0xb07fdb70 (LWP 6357)):"
+ */
+ digits = btp_skip_hexadecimal_number(&local_input);
+ if (0 == digits)
+ digits = btp_skip_unsigned_integer(&local_input);
location->column += digits;
if (0 == digits)
{
@@ -323,6 +330,28 @@ btp_thread_parse(char **input,
return NULL;
}
+ /* Handle the optional " (LWP [0-9]+)" section. */
+ chars = btp_skip_string(&local_input, " (LWP ");
+ if (0 < chars)
+ {
+ location->column += chars;
+ digits = btp_skip_unsigned_integer(&local_input);
+ if (0 == digits)
+ {
+ location->message = "The LWP number expected.";
+ btp_thread_free(imthread);
+ return NULL;
+ }
+ location->column += digits;
+ if (!btp_skip_char(&local_input, ')'))
+ {
+ location->message = "Closing parenthesis for LWP expected.";
+ btp_thread_free(imthread);
+ return NULL;
+ }
+ location->column += 1;
+ }
+
/* Read the end of the parenthesis. */
chars = btp_skip_string(&local_input, "):\n");
if (0 == chars)