O'Reilly logo

Accelerated Mac OS X Core Dump Analysis: Training Course Transcript and GDB Practice Exercises by Dmitry Vostokov, Memory Dump Analysis Services

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

App Source Code

App0

//
//  main.c
//  App0 - Exercise 0 - Testing Xcode GDB
//
//  Created by Dmitry Vostokov on 22/07/2012.
//  Copyright (c) 2012 Memory Dump Analysis Services. All rights reserved.
//

#include <stdlib.h>

void bar()
{
    abort();
}

void foo()
{
    bar();
}

int main(int argc, const char * argv[])
{
    foo();
    return 0;
}

App1

//
//  main.c
//  App1 - Normal application with multiple threads
//
//  Created by Dmitry Vostokov on 23/07/2012.
//  Copyright (c) 2012 Memory Dump Analysis Services. All rights reserved.
//

#include <stdio.h>
#include <pthread.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>

#define THREAD_DECLARE(num) void bar_##num()\
{\
    sleep(-1);\
}\
\
void foo_##num()\
{\
    bar_##num();\
}\
\
void * thread_##num ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required