~ubuntu-branches/ubuntu/gutsy/pkg-create-dbgsym/gutsy

« back to all changes in this revision

Viewing changes to dhtest.dbg2/crash2.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2006-09-21 20:51:28 UTC
  • Revision ID: james.westby@ubuntu.com-20060921205128-4ooxk5bk1apja6p3
Tags: 0.14
* Use more elaborate test crash programs with a three-function deep stack,
  so that gdb's current 'Could not find the frame base' failure in the
  topmost function does not completely break the test suite.
* Add dhtest.dbg2 test case: Use dh_strip --keep-debug and manually move
  around the debug symbols to dhtest1-dbg. This replicates the current FTBFS
  of opal.
* dh_strip: Handle --keep-debug option gracefully to err on the safe side.
  Fixes current opal FTBFS.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* crash.c - demo program for libcrashreport
 
2
 
 
3
   (c) 2004 Martin Pitt <martin@piware.de>
 
4
 
 
5
   This file is public domain.
 
6
*/
 
7
 
 
8
#include <stdio.h>
 
9
#include <math.h>
 
10
#include <signal.h>
 
11
 
 
12
double h()
 
13
{
 
14
    double a = 1./0;
 
15
    if (isinf(a))
 
16
        raise(SIGFPE);
 
17
    return a;
 
18
}
 
19
 
 
20
int g( int x, int y )
 
21
{
 
22
    
 
23
    return x+y+(int) h();
 
24
}
 
25
 
 
26
int f( int x )
 
27
{
 
28
    return g( x, 42 );
 
29
}
 
30
 
 
31
int
 
32
main()
 
33
{
 
34
    int x;
 
35
 
 
36
    x = f(1);
 
37
    printf( "x = %i, terminating normally now.\n", x );
 
38
    return 0;
 
39
}