aboutsummaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
Diffstat (limited to 'src/client')
-rw-r--r--src/client/mac/handler/dynamic_images.cc15
-rw-r--r--src/client/mac/handler/dynamic_images.h15
-rw-r--r--src/client/mac/handler/minidump_generator.cc2
-rw-r--r--src/client/minidump_file_writer-inl.h3
-rw-r--r--src/client/minidump_file_writer.h2
5 files changed, 20 insertions, 17 deletions
diff --git a/src/client/mac/handler/dynamic_images.cc b/src/client/mac/handler/dynamic_images.cc
index e2a9d485..32a57e82 100644
--- a/src/client/mac/handler/dynamic_images.cc
+++ b/src/client/mac/handler/dynamic_images.cc
@@ -104,6 +104,19 @@ void DynamicImage::CalculateMemoryInfo() {
slide_ = 0;
}
+void DynamicImage::Print() {
+ const char *path = GetFilePath();
+ if (!path) {
+ path = "(unknown)";
+ }
+ printf("%p: %s\n", GetLoadAddress(), path);
+ mach_header *header = GetMachHeader();
+ MachHeader(*header).Print();
+ printf("vmaddr\t\t: %p\n", reinterpret_cast<void*>(GetVMAddr()));
+ printf("vmsize\t\t: %d\n", GetVMSize());
+ printf("slide\t\t: %d\n", GetVMAddrSlide());
+}
+
#pragma mark -
//==============================================================================
@@ -123,7 +136,7 @@ void DynamicImages::ReadImageInfoForTask() {
// which lives in "dyld". This structure contains information about all
// of the loaded dynamic images.
struct nlist &list = l[0];
- list.n_un.n_name = "_dyld_all_image_infos";
+ list.n_un.n_name = const_cast<char *>("_dyld_all_image_infos");
nlist("/usr/lib/dyld", &list);
if (list.n_value) {
diff --git a/src/client/mac/handler/dynamic_images.h b/src/client/mac/handler/dynamic_images.h
index 2242899c..497f4eb4 100644
--- a/src/client/mac/handler/dynamic_images.h
+++ b/src/client/mac/handler/dynamic_images.h
@@ -147,19 +147,8 @@ class DynamicImage {
}
// Debugging
- void Print() {
- char *path = GetFilePath();
- if (!path) {
- path = "(unknown)";
- }
- printf("%p: %s\n", GetLoadAddress(), path);
- mach_header *header = GetMachHeader();
- MachHeader(*header).Print();
- printf("vmaddr\t\t: %p\n", reinterpret_cast<void*>(GetVMAddr()));
- printf("vmsize\t\t: %d\n", GetVMSize());
- printf("slide\t\t: %d\n", GetVMAddrSlide());
- }
-
+ void Print();
+
private:
friend class DynamicImages;
diff --git a/src/client/mac/handler/minidump_generator.cc b/src/client/mac/handler/minidump_generator.cc
index e9f1974b..11a770ee 100644
--- a/src/client/mac/handler/minidump_generator.cc
+++ b/src/client/mac/handler/minidump_generator.cc
@@ -594,7 +594,7 @@ bool MinidumpGenerator::WriteCVRecord(MDRawModule *module, int cpu_type,
TypedMDRVA<MDCVInfoPDB70> cv(&writer_);
// Only return the last path component of the full module path
- char *module_name = strrchr(module_path, '/');
+ const char *module_name = strrchr(module_path, '/');
// Increment past the slash
if (module_name)
diff --git a/src/client/minidump_file_writer-inl.h b/src/client/minidump_file_writer-inl.h
index 98958be0..4505b4f2 100644
--- a/src/client/minidump_file_writer-inl.h
+++ b/src/client/minidump_file_writer-inl.h
@@ -76,7 +76,8 @@ inline bool TypedMDRVA<MDType>::CopyIndex(unsigned int index, MDType *item) {
template<typename MDType>
inline bool TypedMDRVA<MDType>::CopyIndexAfterObject(unsigned int index,
- void *src, size_t size) {
+ const void *src,
+ size_t size) {
assert(allocation_state_ == SINGLE_OBJECT_WITH_ARRAY);
return writer_->Copy(position_ + sizeof(MDType) + index * size, src, size);
}
diff --git a/src/client/minidump_file_writer.h b/src/client/minidump_file_writer.h
index 9747c7dc..39fc90b8 100644
--- a/src/client/minidump_file_writer.h
+++ b/src/client/minidump_file_writer.h
@@ -228,7 +228,7 @@ class TypedMDRVA : public UntypedMDRVA {
// Copy |size| bytes starting at |str| to |index|
// Must have been allocated using AllocateObjectAndArray().
// Return true on success, or false on failure
- bool CopyIndexAfterObject(unsigned int index, void *src, size_t size);
+ bool CopyIndexAfterObject(unsigned int index, const void *src, size_t size);
// Write data_
bool Flush();