mirror of
https://github.com/yuzu-emu/breakpad.git
synced 2025-07-08 11:10:45 +00:00
Fix some compilation warnings and other errors due to API changes
Review URL: http://breakpad.appspot.com/305002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@841 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
parent
742e915661
commit
9dfe692010
|
@ -189,10 +189,10 @@ int __breakpad_fdnlist(int fd, nlist_type *list, const char **symbolNames,
|
||||||
|
|
||||||
struct exec buf;
|
struct exec buf;
|
||||||
if (read(fd, (char *)&buf, sizeof(buf)) != sizeof(buf) ||
|
if (read(fd, (char *)&buf, sizeof(buf)) != sizeof(buf) ||
|
||||||
(N_BADMAG(buf) && *((long *)&buf) != magic &&
|
(N_BADMAG(buf) && *((uint32_t *)&buf) != magic &&
|
||||||
NXSwapBigLongToHost(*((long *)&buf)) != FAT_MAGIC) &&
|
NXSwapBigLongToHost(*((long *)&buf)) != FAT_MAGIC) &&
|
||||||
/* The following is the big-endian ppc64 check */
|
/* The following is the big-endian ppc64 check */
|
||||||
(*((long*)&buf)) != FAT_MAGIC) {
|
(*((uint32_t*)&buf)) != FAT_MAGIC) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -232,7 +232,7 @@ int __breakpad_fdnlist(int fd, nlist_type *list, const char **symbolNames,
|
||||||
}
|
}
|
||||||
if (read(fd, (char *)fat_archs,
|
if (read(fd, (char *)fat_archs,
|
||||||
sizeof(struct fat_arch) * fh.nfat_arch) !=
|
sizeof(struct fat_arch) * fh.nfat_arch) !=
|
||||||
(ssize_t)sizeof(struct fat_arch) * fh.nfat_arch) {
|
(ssize_t)(sizeof(struct fat_arch) * fh.nfat_arch)) {
|
||||||
free(fat_archs);
|
free(fat_archs);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -296,7 +296,7 @@ int __breakpad_fdnlist(int fd, nlist_type *list, const char **symbolNames,
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (read(fd, (char *)load_commands, mh.sizeofcmds) !=
|
if (read(fd, (char *)load_commands, mh.sizeofcmds) !=
|
||||||
mh.sizeofcmds) {
|
(ssize_t)mh.sizeofcmds) {
|
||||||
free(load_commands);
|
free(load_commands);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -304,7 +304,7 @@ int __breakpad_fdnlist(int fd, nlist_type *list, const char **symbolNames,
|
||||||
struct load_command *lcp = load_commands;
|
struct load_command *lcp = load_commands;
|
||||||
// iterate through all load commands, looking for
|
// iterate through all load commands, looking for
|
||||||
// LC_SYMTAB load command
|
// LC_SYMTAB load command
|
||||||
for (long i = 0; i < mh.ncmds; i++) {
|
for (uint32_t i = 0; i < mh.ncmds; i++) {
|
||||||
if (lcp->cmdsize % sizeof(word_type) != 0 ||
|
if (lcp->cmdsize % sizeof(word_type) != 0 ||
|
||||||
lcp->cmdsize <= 0 ||
|
lcp->cmdsize <= 0 ||
|
||||||
(char *)lcp + lcp->cmdsize >
|
(char *)lcp + lcp->cmdsize >
|
||||||
|
|
|
@ -55,21 +55,17 @@ void DynamicImagesTests::ReadTaskMemoryTest() {
|
||||||
// pick test2 as a symbol we know to be valid to read
|
// pick test2 as a symbol we know to be valid to read
|
||||||
// anything will work, really
|
// anything will work, really
|
||||||
void *addr = reinterpret_cast<void*>(&test2);
|
void *addr = reinterpret_cast<void*>(&test2);
|
||||||
void *buf;
|
std::vector<uint8_t> buf(getpagesize());
|
||||||
|
|
||||||
fprintf(stderr, "reading 0x%p\n", addr);
|
fprintf(stderr, "reading 0x%p\n", addr);
|
||||||
buf = google_breakpad::ReadTaskMemory(mach_task_self(),
|
kr = google_breakpad::ReadTaskMemory(mach_task_self(),
|
||||||
addr,
|
(uint64_t)addr,
|
||||||
getpagesize(),
|
getpagesize(),
|
||||||
&kr);
|
buf);
|
||||||
|
|
||||||
CPTAssert(kr == KERN_SUCCESS);
|
CPTAssert(kr == KERN_SUCCESS);
|
||||||
|
|
||||||
CPTAssert(buf != NULL);
|
CPTAssert(0 == memcmp(&buf[0], (const void*)addr, getpagesize()));
|
||||||
|
|
||||||
CPTAssert(0 == memcmp(buf, (const void*)addr, getpagesize()));
|
|
||||||
|
|
||||||
free(buf);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DynamicImagesTests::ReadLibrariesFromLocalTaskTest() {
|
void DynamicImagesTests::ReadLibrariesFromLocalTaskTest() {
|
||||||
|
@ -79,7 +75,5 @@ void DynamicImagesTests::ReadLibrariesFromLocalTaskTest() {
|
||||||
|
|
||||||
fprintf(stderr,"Local task image count: %d\n", d->GetImageCount());
|
fprintf(stderr,"Local task image count: %d\n", d->GetImageCount());
|
||||||
|
|
||||||
d->TestPrint();
|
|
||||||
|
|
||||||
CPTAssert(d->GetImageCount() > 0);
|
CPTAssert(d->GetImageCount() > 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -193,6 +193,7 @@
|
||||||
error:error];
|
error:error];
|
||||||
|
|
||||||
[response_ retain];
|
[response_ retain];
|
||||||
|
[req release];
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue