Mercurial > octave-nkf
comparison src/input.cc @ 4975:80842ad3f85c
[project @ 2004-09-08 18:37:58 by jwe]
author | jwe |
---|---|
date | Wed, 08 Sep 2004 18:37:59 +0000 |
parents | b3f20980be32 |
children | bdbee5282954 |
comparison
equal
deleted
inserted
replaced
4974:ff29117ce225 | 4975:80842ad3f85c |
---|---|
533 int read_as_string = 0; | 533 int read_as_string = 0; |
534 | 534 |
535 if (nargin == 2) | 535 if (nargin == 2) |
536 read_as_string++; | 536 read_as_string++; |
537 | 537 |
538 std::string prompt ("debug> "); | 538 std::string nm; |
539 int line = -1; | |
540 | |
541 // We look at curr_caller_function because curr_function is always | |
542 // "keyboard". | |
543 | |
544 if (curr_caller_function) | |
545 { | |
546 nm = curr_caller_function->fcn_file_name (); | |
547 | |
548 if (nm.empty ()) | |
549 nm = curr_caller_function->name (); | |
550 | |
551 if (curr_statement) | |
552 line = curr_statement->line (); | |
553 } | |
554 | |
555 OSSTREAM buf; | |
556 | |
557 if (! nm.empty ()) | |
558 { | |
559 buf << "stopped in " << nm; | |
560 | |
561 if (line > 0) | |
562 buf << " at line " << line; | |
563 } | |
564 | |
565 buf << OSSTREAM_ENDS; | |
566 | |
567 std::string msg = OSSTREAM_STR (buf); | |
568 | |
569 OSSTREAM_FREEZE (buf); | |
570 | |
571 if (! msg.empty ()) | |
572 message ("keyboard", msg.c_str ()); | |
573 | |
574 std::string prompt = "debug> "; | |
539 | 575 |
540 if (nargin > 0) | 576 if (nargin > 0) |
541 { | 577 { |
542 prompt = args(0).string_value (); | 578 prompt = args(0).string_value (); |
543 | 579 |