diff options
author | Denys Vlasenko <dvlasenk@redhat.com> | 2010-11-15 15:29:24 +0100 |
---|---|---|
committer | Denys Vlasenko <dvlasenk@redhat.com> | 2010-11-15 15:29:24 +0100 |
commit | 2cf0d770b66b6c6ce50af2767f575db552cd784c (patch) | |
tree | 56ba70257c94add690ddaa8b0ec961c6964a146e /src/include/crash_types.h | |
parent | 2169959c6ba2d77512b8b39366a4d3e476931b4a (diff) | |
download | abrt-2cf0d770b66b6c6ce50af2767f575db552cd784c.tar.gz abrt-2cf0d770b66b6c6ce50af2767f575db552cd784c.tar.xz abrt-2cf0d770b66b6c6ce50af2767f575db552cd784c.zip |
move inc/ and lib/ to src/. No code changes
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'src/include/crash_types.h')
-rw-r--r-- | src/include/crash_types.h | 133 |
1 files changed, 133 insertions, 0 deletions
diff --git a/src/include/crash_types.h b/src/include/crash_types.h new file mode 100644 index 00000000..de9f7bf2 --- /dev/null +++ b/src/include/crash_types.h @@ -0,0 +1,133 @@ +/* + Copyright (C) 2009 Abrt team. + Copyright (C) 2009 RedHat inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ +#ifndef CRASHTYPES_H_ +#define CRASHTYPES_H_ + +#include "abrt_types.h" + +// Keep in sync with CCDump.py: + +// Filenames in dump directory: +// filled by a hook: +#define FILENAME_ANALYZER "analyzer" +#define FILENAME_EXECUTABLE "executable" +#define FILENAME_BINARY "binary" +#define FILENAME_CMDLINE "cmdline" +#define FILENAME_REASON "reason" +#define FILENAME_COREDUMP "coredump" +#define FILENAME_BACKTRACE "backtrace" +#define FILENAME_MEMORYMAP "memorymap" +#define FILENAME_DUPHASH "global_uuid" /* name is compat, to be renamed to "duphash" */ +// Name of the function where the application crashed. +// Optional. +#define FILENAME_CRASH_FUNCTION "crash_function" +// filled by CDebugDump::Create() (which also fills CD_UID): +#define FILENAME_ARCHITECTURE "architecture" +#define FILENAME_KERNEL "kernel" +#define FILENAME_TIME "time" +#define FILENAME_RELEASE "release" /* from /etc/redhat-release */ +// filled by <what?> +#define FILENAME_PACKAGE "package" +#define FILENAME_COMPONENT "component" +#define FILENAME_DESCRIPTION "description" /* package descr (not crash descr) */ +#define FILENAME_COMMENT "comment" +#define FILENAME_REPRODUCE "reproduce" +#define FILENAME_RATING "rating" +#define FILENAME_HOSTNAME "hostname" +// Optional. Set to "1" by abrt-handle-upload for every unpacked crashdump +#define FILENAME_REMOTE "remote" +// TODO: TicketUploader also has open-coded "TICKET", "CUSTOMER" files + +// Apart from CD_UID, which is also stored as a file in dump directory, +// these items only exist in db. (CD_UID is also a file because +// dump directory is created before its DB entry, and DB has to learn +// CD_UID from _somewhere_ in order to be able to store it in DB record, +// right?) +#define CD_UID "uid" +// Now uuid also is saved as a file (but is still stored in database too): +#define CD_UUID "uuid" +#define CD_INFORMALL "InformAll" +#define CD_DUMPDIR "DumpDir" +#define CD_COUNT "Count" +#define CD_REPORTED "Reported" +#define CD_MESSAGE "Message" +// "Which events are possible (make sense) on this crash dump?" +// (a string with "\n" terminated event names) +#define CD_EVENTS "Events" + + +// Crash data is a map of 3-element vectors of strings: type, editable, content +#define CD_TYPE 0 +#define CD_EDITABLE 1 +#define CD_CONTENT 2 + +// SYS - system value, should not be displayed +// BIN - binary data +// TXT - text data, can be displayed +#define CD_SYS "s" +#define CD_BIN "b" +#define CD_TXT "t" +// Text bigger than this usually is attached, not added inline +#define CD_TEXT_ATT_SIZE (2*1024) + +#define CD_ISEDITABLE "y" +#define CD_ISNOTEDITABLE "n" + + +#ifdef __cplusplus +extern "C" { +#endif + +extern const char *const must_have_files[]; + +bool is_editable_file(const char *file_name); + +#ifdef __cplusplus +} +#endif + + +#ifdef __cplusplus + +// <key, data> +typedef map_vector_string_t map_crash_data_t; +typedef std::vector<map_crash_data_t> vector_map_crash_data_t; + +void add_to_crash_data_ext(map_crash_data_t& pCrashData, + const char *pItem, + const char *pType, + const char *pEditable, + const char *pContent); +// Uses type:CD_TXT, editable:CD_ISNOTEDITABLE +void add_to_crash_data(map_crash_data_t& pCrashData, + const char *pItem, + const char *pContent); + +void load_crash_data_from_debug_dump(struct dump_dir *dd, map_crash_data_t& data); + +const char *get_crash_data_item_content_or_NULL(const map_crash_data_t& crash_data, const char *key); +// Aborts if key is not found: +const std::string& get_crash_data_item_content(const map_crash_data_t& crash_data, const char *key); + +void log_map_crash_data(const map_crash_data_t& data, const char *name); + +#endif /* __cplusplus */ + + +#endif |