~statik/ubuntu/maverick/erlang/erlang-merge-testing

« back to all changes in this revision

Viewing changes to erts/emulator/beam/break.c

  • Committer: Bazaar Package Importer
  • Author(s): Sergei Golovan
  • Date: 2009-05-01 10:14:38 UTC
  • mfrom: (3.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20090501101438-6qlr6rsdxgyzrg2z
Tags: 1:13.b-dfsg-2
* Cleaned up patches: removed unneeded patch which helped to support
  different SCTP library versions, made sure that changes for m68k
  architecture applied only when building on this architecture.
* Removed duplicated information from binary packages descriptions.
* Don't require libsctp-dev build-dependency on solaris-i386 architecture
  which allows to build Erlang on Nexenta (thanks to Tim Spriggs for
  the suggestion).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* ``The contents of this file are subject to the Erlang Public License,
 
1
/*
 
2
 * %CopyrightBegin%
 
3
 * 
 
4
 * Copyright Ericsson AB 1996-2009. All Rights Reserved.
 
5
 * 
 
6
 * The contents of this file are subject to the Erlang Public License,
2
7
 * Version 1.1, (the "License"); you may not use this file except in
3
8
 * compliance with the License. You should have received a copy of the
4
9
 * Erlang Public License along with this software. If not, it can be
5
 
 * retrieved via the world wide web at http://www.erlang.org/.
 
10
 * retrieved online at http://www.erlang.org/.
6
11
 * 
7
12
 * Software distributed under the License is distributed on an "AS IS"
8
13
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
9
14
 * the License for the specific language governing rights and limitations
10
15
 * under the License.
11
16
 * 
12
 
 * The Initial Developer of the Original Code is Ericsson Utvecklings AB.
13
 
 * Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings
14
 
 * AB. All Rights Reserved.''
15
 
 * 
16
 
 *     $Id$
 
17
 * %CopyrightEnd%
17
18
 */
18
19
/* This File contains functions which are called if a user hits ^C */
19
20
 
102
103
                case 'k':
103
104
                    if (rp->status == P_WAITING) {
104
105
                        Uint32 rp_locks = ERTS_PROC_LOCKS_XSIG_SEND;
 
106
                        erts_smp_proc_inc_refc(rp);
105
107
                        erts_smp_proc_lock(rp, rp_locks);
106
108
                        (void) erts_send_exit_signal(NULL,
107
109
                                                     NIL,
112
114
                                                     NULL,
113
115
                                                     0);
114
116
                        erts_smp_proc_unlock(rp, rp_locks);
 
117
                        erts_smp_proc_dec_refc(rp);
115
118
                    }
116
119
                    else
117
120
                        erts_printf("Can only kill WAITING processes this way\n");
182
185
{
183
186
    int garbing = 0;
184
187
    int running = 0;
 
188
    struct saved_calls *scb;
185
189
 
186
190
    /* display the PID */
187
191
    erts_print(to, to_arg, "=proc:%T\n", p->id);
270
274
    }
271
275
    erts_print(to, to_arg, "Heap fragment data: %bpu\n", MBUF_SIZE(p));
272
276
 
273
 
    if (p->ct != NULL) {
 
277
    scb = ERTS_PROC_GET_SAVED_CALLS_BUF(p);
 
278
    if (scb) {
274
279
       int i, j;
275
280
 
276
281
       erts_print(to, to_arg, "Last calls:");
277
 
       for (i = 0; i < p->ct->n; i++) {
 
282
       for (i = 0; i < scb->n; i++) {
278
283
             erts_print(to, to_arg, " ");
279
 
             j = p->ct->cur - i - 1;
 
284
             j = scb->cur - i - 1;
280
285
             if (j < 0)
281
 
                j += p->ct->len;
282
 
             if (p->ct->ct[j] == &exp_send)
 
286
                j += scb->len;
 
287
             if (scb->ct[j] == &exp_send)
283
288
                erts_print(to, to_arg, "send");
284
 
             else if (p->ct->ct[j] == &exp_receive)
 
289
             else if (scb->ct[j] == &exp_receive)
285
290
                erts_print(to, to_arg, "'receive'");
286
 
             else if (p->ct->ct[j] == &exp_timeout)
 
291
             else if (scb->ct[j] == &exp_timeout)
287
292
                   erts_print(to, to_arg, "timeout");
288
293
             else
289
294
                 erts_print(to, to_arg, "%T:%T/%bpu\n",
290
 
                            p->ct->ct[j]->code[0],
291
 
                            p->ct->ct[j]->code[1],
292
 
                            p->ct->ct[j]->code[2]);
 
295
                            scb->ct[j]->code[0],
 
296
                            scb->ct[j]->code[1],
 
297
                            scb->ct[j]->code[2]);
293
298
       }
294
299
       erts_print(to, to_arg, "\n");
295
300
    }
664
669
     * NOTE: We allow gc therefore it is important not to lock *any*
665
670
     *       process locks.
666
671
     */
667
 
    switch (erts_smp_emergency_block_system(60000, ERTS_BS_FLG_ALLOW_GC)) {
668
 
    case 0:             /* Ok, now we are alone... */           break;
669
 
    case ETIMEDOUT:     /* Hmm, hope for the best... */         break;
670
 
    default:            /* Should not happen; give up... */     abort();
671
 
    }
 
672
    erts_smp_emergency_block_system(60000, ERTS_BS_FLG_ALLOW_GC);
 
673
    /* Either worked or not... */
672
674
 
673
675
    /* Allow us to pass certain places without locking... */
674
676
#ifdef ERTS_SMP