summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmdline/cmdline_parser_test.cc2
-rw-r--r--cmdline/cmdline_types.h6
-rw-r--r--compiler/debug/elf_symtab_writer.h2
-rw-r--r--dex2oat/linker/oat_writer.cc8
-rw-r--r--runtime/Android.bp12
-rw-r--r--runtime/dexopt_test.cc4
-rw-r--r--runtime/gc/heap.cc4
-rw-r--r--runtime/native_stack_dump.cc12
-rw-r--r--runtime/ti/agent.cc7
9 files changed, 30 insertions, 27 deletions
diff --git a/cmdline/cmdline_parser_test.cc b/cmdline/cmdline_parser_test.cc
index 5d672061df..70cc07eff0 100644
--- a/cmdline/cmdline_parser_test.cc
+++ b/cmdline/cmdline_parser_test.cc
@@ -375,7 +375,7 @@ TEST_F(CmdlineParserTest, TestJdwpProviderEmpty) {
TEST_F(CmdlineParserTest, TestJdwpProviderDefault) {
const char* opt_args = "-XjdwpProvider:default";
- EXPECT_SINGLE_PARSE_VALUE(JdwpProvider::kInternal, opt_args, M::JdwpProvider);
+ EXPECT_SINGLE_PARSE_VALUE(JdwpProvider::kAdbConnection, opt_args, M::JdwpProvider);
} // TEST_F
TEST_F(CmdlineParserTest, TestJdwpProviderInternal) {
diff --git a/cmdline/cmdline_types.h b/cmdline/cmdline_types.h
index d0d6bfd3ce..2bc7409bb6 100644
--- a/cmdline/cmdline_types.h
+++ b/cmdline/cmdline_types.h
@@ -77,10 +77,10 @@ struct CmdlineType<JdwpProvider> : CmdlineTypeParser<JdwpProvider> {
"Example: -XjdwpProvider:internal for internal jdwp implementation\n"
"Example: -XjdwpProvider:adbconnection for adb connection mediated jdwp implementation\n"
"Example: -XjdwpProvider:default for the default jdwp implementation"
- " (currently internal)\n");
- } else if (option == "internal" || option == "default") {
+ " (currently adbconnection)\n");
+ } else if (option == "internal") {
return Result::Success(JdwpProvider::kInternal);
- } else if (option == "adbconnection") {
+ } else if (option == "adbconnection" || option == "default") {
return Result::Success(JdwpProvider::kAdbConnection);
} else if (option == "none") {
return Result::Success(JdwpProvider::kNone);
diff --git a/compiler/debug/elf_symtab_writer.h b/compiler/debug/elf_symtab_writer.h
index 9007360d01..a853714d2b 100644
--- a/compiler/debug/elf_symtab_writer.h
+++ b/compiler/debug/elf_symtab_writer.h
@@ -108,7 +108,7 @@ static void WriteDebugSymbols(linker::ElfBuilder<ElfTypes>* builder,
uint64_t dex_address = dex->GetAddress() + it.first /* offset within the section */;
const DexFile* dex_file = it.second;
typename ElfTypes::Word dex_name = strtab->Write(kDexFileSymbolName);
- symtab->Add(dex_name, dex, dex_address, dex_file->Size(), STB_LOCAL, STT_NOTYPE);
+ symtab->Add(dex_name, dex, dex_address, dex_file->Size(), STB_GLOBAL, STT_FUNC);
if (mini_debug_info) {
continue; // Don't add interpreter method names to mini-debug-info for now.
}
diff --git a/dex2oat/linker/oat_writer.cc b/dex2oat/linker/oat_writer.cc
index 44493283db..849887c8ff 100644
--- a/dex2oat/linker/oat_writer.cc
+++ b/dex2oat/linker/oat_writer.cc
@@ -4220,9 +4220,11 @@ debug::DebugInfo OatWriter::GetDebugInfo() const {
debug::DebugInfo debug_info{};
debug_info.compiled_methods = ArrayRef<const debug::MethodDebugInfo>(method_info_);
if (dex_files_ != nullptr) {
- for (auto dex_file : *dex_files_) {
- uint32_t offset = vdex_dex_files_offset_ + (dex_file->Begin() - (*dex_files_)[0]->Begin());
- debug_info.dex_files.emplace(offset, dex_file);
+ DCHECK_EQ(dex_files_->size(), oat_dex_files_.size());
+ for (size_t i = 0, size = dex_files_->size(); i != size; ++i) {
+ const DexFile* dex_file = (*dex_files_)[i];
+ const OatDexFile& oat_dex_file = oat_dex_files_[i];
+ debug_info.dex_files.emplace(oat_dex_file.dex_file_offset_, dex_file);
}
}
return debug_info;
diff --git a/runtime/Android.bp b/runtime/Android.bp
index e30a06c0a5..07764b8151 100644
--- a/runtime/Android.bp
+++ b/runtime/Android.bp
@@ -67,8 +67,13 @@ cc_defaults {
"liblog",
// For common macros.
"libbase",
+ "libz",
],
- export_include_dirs: ["."],
+
+ // Exporting "." would shadow the system elf.h with our elf.h,
+ // which in turn breaks any tools that reference this library.
+ // export_include_dirs: ["."],
+
// ART's macros.h depends on libbase's macros.h.
// Note: runtime_options.h depends on cmdline. But we don't really want to export this
// generically. dex2oat takes care of it itself.
@@ -78,11 +83,6 @@ cc_defaults {
art_cc_library {
name: "libdexfile",
defaults: ["libdexfile_defaults"],
- vendor_available: true,
- vndk: {
- enabled: true,
- support_system_process: true,
- },
// Leave the symbols in the shared library so that stack unwinders can
// produce meaningful name resolution.
strip: {
diff --git a/runtime/dexopt_test.cc b/runtime/dexopt_test.cc
index d93d76793f..037d1fb49c 100644
--- a/runtime/dexopt_test.cc
+++ b/runtime/dexopt_test.cc
@@ -213,8 +213,8 @@ void DexoptTest::ReserveImageSpace() {
// Ensure a chunk of memory is reserved for the image space.
// The reservation_end includes room for the main space that has to come
// right after the image in case of the GSS collector.
- uintptr_t reservation_start = ART_BASE_ADDRESS;
- uintptr_t reservation_end = ART_BASE_ADDRESS + 384 * MB;
+ uint64_t reservation_start = ART_BASE_ADDRESS;
+ uint64_t reservation_end = ART_BASE_ADDRESS + 384 * MB;
std::unique_ptr<BacktraceMap> map(BacktraceMap::Create(getpid(), true));
ASSERT_TRUE(map.get() != nullptr) << "Failed to build process map";
diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc
index 6da092c365..b1932d1a29 100644
--- a/runtime/gc/heap.cc
+++ b/runtime/gc/heap.cc
@@ -3484,10 +3484,8 @@ void Heap::GrowForUtilization(collector::GarbageCollector* collector_ran,
const uint64_t bytes_allocated_during_gc = bytes_allocated + freed_bytes -
bytes_allocated_before_gc;
// Calculate when to perform the next ConcurrentGC.
- // Calculate the estimated GC duration.
- const double gc_duration_seconds = NsToMs(current_gc_iteration_.GetDurationNs()) / 1000.0;
// Estimate how many remaining bytes we will have when we need to start the next GC.
- size_t remaining_bytes = bytes_allocated_during_gc * gc_duration_seconds;
+ size_t remaining_bytes = bytes_allocated_during_gc;
remaining_bytes = std::min(remaining_bytes, kMaxConcurrentRemainingBytes);
remaining_bytes = std::max(remaining_bytes, kMinConcurrentRemainingBytes);
if (UNLIKELY(remaining_bytes > max_allowed_footprint_)) {
diff --git a/runtime/native_stack_dump.cc b/runtime/native_stack_dump.cc
index fa46709422..2fef70b2ae 100644
--- a/runtime/native_stack_dump.cc
+++ b/runtime/native_stack_dump.cc
@@ -333,15 +333,15 @@ void DumpNativeStack(std::ostream& os,
os << prefix << StringPrintf("#%02zu pc ", it->num);
bool try_addr2line = false;
if (!BacktraceMap::IsValid(it->map)) {
- os << StringPrintf(Is64BitInstructionSet(kRuntimeISA) ? "%016" PRIxPTR " ???"
- : "%08" PRIxPTR " ???",
+ os << StringPrintf(Is64BitInstructionSet(kRuntimeISA) ? "%016" PRIx64 " ???"
+ : "%08" PRIx64 " ???",
it->pc);
} else {
- os << StringPrintf(Is64BitInstructionSet(kRuntimeISA) ? "%016" PRIxPTR " "
- : "%08" PRIxPTR " ",
+ os << StringPrintf(Is64BitInstructionSet(kRuntimeISA) ? "%016" PRIx64 " "
+ : "%08" PRIx64 " ",
it->rel_pc);
if (it->map.name.empty()) {
- os << StringPrintf("<anonymous:%" PRIxPTR ">", it->map.start);
+ os << StringPrintf("<anonymous:%" PRIx64 ">", it->map.start);
} else {
os << it->map.name;
}
@@ -361,7 +361,7 @@ void DumpNativeStack(std::ostream& os,
PcIsWithinQuickCode(current_method, it->pc)) {
const void* start_of_code = current_method->GetEntryPointFromQuickCompiledCode();
os << current_method->JniLongName() << "+"
- << (it->pc - reinterpret_cast<uintptr_t>(start_of_code));
+ << (it->pc - reinterpret_cast<uint64_t>(start_of_code));
} else {
os << "???";
}
diff --git a/runtime/ti/agent.cc b/runtime/ti/agent.cc
index 62bdde6790..15c514e593 100644
--- a/runtime/ti/agent.cc
+++ b/runtime/ti/agent.cc
@@ -117,15 +117,18 @@ std::unique_ptr<Agent> AgentSpec::DoDlOpen(JNIEnv* env,
: JavaVMExt::GetLibrarySearchPath(env, class_loader));
bool needs_native_bridge = false;
+ std::string nativeloader_error_msg;
void* dlopen_handle = android::OpenNativeLibrary(env,
Runtime::Current()->GetTargetSdkVersion(),
name_.c_str(),
class_loader,
library_path.get(),
&needs_native_bridge,
- error_msg);
+ &nativeloader_error_msg);
if (dlopen_handle == nullptr) {
- *error_msg = StringPrintf("Unable to dlopen %s: %s", name_.c_str(), dlerror());
+ *error_msg = StringPrintf("Unable to dlopen %s: %s",
+ name_.c_str(),
+ nativeloader_error_msg.c_str());
*error = kLoadingError;
return nullptr;
}