1/*
2 * Copyright 2019 WebAssembly Community Group participants
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17//
18// Comprehensive debug info support (beyond source maps).
19//
20
21#ifndef wasm_wasm_debug_h
22#define wasm_wasm_debug_h
23
24#include <string>
25
26#include "pass.h"
27#include "wasm.h"
28
29namespace wasm::Debug {
30
31bool isDWARFSection(Name name);
32
33bool hasDWARFSections(const Module& wasm);
34
35// Dump the DWARF sections to stdout.
36void dumpDWARF(const Module& wasm);
37
38// Check whether we should preserve valid DWARF while optimizing. (If so, we
39// will disable optimizations that currently cause issues with debug info.)
40bool shouldPreserveDWARF(PassOptions& options, Module& wasm);
41
42// Update the DWARF sections.
43void writeDWARFSections(Module& wasm, const BinaryLocations& newLocations);
44
45} // namespace wasm::Debug
46
47#undef DEBUG_TYPE
48
49#endif // wasm_wasm_debug_h
50

source code of dart_sdk/third_party/binaryen/src/src/wasm-debug.h