/*
- * Copyright 2016-2017 - Philippe Proulx <pproulx@efficios.com>
+ * SPDX-License-Identifier: MIT
*
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
+ * Copyright 2016-2017 Philippe Proulx <pproulx@efficios.com>
*/
#define BT_COMP_LOG_SELF_COMP (mdec->config.self_comp)
#include "decoder.h"
#include "scanner.h"
#include "logging.h"
+#include "parser-wrap.h"
#define TSDL_MAGIC 0x75d11d57
-extern
-int yydebug;
-
struct ctf_metadata_decoder {
struct ctf_scanner *scanner;
GString *text;
}
}
+#if YYDEBUG
if (BT_LOG_ON_TRACE) {
yydebug = 1;
}
+#endif
/* Save the file's position: we'll seek back to append the plain text */
BT_ASSERT(fp);
}
end:
+#if YYDEBUG
yydebug = 0;
+#endif
if (fp && close_fp) {
if (fclose(fp)) {
bt_trace_class *ctf_metadata_decoder_get_ir_trace_class(
struct ctf_metadata_decoder *mdec)
{
- BT_ASSERT(mdec);
- BT_ASSERT(mdec->config.create_trace_class);
+ BT_ASSERT_DBG(mdec);
+ BT_ASSERT_DBG(mdec->config.create_trace_class);
return ctf_visitor_generate_ir_get_ir_trace_class(mdec->visitor);
}
struct ctf_trace_class *ctf_metadata_decoder_borrow_ctf_trace_class(
struct ctf_metadata_decoder *mdec)
{
- BT_ASSERT(mdec);
- BT_ASSERT(mdec->config.create_trace_class);
+ BT_ASSERT_DBG(mdec);
+ BT_ASSERT_DBG(mdec->config.create_trace_class);
return ctf_visitor_generate_ir_borrow_ctf_trace_class(mdec->visitor);
}
BT_HIDDEN
const char *ctf_metadata_decoder_get_text(struct ctf_metadata_decoder *mdec)
{
- BT_ASSERT(mdec);
- BT_ASSERT(mdec->config.keep_plain_text);
+ BT_ASSERT_DBG(mdec);
+ BT_ASSERT_DBG(mdec->config.keep_plain_text);
return mdec->text->str;
}
BT_HIDDEN
int ctf_metadata_decoder_get_byte_order(struct ctf_metadata_decoder *mdec)
{
- BT_ASSERT(mdec);
+ BT_ASSERT_DBG(mdec);
return mdec->bo;
}
{
int ret = 0;
- BT_ASSERT(mdec);
+ BT_ASSERT_DBG(mdec);
if (!mdec->is_uuid_set) {
ret = -1;