void connect_to_next_event ();
+ void disable_event_localization () { m_localize_events = false; }
+
private:
auto_delete_vec<simple_diagnostic_thread> m_threads;
auto_delete_vec<simple_diagnostic_event> m_events;
/* (for use by add_event). */
pretty_printer *m_event_pp;
+ bool m_localize_events;
};
extern void debug (diagnostic_path *path);
/* class simple_diagnostic_path : public diagnostic_path. */
simple_diagnostic_path::simple_diagnostic_path (pretty_printer *event_pp)
- : m_event_pp (event_pp)
+: m_event_pp (event_pp),
+ m_localize_events (true)
{
add_thread ("main");
}
stack depth DEPTH.
Use m_context's printer to format FMT, as the text of the new
- event.
+ event. Localize FMT iff m_localize_events is set.
Return the id of the new event. */
va_start (ap, fmt);
- text_info ti (_(fmt), &ap, 0, nullptr, &rich_loc);
+ text_info ti (m_localize_events ? _(fmt) : fmt,
+ &ap, 0, nullptr, &rich_loc);
pp_format (pp, &ti);
pp_output_formatted_text (pp);
}
/* A subclass of simple_diagnostic_path that adds member functions
- for adding test events. */
+ for adding test events and suppresses translation of these events. */
class test_diagnostic_path : public simple_diagnostic_path
{
test_diagnostic_path (pretty_printer *event_pp)
: simple_diagnostic_path (event_pp)
{
+ disable_event_localization ();
}
void add_entry (tree fndecl, int stack_depth)