summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorDenys Vlasenko <dvlasenk@redhat.com>2011-02-10 15:26:57 +0100
committerDenys Vlasenko <dvlasenk@redhat.com>2011-02-10 15:26:57 +0100
commit2ff1d396e701a56cd796828f83a51059b7bad9ba (patch)
tree8c68b16da565b4994094ed6f216df6cbabd5659a /doc
parent8aad7520c23d90962bfd5fd430aa1a1e72d11f26 (diff)
downloadabrt-2ff1d396e701a56cd796828f83a51059b7bad9ba.tar.gz
abrt-2ff1d396e701a56cd796828f83a51059b7bad9ba.tar.xz
abrt-2ff1d396e701a56cd796828f83a51059b7bad9ba.zip
added doc/TODO_crash_dump_fields
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/TODO_crash_dump_fields49
1 files changed, 49 insertions, 0 deletions
diff --git a/doc/TODO_crash_dump_fields b/doc/TODO_crash_dump_fields
new file mode 100644
index 00000000..7a8407fb
--- /dev/null
+++ b/doc/TODO_crash_dump_fields
@@ -0,0 +1,49 @@
+ Planned changes to crash_data and dump_dir structures
+
+ Time field(s)
+
+Need to add CD_FLAG_UNIXTIME bit for struct crash_item's flags field.
+It should be set on cd["time"] item when we do
+
+ cd = call create_crash_data_from_dump_dir(dd);
+
+Note that later we may add other elements beside "time" which contain
+unix time.
+
+Need to add a function which formats time elements for printing.
+Something like this:
+
+const char *printable_form_of_crash_item(const char *content, unsigned flags);
+
+For most fields it should return them as-is, for CD_FLAG_UNIXTIME
+fields it should return malloced "YYYY-MM-DD hh:mm:ss" string.
+
+Later, if/when we will get more CD_FLAG_FOO flags, some of them also
+may need special formatting, and this function can deal with them too.
+
+[Implementation note: use the following trick to avoid needing to return
+malloced data (which isn't convenient for caller, it needs to free it):
+
+printable_form_of_crash_item(...)
+{
+ ...
+ if (need to use malloced string)
+ {
+ s = malloc_and_format_string();
+
+ static unsigned malloced_idx = 0;
+ static char *malloced_vec[8];
+
+ malloced_idx = (malloced_idx+1) % 8;
+ free(malloced_vec[malloced_idx]);
+ malloced_vec[malloced_idx] = s;
+ }
+ else
+ s = some_non_malloced_string;
+ ...
+ return s;
+}
+]
+
+dd_load_text_ext(dd, "time", flags) may benefit from a new flag DD_LOAD_TEXT_PRINTABLE,
+which makes it generate printable representation of fields.