Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(380)

Side by Side Diff: third_party/mach_override/mach_override.c

Issue 7670025: [Mac] Implement base::EnableTerminationOnHeapCorruption() by overriding malloc_error_break(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Patch mach_override Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /******************************************************************************* 1 /*******************************************************************************
2 mach_override.c 2 mach_override.c
3 Copyright (c) 2003-2009 Jonathan 'Wolf' Rentzsch: <http://rentzs ch.com> 3 Copyright (c) 2003-2009 Jonathan 'Wolf' Rentzsch: <http://rentzs ch.com>
4 Some rights reserved: <http://opensource.org/licenses/mit-licens e.php> 4 Some rights reserved: <http://opensource.org/licenses/mit-licens e.php>
5 5
6 ************************************************************************ ***/ 6 ************************************************************************ ***/
7 7
8 #include "mach_override.h" 8 #include "mach_override.h"
9 9
10 #include <mach-o/dyld.h> 10 #include <mach-o/dyld.h>
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 #if defined(__i386__) || defined(__x86_64__) 523 #if defined(__i386__) || defined(__x86_64__)
524 // simplistic instruction matching 524 // simplistic instruction matching
525 typedef struct { 525 typedef struct {
526 unsigned int length; // max 15 526 unsigned int length; // max 15
527 unsigned char mask[15]; // sequence of bytes in memory order 527 unsigned char mask[15]; // sequence of bytes in memory order
528 unsigned char constraint[15]; // sequence of bytes in memory order 528 unsigned char constraint[15]; // sequence of bytes in memory order
529 } AsmInstructionMatch; 529 } AsmInstructionMatch;
530 530
531 #if defined(__i386__) 531 #if defined(__i386__)
532 static AsmInstructionMatch possibleInstructions[] = { 532 static AsmInstructionMatch possibleInstructions[] = {
533 { 0x5, {0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, {0x55, 0x89, 0xe5, 0xc9, 0xc3} }, // push %ebp; mov %esp,%ebp; leave; ret
533 { 0x1, {0xFF}, {0x90} }, // nop 534 { 0x1, {0xFF}, {0x90} }, // nop
534 { 0x1, {0xFF}, {0x55} }, // push %esp 535 { 0x1, {0xFF}, {0x55} }, // push %esp
535 { 0x2, {0xFF, 0xFF}, {0x89, 0xE5} }, // mov %esp,%ebp 536 { 0x2, {0xFF, 0xFF}, {0x89, 0xE5} }, // mov %esp,%ebp
536 { 0x1, {0xFF}, {0x53} }, // push %ebx 537 { 0x1, {0xFF}, {0x53} }, // push %ebx
537 { 0x3, {0xFF, 0xFF, 0x00}, {0x83, 0xEC, 0x00} }, // sub 0x??, %esp 538 { 0x3, {0xFF, 0xFF, 0x00}, {0x83, 0xEC, 0x00} }, // sub 0x??, %esp
538 { 0x6, {0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00}, {0x81, 0xEC, 0x00, 0x00, 0x 00, 0x00} }, // sub 0x??, %esp with 32bit immediate 539 { 0x6, {0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00}, {0x81, 0xEC, 0x00, 0x00, 0x 00, 0x00} }, // sub 0x??, %esp with 32bit immediate
539 { 0x1, {0xFF}, {0x57} }, // push %edi 540 { 0x1, {0xFF}, {0x57} }, // push %edi
540 { 0x1, {0xFF}, {0x56} }, // push %esi 541 { 0x1, {0xFF}, {0x56} }, // push %esi
541 { 0x2, {0xFF, 0xFF}, {0x31, 0xC0} }, // xor %eax, %eax 542 { 0x2, {0xFF, 0xFF}, {0x31, 0xC0} }, // xor %eax, %eax
542 { 0x3, {0xFF, 0x4F, 0x00}, {0x8B, 0x45, 0x00} }, // mov $imm(%ebp), %re g 543 { 0x3, {0xFF, 0x4F, 0x00}, {0x8B, 0x45, 0x00} }, // mov $imm(%ebp), %re g
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 ); 681 );
681 #elif defined(__x86_64__) 682 #elif defined(__x86_64__)
682 void atomic_mov64( 683 void atomic_mov64(
683 uint64_t *targetAddress, 684 uint64_t *targetAddress,
684 uint64_t value ) 685 uint64_t value )
685 { 686 {
686 *targetAddress = value; 687 *targetAddress = value;
687 } 688 }
688 #endif 689 #endif
689 #endif 690 #endif
OLDNEW
« base/process_util_mac.mm ('K') | « third_party/mach_override/README.chromium ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698