@@ -343,22 +343,18 @@ void factor_vm::dump_code_heap()
343
343
std::cout << printer.parameter_size << " bytes used by parameter tables" << std::endl;
344
344
}
345
345
346
- void factor_vm::factorbug ()
346
+ void factor_vm::factorbug_usage ()
347
347
{
348
- if (fep_disabled)
349
- {
350
- std::cout << " Low level debugger disabled" << std::endl;
351
- exit (1 );
352
- }
353
-
354
- fep_p = true ;
355
-
356
- std::cout << " Starting low level debugger..." << std::endl;
357
348
std::cout << " Basic commands:" << std::endl;
349
+ #ifdef WINDOWS
350
+ std::cout << " q ^Z -- quit Factor" << std::endl;
351
+ #else
358
352
std::cout << " q ^D -- quit Factor" << std::endl;
353
+ #endif
359
354
std::cout << " c -- continue executing Factor - NOT SAFE" << std::endl;
360
355
std::cout << " t -- throw exception in Factor - NOT SAFE" << std::endl;
361
356
std::cout << " .s .r .c -- print data, retain, call stacks" << std::endl;
357
+ std::cout << " help -- reprint this message" << std::endl;
362
358
std::cout << " Advanced commands:" << std::endl;
363
359
std::cout << " e -- dump environment" << std::endl;
364
360
std::cout << " d <addr> <count> -- dump memory" << std::endl;
@@ -374,15 +370,29 @@ void factor_vm::factorbug()
374
370
std::cout << " push <addr> -- push object on data stack - NOT SAFE" << std::endl;
375
371
std::cout << " gc -- trigger full GC - NOT SAFE" << std::endl;
376
372
std::cout << " code -- code heap dump" << std::endl;
373
+ std::cout << std::endl;
374
+
375
+ }
376
+
377
+ void factor_vm::factorbug ()
378
+ {
379
+ if (fep_disabled)
380
+ {
381
+ std::cout << " Low level debugger disabled" << std::endl;
382
+ exit (1 );
383
+ }
377
384
385
+ fep_p = true ;
386
+
387
+ std::cout << " Starting low level debugger..." << std::endl;
388
+ factorbug_usage ();
378
389
bool seen_command = false ;
379
390
380
391
for (;;)
381
392
{
382
393
char cmd[1024 ];
383
394
384
- std::cout << " READY" << std::endl;
385
- std::cout.flush ();
395
+ std::cout << " > " << std::flush;
386
396
387
397
std::cin >> std::setw (1024 ) >> cmd >> std::setw (0 );
388
398
if (!std::cin.good ())
@@ -481,6 +491,8 @@ void factor_vm::factorbug()
481
491
dump_code_heap ();
482
492
else if (strcmp (cmd," gc" ) == 0 )
483
493
primitive_full_gc ();
494
+ else if (strcmp (cmd," help" ) == 0 )
495
+ factorbug_usage ();
484
496
else
485
497
std::cout << " unknown command" << std::endl;
486
498
}
0 commit comments