Flutter Engine
The Flutter Engine
report.h
Go to the documentation of this file.
1// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2// for details. All rights reserved. Use of this source code is governed by a
3// BSD-style license that can be found in the LICENSE file.
4
5#ifndef RUNTIME_VM_REPORT_H_
6#define RUNTIME_VM_REPORT_H_
7
8#include "vm/allocation.h"
9#include "vm/tagged_pointer.h"
10#include "vm/token_position.h"
11
12namespace dart {
13
14// Forward declarations.
15class Error;
16class ICData;
17class Script;
18class StackFrame;
19class String;
20
22 public:
23 enum Kind {
27 };
28
29 static constexpr bool AtLocation = false;
30 static constexpr bool AfterLocation = true;
31
32 // Report an already formatted error via a long jump.
33 DART_NORETURN static void LongJump(const Error& error);
34
35 // Concatenate and report an already formatted error and a new error message.
36 DART_NORETURN static void LongJumpF(const Error& prev_error,
37 const Script& script,
38 TokenPosition token_pos,
39 const char* format,
40 ...) PRINTF_ATTRIBUTE(4, 5);
41 DART_NORETURN static void LongJumpV(const Error& prev_error,
42 const Script& script,
43 TokenPosition token_pos,
44 const char* format,
45 va_list args);
46
47 // Report a warning/jswarning/error/bailout message.
48 static void MessageF(Kind kind,
49 const Script& script,
50 TokenPosition token_pos,
51 bool report_after_token,
52 const char* format,
53 ...) PRINTF_ATTRIBUTE(5, 6);
54 static void MessageV(Kind kind,
55 const Script& script,
56 TokenPosition token_pos,
57 bool report_after_token,
58 const char* format,
59 va_list args);
60
61 // Prepend a source snippet to the message.
62 // A null script means no source and a negative token_pos means no position.
63 static StringPtr PrependSnippet(Kind kind,
64 const Script& script,
65 TokenPosition token_pos,
66 bool report_after_token,
67 const String& message);
68
69 private:
70 DISALLOW_COPY_AND_ASSIGN(Report);
71};
72
73} // namespace dart
74
75#endif // RUNTIME_VM_REPORT_H_
static void static void MessageV(Kind kind, const Script &script, TokenPosition token_pos, bool report_after_token, const char *format, va_list args)
Definition: report.cc:135
static DART_NORETURN void LongJump(const Error &error)
Definition: report.cc:86
static DART_NORETURN void LongJumpF(const Error &prev_error, const Script &script, TokenPosition token_pos, const char *format,...) PRINTF_ATTRIBUTE(4
Definition: report.cc:91
static constexpr bool AfterLocation
Definition: report.h:30
static void MessageF(Kind kind, const Script &script, TokenPosition token_pos, bool report_after_token, const char *format,...) PRINTF_ATTRIBUTE(5
Definition: report.cc:123
static DART_NORETURN void static DART_NORETURN void LongJumpV(const Error &prev_error, const Script &script, TokenPosition token_pos, const char *format, va_list args)
Definition: report.cc:103
@ kBailout
Definition: report.h:26
@ kWarning
Definition: report.h:24
static constexpr bool AtLocation
Definition: report.h:29
static StringPtr PrependSnippet(Kind kind, const Script &script, TokenPosition token_pos, bool report_after_token, const String &message)
Definition: report.cc:20
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
const uint8_t uint32_t uint32_t GError ** error
uint32_t uint32_t * format
Win32Message message
Definition: dart_vm.cc:33
#define PRINTF_ATTRIBUTE(string_index, first_to_check)
Definition: globals.h:697