summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2015-07-24 22:09:28 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-07-24 22:09:28 +0000
commit3263c26a2d0a9560881ab22c0101b0bf91b0bff6 (patch)
tree3c2ec75f35787920f11912c936d419edd0df0a74
parentcf5ec1c15a50a00a5b28f98e0bca8c9a5f97d326 (diff)
parent458a7c7aba37bf41e40862046846fa77046ac23c (diff)
downloadandroid_art-3263c26a2d0a9560881ab22c0101b0bf91b0bff6.tar.gz
android_art-3263c26a2d0a9560881ab22c0101b0bf91b0bff6.tar.bz2
android_art-3263c26a2d0a9560881ab22c0101b0bf91b0bff6.zip
am 458a7c7a: Merge "ART: Change the stack dump format to be in line with debuggerd" into mnc-dev
* commit '458a7c7aba37bf41e40862046846fa77046ac23c': ART: Change the stack dump format to be in line with debuggerd
-rw-r--r--runtime/parsed_options.cc3
-rw-r--r--runtime/runtime.cc2
-rw-r--r--runtime/runtime.h8
-rw-r--r--runtime/runtime_options.def1
-rw-r--r--runtime/signal_catcher.cc7
-rw-r--r--runtime/utils.cc8
6 files changed, 25 insertions, 4 deletions
diff --git a/runtime/parsed_options.cc b/runtime/parsed_options.cc
index 0bc834f67b..a7b45752c8 100644
--- a/runtime/parsed_options.cc
+++ b/runtime/parsed_options.cc
@@ -260,6 +260,9 @@ std::unique_ptr<RuntimeParser> ParsedOptions::MakeParser(bool ignore_unrecognize
.Define("--cpu-abilist=_")
.WithType<std::string>()
.IntoKey(M::CpuAbiList)
+ .Define("-Xfingerprint:_")
+ .WithType<std::string>()
+ .IntoKey(M::Fingerprint)
.Ignore({
"-ea", "-da", "-enableassertions", "-disableassertions", "--runtime-arg", "-esa",
"-dsa", "-enablesystemassertions", "-disablesystemassertions", "-Xrs", "-Xint:_",
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index 1453e9f367..93f66ec30e 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -838,6 +838,8 @@ bool Runtime::Init(const RuntimeOptions& raw_options, bool ignore_unrecognized)
Split(runtime_options.GetOrDefault(Opt::CpuAbiList), ',', &cpu_abilist_);
+ fingerprint_ = runtime_options.ReleaseOrDefault(Opt::Fingerprint);
+
if (runtime_options.GetOrDefault(Opt::Interpret)) {
GetInstrumentation()->ForceInterpretOnly();
}
diff --git a/runtime/runtime.h b/runtime/runtime.h
index e569333bf0..72ae9a1680 100644
--- a/runtime/runtime.h
+++ b/runtime/runtime.h
@@ -548,6 +548,11 @@ class Runtime {
return method_ref_string_init_reg_map_;
}
+ // Returns the build fingerprint, if set. Otherwise an empty string is returned.
+ std::string GetFingerprint() {
+ return fingerprint_;
+ }
+
private:
static void InitPlatformSignalHandlers();
@@ -729,6 +734,9 @@ class Runtime {
MethodRefToStringInitRegMap method_ref_string_init_reg_map_;
+ // Contains the build fingerprint, if given as a parameter.
+ std::string fingerprint_;
+
DISALLOW_COPY_AND_ASSIGN(Runtime);
};
std::ostream& operator<<(std::ostream& os, const Runtime::CalleeSaveType& rhs);
diff --git a/runtime/runtime_options.def b/runtime/runtime_options.def
index 8b504c1334..8154236573 100644
--- a/runtime/runtime_options.def
+++ b/runtime/runtime_options.def
@@ -122,5 +122,6 @@ RUNTIME_OPTIONS_KEY (void (*)(int32_t status), \
RUNTIME_OPTIONS_KEY (void (*)(), HookAbort, nullptr)
RUNTIME_OPTIONS_KEY (unsigned int, ZygoteMaxFailedBoots, 10)
RUNTIME_OPTIONS_KEY (Unit, NoDexFileFallback)
+RUNTIME_OPTIONS_KEY (std::string, Fingerprint)
#undef RUNTIME_OPTIONS_KEY
diff --git a/runtime/signal_catcher.cc b/runtime/signal_catcher.cc
index 9f8c55c980..6cb795061d 100644
--- a/runtime/signal_catcher.cc
+++ b/runtime/signal_catcher.cc
@@ -133,8 +133,11 @@ void SignalCatcher::HandleSigQuit() {
DumpCmdLine(os);
- // Note: The string "ABI:" is chosen to match the format used by debuggerd.
- os << "ABI: " << GetInstructionSetString(runtime->GetInstructionSet()) << "\n";
+ // Note: The strings "Build fingerprint:" and "ABI:" are chosen to match the format used by
+ // debuggerd. This allows, for example, the stack tool to work.
+ std::string fingerprint = runtime->GetFingerprint();
+ os << "Build fingerprint: '" << (fingerprint.empty() ? "unknown" : fingerprint) << "'\n";
+ os << "ABI: '" << GetInstructionSetString(runtime->GetInstructionSet()) << "'\n";
os << "Build type: " << (kIsDebugBuild ? "debug" : "optimized") << "\n";
diff --git a/runtime/utils.cc b/runtime/utils.cc
index 4923342e8e..80938cea18 100644
--- a/runtime/utils.cc
+++ b/runtime/utils.cc
@@ -1130,9 +1130,13 @@ void DumpNativeStack(std::ostream& os, pid_t tid, const char* prefix,
os << prefix << StringPrintf("#%02zu pc ", it->num);
bool try_addr2line = false;
if (!BacktraceMap::IsValid(it->map)) {
- os << StringPrintf("%08" PRIxPTR " ???", it->pc);
+ os << StringPrintf(Is64BitInstructionSet(kRuntimeISA) ? "%016" PRIxPTR " ???"
+ : "%08" PRIxPTR " ???",
+ it->pc);
} else {
- os << StringPrintf("%08" PRIxPTR " ", BacktraceMap::GetRelativePc(it->map, it->pc));
+ os << StringPrintf(Is64BitInstructionSet(kRuntimeISA) ? "%016" PRIxPTR " "
+ : "%08" PRIxPTR " ",
+ BacktraceMap::GetRelativePc(it->map, it->pc));
os << it->map.name;
os << " (";
if (!it->func_name.empty()) {