diff options
author | Elliott Hughes <enh@google.com> | 2013-03-14 17:25:04 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-03-14 17:25:04 -0700 |
commit | e05093b924652acb76b4527a3c32807cfa68118c (patch) | |
tree | 917c15aa26d57fce16926b4a63ae43d39794bd2a /debuggerd | |
parent | eb6dd010b56bbca76f345967d55d0faab6c5fbf3 (diff) | |
parent | 3e77b7521ba96fd1ff6fed0e019aff5f46a31428 (diff) | |
download | system_core-e05093b924652acb76b4527a3c32807cfa68118c.zip system_core-e05093b924652acb76b4527a3c32807cfa68118c.tar.gz system_core-e05093b924652acb76b4527a3c32807cfa68118c.tar.bz2 |
am 3e77b752: am 0b535558: Merge "Unwinding implementation via eh_frame sections for x86"
* commit '3e77b7521ba96fd1ff6fed0e019aff5f46a31428':
Unwinding implementation via eh_frame sections for x86
Diffstat (limited to 'debuggerd')
-rw-r--r-- | debuggerd/crasher.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/debuggerd/crasher.c b/debuggerd/crasher.c index 134fe80..630d980 100644 --- a/debuggerd/crasher.c +++ b/debuggerd/crasher.c @@ -101,6 +101,21 @@ int do_action_on_thread(const char* arg) return (int) result; } +__attribute__((noinline)) int crash3(int a) { + *((int*) 0xdead) = a; + return a*4; +} + +__attribute__((noinline)) int crash2(int a) { + a = crash3(a) + 2; + return a*3; +} + +__attribute__((noinline)) int crash(int a) { + a = crash2(a) + 1; + return a*2; +} + int do_action(const char* arg) { if(!strncmp(arg, "thread-", strlen("thread-"))) { @@ -111,6 +126,7 @@ int do_action(const char* arg) if(!strcmp(arg,"nostack")) crashnostack(); if(!strcmp(arg,"ctest")) return ctest(); if(!strcmp(arg,"exit")) exit(1); + if(!strcmp(arg,"crash")) return crash(42); if(!strcmp(arg,"abort")) maybeabort(); pthread_t thr; |