| OLD | NEW |
| 1 /* Output generating routines for GDB. | 1 /* Output generating routines for GDB. |
| 2 | 2 |
| 3 Copyright (C) 1999-2002, 2004-2005, 2007-2012 Free Software | 3 Copyright (C) 1999-2002, 2004-2005, 2007-2012 Free Software |
| 4 Foundation, Inc. | 4 Foundation, Inc. |
| 5 | 5 |
| 6 Contributed by Cygnus Solutions. | 6 Contributed by Cygnus Solutions. |
| 7 Written by Fernando Nasser for Cygnus. | 7 Written by Fernando Nasser for Cygnus. |
| 8 | 8 |
| 9 This file is part of GDB. | 9 This file is part of GDB. |
| 10 | 10 |
| (...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 struct gdbarch *gdbarch, | 494 struct gdbarch *gdbarch, |
| 495 CORE_ADDR address) | 495 CORE_ADDR address) |
| 496 { | 496 { |
| 497 ui_out_field_string (uiout, fldname, | 497 ui_out_field_string (uiout, fldname, |
| 498 print_core_address (gdbarch, address)); | 498 print_core_address (gdbarch, address)); |
| 499 } | 499 } |
| 500 | 500 |
| 501 void | 501 void |
| 502 ui_out_field_stream (struct ui_out *uiout, | 502 ui_out_field_stream (struct ui_out *uiout, |
| 503 const char *fldname, | 503 const char *fldname, |
| 504 » » struct ui_stream *buf) | 504 » » struct ui_file *stream) |
| 505 { | 505 { |
| 506 long length; | 506 long length; |
| 507 char *buffer = ui_file_xstrdup (buf->stream, &length); | 507 char *buffer = ui_file_xstrdup (stream, &length); |
| 508 struct cleanup *old_cleanup = make_cleanup (xfree, buffer); | 508 struct cleanup *old_cleanup = make_cleanup (xfree, buffer); |
| 509 | 509 |
| 510 if (length > 0) | 510 if (length > 0) |
| 511 ui_out_field_string (uiout, fldname, buffer); | 511 ui_out_field_string (uiout, fldname, buffer); |
| 512 else | 512 else |
| 513 ui_out_field_skip (uiout, fldname); | 513 ui_out_field_skip (uiout, fldname); |
| 514 ui_file_rewind (buf->stream); | 514 ui_file_rewind (stream); |
| 515 do_cleanups (old_cleanup); | 515 do_cleanups (old_cleanup); |
| 516 } | 516 } |
| 517 | 517 |
| 518 /* Used to omit a field. */ | 518 /* Used to omit a field. */ |
| 519 | 519 |
| 520 void | 520 void |
| 521 ui_out_field_skip (struct ui_out *uiout, | 521 ui_out_field_skip (struct ui_out *uiout, |
| 522 const char *fldname) | 522 const char *fldname) |
| 523 { | 523 { |
| 524 int fldno; | 524 int fldno; |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 582 ui_out_message (struct ui_out *uiout, int verbosity, | 582 ui_out_message (struct ui_out *uiout, int verbosity, |
| 583 const char *format,...) | 583 const char *format,...) |
| 584 { | 584 { |
| 585 va_list args; | 585 va_list args; |
| 586 | 586 |
| 587 va_start (args, format); | 587 va_start (args, format); |
| 588 uo_message (uiout, verbosity, format, args); | 588 uo_message (uiout, verbosity, format, args); |
| 589 va_end (args); | 589 va_end (args); |
| 590 } | 590 } |
| 591 | 591 |
| 592 struct ui_stream * | |
| 593 ui_out_stream_new (struct ui_out *uiout) | |
| 594 { | |
| 595 struct ui_stream *tempbuf; | |
| 596 | |
| 597 tempbuf = XMALLOC (struct ui_stream); | |
| 598 tempbuf->uiout = uiout; | |
| 599 tempbuf->stream = mem_fileopen (); | |
| 600 return tempbuf; | |
| 601 } | |
| 602 | |
| 603 void | |
| 604 ui_out_stream_delete (struct ui_stream *buf) | |
| 605 { | |
| 606 ui_file_delete (buf->stream); | |
| 607 xfree (buf); | |
| 608 } | |
| 609 | |
| 610 static void | |
| 611 do_stream_delete (void *buf) | |
| 612 { | |
| 613 ui_out_stream_delete (buf); | |
| 614 } | |
| 615 | |
| 616 struct cleanup * | |
| 617 make_cleanup_ui_out_stream_delete (struct ui_stream *buf) | |
| 618 { | |
| 619 return make_cleanup (do_stream_delete, buf); | |
| 620 } | |
| 621 | |
| 622 | |
| 623 void | 592 void |
| 624 ui_out_wrap_hint (struct ui_out *uiout, char *identstring) | 593 ui_out_wrap_hint (struct ui_out *uiout, char *identstring) |
| 625 { | 594 { |
| 626 uo_wrap_hint (uiout, identstring); | 595 uo_wrap_hint (uiout, identstring); |
| 627 } | 596 } |
| 628 | 597 |
| 629 void | 598 void |
| 630 ui_out_flush (struct ui_out *uiout) | 599 ui_out_flush (struct ui_out *uiout) |
| 631 { | 600 { |
| 632 uo_flush (uiout); | 601 uo_flush (uiout); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 668 /* Obtain the current verbosity level (as stablished by the | 637 /* Obtain the current verbosity level (as stablished by the |
| 669 'set verbositylevel' command. */ | 638 'set verbositylevel' command. */ |
| 670 | 639 |
| 671 int | 640 int |
| 672 ui_out_get_verblvl (struct ui_out *uiout) | 641 ui_out_get_verblvl (struct ui_out *uiout) |
| 673 { | 642 { |
| 674 /* FIXME: not implemented yet. */ | 643 /* FIXME: not implemented yet. */ |
| 675 return 0; | 644 return 0; |
| 676 } | 645 } |
| 677 | 646 |
| 678 #if 0 | |
| 679 void | |
| 680 ui_out_result_begin (struct ui_out *uiout, char *class) | |
| 681 { | |
| 682 } | |
| 683 | |
| 684 void | |
| 685 ui_out_result_end (struct ui_out *uiout) | |
| 686 { | |
| 687 } | |
| 688 | |
| 689 void | |
| 690 ui_out_info_begin (struct ui_out *uiout, char *class) | |
| 691 { | |
| 692 } | |
| 693 | |
| 694 void | |
| 695 ui_out_info_end (struct ui_out *uiout) | |
| 696 { | |
| 697 } | |
| 698 | |
| 699 void | |
| 700 ui_out_notify_begin (struct ui_out *uiout, char *class) | |
| 701 { | |
| 702 } | |
| 703 | |
| 704 void | |
| 705 ui_out_notify_end (struct ui_out *uiout) | |
| 706 { | |
| 707 } | |
| 708 | |
| 709 void | |
| 710 ui_out_error_begin (struct ui_out *uiout, char *class) | |
| 711 { | |
| 712 } | |
| 713 | |
| 714 void | |
| 715 ui_out_error_end (struct ui_out *uiout) | |
| 716 { | |
| 717 } | |
| 718 #endif | |
| 719 | |
| 720 #if 0 | |
| 721 void | |
| 722 gdb_error (ui_out * uiout, int severity, char *format,...) | |
| 723 { | |
| 724 va_list args; | |
| 725 } | |
| 726 | |
| 727 void | |
| 728 gdb_query (struct ui_out *uiout, int qflags, char *qprompt) | |
| 729 { | |
| 730 } | |
| 731 #endif | |
| 732 | |
| 733 int | 647 int |
| 734 ui_out_is_mi_like_p (struct ui_out *uiout) | 648 ui_out_is_mi_like_p (struct ui_out *uiout) |
| 735 { | 649 { |
| 736 return uiout->impl->is_mi_like_p; | 650 return uiout->impl->is_mi_like_p; |
| 737 } | 651 } |
| 738 | 652 |
| 739 /* Default gdb-out hook functions. */ | 653 /* Default gdb-out hook functions. */ |
| 740 | 654 |
| 741 static void | 655 static void |
| 742 default_table_begin (struct ui_out *uiout, int nbrofcols, | 656 default_table_begin (struct ui_out *uiout, int nbrofcols, |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 992 | 906 |
| 993 /* List of column headers manipulation routines. */ | 907 /* List of column headers manipulation routines. */ |
| 994 | 908 |
| 995 static void | 909 static void |
| 996 clear_header_list (struct ui_out *uiout) | 910 clear_header_list (struct ui_out *uiout) |
| 997 { | 911 { |
| 998 while (uiout->table.header_first != NULL) | 912 while (uiout->table.header_first != NULL) |
| 999 { | 913 { |
| 1000 uiout->table.header_next = uiout->table.header_first; | 914 uiout->table.header_next = uiout->table.header_first; |
| 1001 uiout->table.header_first = uiout->table.header_first->next; | 915 uiout->table.header_first = uiout->table.header_first->next; |
| 1002 if (uiout->table.header_next->colhdr != NULL) | 916 xfree (uiout->table.header_next->colhdr); |
| 1003 » xfree (uiout->table.header_next->colhdr); | 917 xfree (uiout->table.header_next->col_name); |
| 1004 xfree (uiout->table.header_next); | 918 xfree (uiout->table.header_next); |
| 1005 } | 919 } |
| 1006 gdb_assert (uiout->table.header_first == NULL); | 920 gdb_assert (uiout->table.header_first == NULL); |
| 1007 uiout->table.header_last = NULL; | 921 uiout->table.header_last = NULL; |
| 1008 uiout->table.header_next = NULL; | 922 uiout->table.header_next = NULL; |
| 1009 } | 923 } |
| 1010 | 924 |
| 1011 static void | 925 static void |
| 1012 append_header_to_list (struct ui_out *uiout, | 926 append_header_to_list (struct ui_out *uiout, |
| 1013 int width, | 927 int width, |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1166 return uiout; | 1080 return uiout; |
| 1167 } | 1081 } |
| 1168 | 1082 |
| 1169 /* Standard gdb initialization hook. */ | 1083 /* Standard gdb initialization hook. */ |
| 1170 | 1084 |
| 1171 void | 1085 void |
| 1172 _initialize_ui_out (void) | 1086 _initialize_ui_out (void) |
| 1173 { | 1087 { |
| 1174 /* nothing needs to be done */ | 1088 /* nothing needs to be done */ |
| 1175 } | 1089 } |
| OLD | NEW |