Make compiler/debug/ symbols hidden.
And mark required symbols with EXPORT.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Change-Id: I8efec9299bdd6becf625e7a59c75cbaf053eadb9
diff --git a/compiler/debug/debug_info.h b/compiler/debug/debug_info.h
index 04c6991..4027f11 100644
--- a/compiler/debug/debug_info.h
+++ b/compiler/debug/debug_info.h
@@ -20,9 +20,10 @@
#include <map>
#include "base/array_ref.h"
+#include "base/macros.h"
#include "method_debug_info.h"
-namespace art {
+namespace art HIDDEN {
class DexFile;
namespace debug {
diff --git a/compiler/debug/dwarf/dwarf_test.cc b/compiler/debug/dwarf/dwarf_test.cc
index 8897e45..14c92b2 100644
--- a/compiler/debug/dwarf/dwarf_test.cc
+++ b/compiler/debug/dwarf/dwarf_test.cc
@@ -23,7 +23,7 @@
#include "dwarf/headers.h"
#include "gtest/gtest.h"
-namespace art {
+namespace art HIDDEN {
namespace dwarf {
// Run the tests only on host since we need objdump.
diff --git a/compiler/debug/dwarf/dwarf_test.h b/compiler/debug/dwarf/dwarf_test.h
index bad986a..1a0a798 100644
--- a/compiler/debug/dwarf/dwarf_test.h
+++ b/compiler/debug/dwarf/dwarf_test.h
@@ -26,6 +26,7 @@
#include <set>
#include <string>
+#include "base/macros.h"
#include "base/os.h"
#include "base/unix_file/fd_file.h"
#include "common_compiler_test.h"
@@ -33,7 +34,7 @@
#include "gtest/gtest.h"
#include "stream/file_output_stream.h"
-namespace art {
+namespace art HIDDEN {
namespace dwarf {
#define DW_CHECK(substring) Check(substring, false, __FILE__, __LINE__)
diff --git a/compiler/debug/elf_compilation_unit.h b/compiler/debug/elf_compilation_unit.h
index b1d89eb..1d7523c 100644
--- a/compiler/debug/elf_compilation_unit.h
+++ b/compiler/debug/elf_compilation_unit.h
@@ -19,9 +19,10 @@
#include <vector>
+#include "base/macros.h"
#include "debug/method_debug_info.h"
-namespace art {
+namespace art HIDDEN {
namespace debug {
struct ElfCompilationUnit {
diff --git a/compiler/debug/elf_debug_frame_writer.h b/compiler/debug/elf_debug_frame_writer.h
index 269e3c6..6b72262 100644
--- a/compiler/debug/elf_debug_frame_writer.h
+++ b/compiler/debug/elf_debug_frame_writer.h
@@ -20,13 +20,14 @@
#include <vector>
#include "arch/instruction_set.h"
+#include "base/macros.h"
#include "debug/method_debug_info.h"
#include "dwarf/debug_frame_opcode_writer.h"
#include "dwarf/dwarf_constants.h"
#include "dwarf/headers.h"
#include "elf/elf_builder.h"
-namespace art {
+namespace art HIDDEN {
namespace debug {
static constexpr bool kWriteDebugFrameHdr = false;
diff --git a/compiler/debug/elf_debug_info_writer.h b/compiler/debug/elf_debug_info_writer.h
index 04981aa..9915a24 100644
--- a/compiler/debug/elf_debug_info_writer.h
+++ b/compiler/debug/elf_debug_info_writer.h
@@ -22,6 +22,7 @@
#include <vector>
#include "art_field-inl.h"
+#include "base/macros.h"
#include "debug/elf_compilation_unit.h"
#include "debug/elf_debug_loc_writer.h"
#include "debug/method_debug_info.h"
@@ -39,7 +40,7 @@
#include "oat_file.h"
#include "obj_ptr-inl.h"
-namespace art {
+namespace art HIDDEN {
namespace debug {
static std::vector<const char*> GetParamNames(const MethodDebugInfo* mi) {
diff --git a/compiler/debug/elf_debug_line_writer.h b/compiler/debug/elf_debug_line_writer.h
index 7df301a..4896bc1 100644
--- a/compiler/debug/elf_debug_line_writer.h
+++ b/compiler/debug/elf_debug_line_writer.h
@@ -20,6 +20,7 @@
#include <unordered_set>
#include <vector>
+#include "base/macros.h"
#include "debug/elf_compilation_unit.h"
#include "debug/src_map_elem.h"
#include "dex/dex_file-inl.h"
@@ -29,7 +30,7 @@
#include "oat_file.h"
#include "stack_map.h"
-namespace art {
+namespace art HIDDEN {
namespace debug {
using PositionInfos = std::vector<DexFile::PositionInfo>;
diff --git a/compiler/debug/elf_debug_loc_writer.h b/compiler/debug/elf_debug_loc_writer.h
index 3742081..8cf476e 100644
--- a/compiler/debug/elf_debug_loc_writer.h
+++ b/compiler/debug/elf_debug_loc_writer.h
@@ -21,12 +21,13 @@
#include <map>
#include "arch/instruction_set.h"
+#include "base/macros.h"
#include "debug/method_debug_info.h"
#include "dwarf/debug_info_entry_writer.h"
#include "dwarf/register.h"
#include "stack_map.h"
-namespace art {
+namespace art HIDDEN {
namespace debug {
using Reg = dwarf::Reg;
diff --git a/compiler/debug/elf_debug_writer.cc b/compiler/debug/elf_debug_writer.cc
index d8007c0..8f64d73 100644
--- a/compiler/debug/elf_debug_writer.cc
+++ b/compiler/debug/elf_debug_writer.cc
@@ -38,7 +38,7 @@
#include "oat.h"
#include "stream/vector_output_stream.h"
-namespace art {
+namespace art HIDDEN {
namespace debug {
using ElfRuntimeTypes = std::conditional<sizeof(void*) == 4, ElfTypes32, ElfTypes64>::type;
diff --git a/compiler/debug/elf_debug_writer.h b/compiler/debug/elf_debug_writer.h
index 1ce3c6f..72b028c 100644
--- a/compiler/debug/elf_debug_writer.h
+++ b/compiler/debug/elf_debug_writer.h
@@ -27,7 +27,7 @@
#include "dwarf/dwarf_constants.h"
#include "elf/elf_builder.h"
-namespace art {
+namespace art HIDDEN {
class OatHeader;
struct JITCodeEntry;
namespace mirror {
@@ -37,11 +37,11 @@
struct MethodDebugInfo;
template <typename ElfTypes>
-void WriteDebugInfo(
+EXPORT void WriteDebugInfo(
ElfBuilder<ElfTypes>* builder,
const DebugInfo& debug_info);
-std::vector<uint8_t> MakeMiniDebugInfo(
+EXPORT std::vector<uint8_t> MakeMiniDebugInfo(
InstructionSet isa,
const InstructionSetFeatures* features,
uint64_t text_section_address,
diff --git a/compiler/debug/elf_symtab_writer.h b/compiler/debug/elf_symtab_writer.h
index d2acd64..fcd6696 100644
--- a/compiler/debug/elf_symtab_writer.h
+++ b/compiler/debug/elf_symtab_writer.h
@@ -21,6 +21,7 @@
#include <unordered_set>
#include <unordered_map>
+#include "base/macros.h"
#include "base/utils.h"
#include "debug/debug_info.h"
#include "debug/method_debug_info.h"
@@ -29,7 +30,7 @@
#include "dex/dex_file-inl.h"
#include "elf/elf_builder.h"
-namespace art {
+namespace art HIDDEN {
namespace debug {
// The ARM specification defines three special mapping symbols
diff --git a/compiler/debug/method_debug_info.h b/compiler/debug/method_debug_info.h
index 152db6e..b83c6e2 100644
--- a/compiler/debug/method_debug_info.h
+++ b/compiler/debug/method_debug_info.h
@@ -21,9 +21,10 @@
#include "arch/instruction_set.h"
#include "base/array_ref.h"
+#include "base/macros.h"
#include "dex/dex_file.h"
-namespace art {
+namespace art HIDDEN {
namespace debug {
struct MethodDebugInfo {
diff --git a/compiler/debug/src_map_elem.h b/compiler/debug/src_map_elem.h
index 5286b8c..646a1f0 100644
--- a/compiler/debug/src_map_elem.h
+++ b/compiler/debug/src_map_elem.h
@@ -19,7 +19,9 @@
#include <stdint.h>
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
class SrcMapElem {
public:
diff --git a/compiler/debug/src_map_elem_test.cc b/compiler/debug/src_map_elem_test.cc
index ceaa53f..bdbafd5 100644
--- a/compiler/debug/src_map_elem_test.cc
+++ b/compiler/debug/src_map_elem_test.cc
@@ -20,7 +20,7 @@
#include "base/macros.h"
-namespace art {
+namespace art HIDDEN {
namespace debug {
TEST(SrcMapElem, Operators) {