summaryrefslogtreecommitdiff
path: root/dbg_mlc.c
diff options
context:
space:
mode:
authorhboehm <hboehm>2007-08-04 08:26:29 +0200
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 19:06:41 +0200
commit87b2e2602e766e448e7d65d7a7a7eb3e3cd020cb (patch)
tree0162d9d9de90bf1acb3653e4876d39b0e52d6439 /dbg_mlc.c
parent6db625e8a2a7d5d8b4faf8747b5688cd64f3949e (diff)
2007-08-03 Hans Boehm <Hans.Boehm@hp.com>
* alloc.c, backgraph.c, headers.c, include/private/gc_priv.h: Maintain GC_our_memory and GC_n_memory. * dbg_mlc.c (GC_print_smashed_obj): Improve message. (GC_print_all_smashed_proc): Pass client object address instead of base. * dyn_load.c (sort_heap_sects): New. (GC_register_map_entries): Register sections that are contiguous and merged with our heap. * malloc.c, os_dep.c (GC_text_mapping): Check for just base name of libraries. * malloc.c (calloc): Check for special callers even with USE_PROC_FOR_LIBRARIES. Move assertion. Add rudimentary malloc/free tracing. * misc.c: No longer call GC_init_lib_bounds explicitly. * thread_local_alloc.c (GC_malloc, GC_malloc_atomic): Always initialize on demand. * tests/test.c: Call GC_INIT only when required.
Diffstat (limited to 'dbg_mlc.c')
-rw-r--r--dbg_mlc.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/dbg_mlc.c b/dbg_mlc.c
index 4b72e39..70a23ab 100644
--- a/dbg_mlc.c
+++ b/dbg_mlc.c
@@ -402,12 +402,15 @@ void GC_debug_print_heap_obj_proc(ptr_t p)
}
#ifndef SHORT_DBG_HDRS
+/* Use GC_err_printf and friends to print a description of the object */
+/* whose client-visible address is p, and which was smashed at */
+/* clobbered_addr. */
void GC_print_smashed_obj(ptr_t p, ptr_t clobbered_addr)
{
register oh * ohdr = (oh *)GC_base(p);
GC_ASSERT(I_DONT_HOLD_LOCK());
- GC_err_printf("%p in object at %p(", clobbered_addr, p);
+ GC_err_printf("%p in or near object at %p(", clobbered_addr, p);
if (clobbered_addr <= (ptr_t)(&(ohdr -> oh_sz))
|| ohdr -> oh_string == 0) {
GC_err_printf("<smashed>, appr. sz = %ld)\n",
@@ -842,7 +845,8 @@ void GC_print_all_smashed_proc(void)
if (GC_n_smashed == 0) return;
GC_err_printf("GC_check_heap_block: found smashed heap objects:\n");
for (i = 0; i < GC_n_smashed; ++i) {
- GC_print_smashed_obj(GC_base(GC_smashed[i]), GC_smashed[i]);
+ GC_print_smashed_obj((ptr_t)GC_base(GC_smashed[i]) + sizeof(oh),
+ GC_smashed[i]);
GC_smashed[i] = 0;
}
GC_n_smashed = 0;