Changeset 13765


Ignore:
Timestamp:
Jun 1, 2010, 5:03:19 PM (9 years ago)
Author:
rme
Message:

Kernel debugger command "M" to show lisp memory areas.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lisp-kernel/lisp-debug.c

    r13511 r13765  
    505505#endif
    506506
     507char *
     508area_code_name(int code)
     509{
     510  switch (code) {
     511    case AREA_VOID: return "void";
     512    case AREA_CSTACK: return "cstack";
     513    case AREA_VSTACK: return "vstack";
     514    case AREA_TSTACK: return "tstack";
     515    case AREA_READONLY: return "readonly";
     516    case AREA_WATCHED: return "watched";
     517    case AREA_STATIC_CONS: return "static cons";
     518    case AREA_MANAGED_STATIC: return "managed static";
     519    case AREA_STATIC: return "static";
     520    case AREA_DYNAMIC: return "dynamic";
     521    default: return "unknown";
     522  }
     523}
     524
     525debug_command_return
     526debug_memory_areas(ExceptionInformation *xp, siginfo_t *info, int arg)
     527{
     528  int i;
     529  area *a, *header = all_areas;
     530  char label[100];
     531
     532  fprintf(dbgout, "Lisp memory areas:\n");
     533  fprintf(dbgout, "%20s %20s %20s\n", "code", "low", "high");
     534  for (a = header->succ; a != header; a = a->succ) {
     535    snprintf(label, sizeof(label), "%s (%d)", area_code_name(a->code),
     536             a->code >> fixnumshift);
     537    fprintf(dbgout, "%20s %20p %20p\n", label, a->low, a->high);
     538  }
     539  return debug_continue;
     540}
     541
    507542debug_command_return
    508543debug_lisp_registers(ExceptionInformation *xp, siginfo_t *info, int arg)
     
    10361071   NULL,
    10371072   'T'},
     1073  {debug_memory_areas,
     1074   "Show memory areas",
     1075   0,
     1076   NULL,
     1077   'M'},
    10381078  {debug_win,
    10391079   "Exit from this debugger, asserting that any exception was handled",
     
    12511291  va_end(args);
    12521292  lisp_Debugger(xp, NULL, debug_entry_bug, true, s);
    1253 
    12541293}
    12551294
Note: See TracChangeset for help on using the changeset viewer.