~ubuntu-branches/ubuntu/trusty/erlang/trusty

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Clint Byrum
  • Date: 2011-05-05 15:48:43 UTC
  • mfrom: (3.5.13 sid)
  • Revision ID: james.westby@ubuntu.com-20110505154843-0om6ekzg6m7ugj27
Tags: 1:14.b.2-dfsg-3ubuntu1
* Merge from debian unstable.  Remaining changes:
  - Drop libwxgtk2.8-dev build dependency. Wx isn't in main, and not
    supposed to.
  - Drop erlang-wx binary.
  - Drop erlang-wx dependency from -megaco, -common-test, and -reltool, they
    do not really need wx. Also drop it from -debugger; the GUI needs wx,
    but it apparently has CLI bits as well, and is also needed by -megaco,
    so let's keep the package for now.
  - debian/patches/series: Do what I meant, and enable build-options.patch
    instead.
* Additional changes:
  - Drop erlang-wx from -et
* Dropped Changes:
  - patches/pcre-crash.patch: CVE-2008-2371: outer level option with
    alternatives caused crash. (Applied Upstream)
  - fix for ssl certificate verification in newSSL: 
    ssl_cacertfile_fix.patch (Applied Upstream)
  - debian/patches/series: Enable native.patch again, to get stripped beam
    files and reduce the package size again. (build-options is what
    actually accomplished this)
  - Remove build-options.patch on advice from upstream and because it caused
    odd build failures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * %CopyrightBegin%
3
 
 * 
4
 
 * Copyright Ericsson AB 1998-2009. All Rights Reserved.
5
 
 * 
 
3
 *
 
4
 * Copyright Ericsson AB 1998-2010. All Rights Reserved.
 
5
 *
6
6
 * The contents of this file are subject to the Erlang Public License,
7
7
 * Version 1.1, (the "License"); you may not use this file except in
8
8
 * compliance with the License. You should have received a copy of the
9
9
 * Erlang Public License along with this software. If not, it can be
10
10
 * retrieved online at http://www.erlang.org/.
11
 
 * 
 
11
 *
12
12
 * Software distributed under the License is distributed on an "AS IS"
13
13
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14
14
 * the License for the specific language governing rights and limitations
15
15
 * under the License.
16
 
 * 
 
16
 *
17
17
 * %CopyrightEnd%
18
18
 */
19
19
 
207
207
    case FLOAT_DEF: {
208
208
            FloatDef ff;
209
209
            GET_DOUBLE(obj, ff);
210
 
#ifdef _OSE_
211
 
            erts_print(to, to_arg, "%e", ff.fd);
212
 
#else
213
210
            erts_print(to, to_arg, "%.20e", ff.fd);
214
 
#endif
215
211
        }
216
212
        break;
217
213
    case BINARY_DEF:
235
231
    }
236
232
 
237
233
    while(sp >= stop) {
238
 
        erts_print(to, to_arg, "%0*lx: ", PTR_SIZE, (Eterm) sp);
 
234
        erts_print(to, to_arg, "%0*lx: ", PTR_SIZE, (UWord) sp);
239
235
        if (is_catch(*sp)) {
240
 
            erts_print(to, to_arg, "catch %d", (Uint)catch_pc(*sp));
 
236
            erts_print(to, to_arg, "catch %ld", (UWord)catch_pc(*sp));
241
237
        } else {
242
238
            paranoid_display(to, to_arg, p, *sp);
243
239
        }
265
261
            return 1;
266
262
 
267
263
        for (mbuf = p->mbuf; mbuf; mbuf = mbuf->next) {
268
 
            if (WITHIN(ptr, &mbuf->mem[0], &mbuf->mem[0] + mbuf->size)) {
 
264
            if (WITHIN(ptr, &mbuf->mem[0], &mbuf->mem[0] + mbuf->used_size)) {
269
265
                return 1;
270
266
            }
271
267
        }
312
308
        if (IN_HEAP(p, ptr))
313
309
            continue;
314
310
        for (mbuf = p->mbuf; mbuf; mbuf = mbuf->next)
315
 
            if (WITHIN(ptr, &mbuf->mem[0], &mbuf->mem[0] + mbuf->size)) {
 
311
            if (WITHIN(ptr, &mbuf->mem[0], &mbuf->mem[0] + mbuf->used_size)) {
316
312
                in_mbuf = 1;
317
313
                break;
318
314
            }
344
340
        if (hf == p->last_mbuf) {
345
341
            break;
346
342
        }
347
 
        check_memory(hf->mem, hf->mem+hf->size);
 
343
        check_memory(hf->mem, hf->mem+hf->used_size);
348
344
    }
349
345
    p->last_mbuf = MBUF(p);
350
346
}
386
382
    }
387
383
 
388
384
    while (bp) {
389
 
        erts_check_memory(p,bp->mem,bp->mem + bp->size);
 
385
        erts_check_memory(p,bp->mem,bp->mem + bp->used_size);
390
386
        bp = bp->next;
391
387
    }
392
388
}
750
746
                    PTR_SIZE, "heap fragments",
751
747
                    dashes, dashes, dashes, dashes);
752
748
    while (bp) {
753
 
        print_untagged_memory(bp->mem,bp->mem + bp->size);
 
749
        print_untagged_memory(bp->mem,bp->mem + bp->used_size);
754
750
        bp = bp->next;
755
751
    }
756
752
}
895
891
#endif
896
892
    erts_printf("+-----------------%s-%s-%s-%s-+\n",dashes,dashes,dashes,dashes);
897
893
}
 
894
#if !HEAP_ON_C_STACK && defined(DEBUG)
 
895
Eterm *erts_debug_allocate_tmp_heap(int size, Process *p)
 
896
{
 
897
    ErtsSchedulerData *sd = ((p == NULL) ? erts_get_scheduler_data() : ERTS_PROC_GET_SCHDATA(p));
 
898
    int offset = sd->num_tmp_heap_used;
 
899
 
 
900
    ASSERT(offset+size <= TMP_HEAP_SIZE);
 
901
    return (sd->tmp_heap)+offset;
 
902
}
 
903
void erts_debug_use_tmp_heap(int size, Process *p)
 
904
{
 
905
    ErtsSchedulerData *sd = ((p == NULL) ? erts_get_scheduler_data() : ERTS_PROC_GET_SCHDATA(p));
 
906
 
 
907
    sd->num_tmp_heap_used += size;
 
908
    ASSERT(sd->num_tmp_heap_used <= TMP_HEAP_SIZE);
 
909
}
 
910
void erts_debug_unuse_tmp_heap(int size, Process *p)
 
911
{
 
912
    ErtsSchedulerData *sd = ((p == NULL) ? erts_get_scheduler_data() : ERTS_PROC_GET_SCHDATA(p));
 
913
 
 
914
    sd->num_tmp_heap_used -= size;
 
915
    ASSERT(sd->num_tmp_heap_used >= 0);
 
916
}
 
917
#endif
898
918
#endif
899
919