mirror of
https://git.suyu.dev/suyu/breakpad.git
synced 2026-01-07 23:18:14 +01:00
Allow compiling the google-breakpad code using a global ::string class instead of std::string.
For more details take a look at common/using_std_string.h BUG= Change-Id: Ifebfc57f691ef3a3bef8cfed7106c567985edffc Reviewed-on: https://chromium-review.googlesource.com/399738 Reviewed-by: Mark Mentovai <mark@chromium.org>
This commit is contained in:
parent
1f574b52c6
commit
2f6cb866d6
11 changed files with 16 additions and 15 deletions
|
|
@ -19,8 +19,8 @@
|
|||
#include <vector>
|
||||
|
||||
#include "common/dwarf/types.h"
|
||||
#include "common/using_std_string.h"
|
||||
|
||||
using std::string;
|
||||
using std::vector;
|
||||
using std::pair;
|
||||
|
||||
|
|
|
|||
|
|
@ -195,7 +195,7 @@ void DwarfCFIToModule::Record(Module::Address address, int reg,
|
|||
|
||||
// Place the name in our global set of strings, and then use the string
|
||||
// from the set. Even though the assignment looks like a copy, all the
|
||||
// major std::string implementations use reference counting internally,
|
||||
// major string implementations use reference counting internally,
|
||||
// so the effect is to have all our data structures share copies of rules
|
||||
// whenever possible. Since register names are drawn from a
|
||||
// vector<string>, register names are already shared.
|
||||
|
|
|
|||
|
|
@ -181,7 +181,7 @@ class DwarfCFIToModule: public CallFrameInfo::Handler {
|
|||
|
||||
// The names of the return address and canonical frame address. Putting
|
||||
// these here instead of using string literals allows us to share their
|
||||
// texts in reference-counted std::string implementations (all the
|
||||
// texts in reference-counted string implementations (all the
|
||||
// popular ones). Many, many rules cite these strings.
|
||||
string cfa_name_, ra_name_;
|
||||
|
||||
|
|
@ -189,7 +189,7 @@ class DwarfCFIToModule: public CallFrameInfo::Handler {
|
|||
// our data structures, insert it into this set, and then use the string
|
||||
// from the set.
|
||||
//
|
||||
// Because std::string uses reference counting internally, simply using
|
||||
// Because string uses reference counting internally, simply using
|
||||
// strings from this set, even if passed by value, assigned, or held
|
||||
// directly in structures and containers (map<string, ...>, for example),
|
||||
// causes those strings to share a single instance of each distinct piece
|
||||
|
|
|
|||
|
|
@ -261,7 +261,7 @@ class DwarfCUToModule::GenericDIEHandler: public dwarf2reader::DIEHandler {
|
|||
uint64 offset_;
|
||||
|
||||
// Place the name in the global set of strings. Even though this looks
|
||||
// like a copy, all the major std::string implementations use reference
|
||||
// like a copy, all the major string implementations use reference
|
||||
// counting internally, so the effect is to have all the data structures
|
||||
// share copies of strings whenever possible.
|
||||
// FIXME: Should this return something like a string_ref to avoid the
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ class CPPLanguage: public Language {
|
|||
}
|
||||
|
||||
virtual DemangleResult DemangleName(const string& mangled,
|
||||
std::string* demangled) const {
|
||||
string* demangled) const {
|
||||
#if defined(__ANDROID__)
|
||||
// Android NDK doesn't provide abi::__cxa_demangle.
|
||||
demangled->clear();
|
||||
|
|
@ -127,7 +127,7 @@ class SwiftLanguage: public Language {
|
|||
}
|
||||
|
||||
virtual DemangleResult DemangleName(const string& mangled,
|
||||
std::string* demangled) const {
|
||||
string* demangled) const {
|
||||
// There is no programmatic interface to a Swift demangler. Pass through the
|
||||
// mangled form because it encodes more information than the qualified name
|
||||
// that would have been built by MakeQualifiedName(). The output can be
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ class Language {
|
|||
|
||||
// Wraps abi::__cxa_demangle() or similar for languages where appropriate.
|
||||
virtual DemangleResult DemangleName(const string& mangled,
|
||||
std::string* demangled) const {
|
||||
string* demangled) const {
|
||||
demangled->clear();
|
||||
return kDontDemangle;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@
|
|||
|
||||
#include "common/linux/guid_creator.h"
|
||||
#include "common/memory.h"
|
||||
#include "common/using_std_string.h"
|
||||
|
||||
namespace google_breakpad {
|
||||
|
||||
|
|
@ -70,16 +71,16 @@ class FileID {
|
|||
// Convert the |identifier| data to a string. The string will
|
||||
// be formatted as a UUID in all uppercase without dashes.
|
||||
// (e.g., 22F065BBFC9C49F780FE26A7CEBD7BCE).
|
||||
static std::string ConvertIdentifierToUUIDString(
|
||||
static string ConvertIdentifierToUUIDString(
|
||||
const wasteful_vector<uint8_t>& identifier);
|
||||
|
||||
// Convert the entire |identifier| data to a hex string.
|
||||
static std::string ConvertIdentifierToString(
|
||||
static string ConvertIdentifierToString(
|
||||
const wasteful_vector<uint8_t>& identifier);
|
||||
|
||||
private:
|
||||
// Storage for the path specified
|
||||
std::string path_;
|
||||
string path_;
|
||||
};
|
||||
|
||||
} // namespace google_breakpad
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue