summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>2000-02-03 04:14:24 +0000
committerJason Molenda <jmolenda@apple.com>2000-02-03 04:14:24 +0000
commitfc38b7d751c5adc150818721eca5006714883f5c (patch)
tree8e00875c97d5016fef4685081feac9568716c864
parent545432a867b7a33d5b56da6b7f0996d0e7cc4e07 (diff)
downloadgdb-fc38b7d751c5adc150818721eca5006714883f5c.tar.gz
import gdb-2000-02-02 snapshot
-rw-r--r--gdb/ChangeLog29
-rw-r--r--gdb/ChangeLog-99484
-rw-r--r--gdb/Makefile.in15
-rw-r--r--gdb/arm-tdep.c79
-rw-r--r--gdb/breakpoint.c373
-rw-r--r--gdb/breakpoint.h6
-rw-r--r--gdb/cli-out.c252
-rw-r--r--gdb/cli-out.h13
-rw-r--r--gdb/command.c102
-rwxr-xr-xgdb/configure597
-rw-r--r--gdb/configure.in36
-rw-r--r--gdb/defs.h7
-rw-r--r--gdb/event-top.c1
-rw-r--r--gdb/gdbcmd.h7
-rw-r--r--gdb/infcmd.c53
-rw-r--r--gdb/infrun.c47
-rw-r--r--gdb/main.c8
-rw-r--r--gdb/printcmd.c41
-rw-r--r--gdb/remote.c6
-rw-r--r--gdb/source.c62
-rw-r--r--gdb/stack.c104
-rw-r--r--gdb/symfile.c36
-rw-r--r--gdb/symtab.c9
-rw-r--r--gdb/testsuite/ChangeLog11
-rwxr-xr-xgdb/testsuite/configure27
-rw-r--r--gdb/testsuite/gdb.base/ending-run.exp4
-rw-r--r--gdb/testsuite/gdb.base/step-test.exp5
-rw-r--r--gdb/thread.c51
-rw-r--r--gdb/top.c143
-rw-r--r--gdb/top.h2
-rw-r--r--gdb/ui-out.c915
-rw-r--r--gdb/ui-out.h187
-rw-r--r--gdb/varobj.c2724
-rw-r--r--gdb/varobj.h70
-rw-r--r--gdb/wrapper.c181
-rw-r--r--gdb/wrapper.h48
36 files changed, 3867 insertions, 2868 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 00fd900fc81..f004ec67e20 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,13 @@
+2000-02-02 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * arm-tdep.c (arm_push_arguments): Fix passing of floating point
+ arguments on dummy frames.
+
+2000-02-02 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * arm-tdep.c (arm_pc_is_thumb_dummy): Account for large dummy frames.
+ (arm_pop_frame): Account fr dummy frames (as opposed to real ones).
+
2000-02-01 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* remote.c (getpkt_sane): New function. It is the old getpkt(),
@@ -5,6 +15,11 @@
(getpkt): New function. Wrapper for getpkt_sane(), so that return
value can still be ignored.
+Tue Feb 1 18:47:31 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * top.c (print_gdb_version): Print ``UI_OUT'' when configured with
+ UI_OUT.
+
Tue Feb 1 00:17:12 2000 Andrew Cagney <cagney@b1.cygnus.com>
* ui-file.c, ui-file.h: Rename gdb-file.h, gdb-file.c. Rename
@@ -29,6 +44,7 @@ Tue Feb 1 00:17:12 2000 Andrew Cagney <cagney@b1.cygnus.com>
target.c, target.h, top.c, top.h, typeprint.c, typeprint.h,
utils.c, v850ice.c, valprint.c, valprint.h, value.h,
config/pa/tm-hppa.h: Update.
+ * cli-out.c, cli-out.h, ui-out.c, ui-out.h, varobj.c: Update.
2000-01-31 Jason Molenda (jsm@bugshack.cygnus.com)
@@ -119,6 +135,10 @@ Mon Jan 31 17:14:52 2000 Andrew Cagney <cagney@b1.cygnus.com>
2000-01-27 Fernando Nasser <fnasser@totem.to.cygnus.com>
+ * cli-out.c (cli_filed_string): Test for NULL string.
+
+2000-01-27 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
* infcmd.c (run_stack_dummy): Account for a random signal stopping
the inferior as well as breakpoints being hit while performing an
inferior function call.
@@ -274,6 +294,11 @@ Thu Jan 13 23:34:17 EST 2000 Nicholas Duffek <nsd@cygnus.com>
current thread, safely from within catch_errors().
(gdb_thread_select): New function. Switch threads safely.
(thread_command): Use gdb_thread_select().
+ Include ui-out.h.
+ (do_captured_list_thread_ids): New function.
+ (gdb_list_thread_ids): New function.
+
+ * defs.h (gdb_thread_select, gdb_list_thread_ids): Export.
2000-01-11 Christopher Faylor <cgf@cygnus.com>
@@ -329,6 +354,10 @@ Thu Jan 13 23:34:17 EST 2000 Nicholas Duffek <nsd@cygnus.com>
(proc_modify_flag): add support for PR_KLC (kill on last close).
(proc_[un]set_kill_on_last_close): new functions.
+2000-01-07 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * infrun.c (normal_stop): Print out thread id when we stop.
+
2000-01-06 Fernando Nasser <fnasser@totem.to.cygnus.com>
* remote.c (remote_open_1): Fix message so it does not imply a
diff --git a/gdb/ChangeLog-99 b/gdb/ChangeLog-99
index 005de04a488..2fc778b652a 100644
--- a/gdb/ChangeLog-99
+++ b/gdb/ChangeLog-99
@@ -1,3 +1,10 @@
+Sun Dec 19 18:56:38 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * breakpoint.c (mention): Delete ui-out breakpoint code. Mention
+ calls breakpoint_create_event and that, eventually, calls
+ gdb_breakpoint_query which displays the breakpoint details.
+ (hbreak_command_wrapper, thbreak_command_wrapper): Delete.
+
Wed Dec 29 17:41:11 1999 Andrew Cagney <cagney@b1.cygnus.com>
* breakpoint.c (create_breakpoints, parse_breapoint_sals,
@@ -70,7 +77,6 @@ Wed Dec 29 17:41:11 1999 Andrew Cagney <cagney@b1.cygnus.com>
(TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT) define always true.
* config/mips/nm-irix4.h: ditto.
-
1999-12-21 Jim Blandy <jimb@cygnus.com>
* Makefile.in (elf_bfd_h): Look for elf-bfd.h in BFD_SRC, not
@@ -458,6 +464,22 @@ Sat Dec 11 17:52:03 1999 Andrew Cagney <cagney@b1.cygnus.com>
* breakpoint.c (print_one_breakpoint): New function. Move
breakpoint print code to here.
(breakpoint_1): From here.
+ (print_one_breakpoint): Merge in ui-out code.
+ (print_one_breakpoint): Add local variabls ``stb'' and
+ ``old_chain''.
+ (breakpoint_1): Use print_one_breakpoint when UI.
+ (print_one_breakpoint): Print breakpoint type when UI.
+ (breakpoint_1): Merge UI out code into non UI function.
+
+ * ui-out.c (make_cleanup_ui_out_stream_delete): New function. Wrap
+ make_cleanup.
+ (do_stream_delete): New function. Wrap ui_out_stream_delete.
+ * ui-out.h (make_cleanup_ui_out_stream_delete): Declare.
+
+Sat Dec 11 00:12:41 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * breakpoint.c (breakpoint_1): Clone breakpoint_1 creating UI
+ and non-UI versions.
Mon Dec 6 20:31:28 1999 Andrew Cagney <cagney@b1.cygnus.com>
@@ -616,6 +638,11 @@ Fri Dec 3 17:38:06 1999 Andrew Cagney <cagney@b1.cygnus.com>
Return size of packet or -1.
(getpkt): Update. Pass in PBUFSIZ.
+1999-12-02 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * breakpoint.c (print_it_typical): Print reason for stopping in
+ case of bp_until.
+
Thu Dec 2 17:14:53 1999 Andrew Cagney <cagney@b1.cygnus.com>
* ser-pipe.c: Include <string.h> for memset().
@@ -637,6 +664,11 @@ Thu Dec 2 17:14:53 1999 Andrew Cagney <cagney@b1.cygnus.com>
* valops.c (value_assign): Clarify error message.
+1999-12-01 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * stack.c (return_command_wrapper): New function, to export
+ return_command().
+
1999-12-01 Christopher Faylor <cgf@cygnus.com>
* config/i386/tm-cygwin.h: Change tm-i386.h include back to tm-i386v.h.
@@ -743,6 +775,10 @@ Thu Dec 2 17:14:53 1999 Andrew Cagney <cagney@b1.cygnus.com>
1999-11-29 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+ * infrun.c (print_stop_reason): Don't print end of stepping reason
+ if we are in the middle of a multistep command (same condition as
+ in normal_stop).
+
* breakpoint.c (bpstat_stop_status): Don't decrease hit_count
in case of a wp that has not changed.
@@ -792,6 +828,14 @@ Wed Nov 24 17:07:28 1999 Andrew Cagney <cagney@b1.cygnus.com>
* Makefile.in (init.c): Add SUBDIR_INIT_FILES so that sub
directories can hook in extra init files.
+Wed Nov 24 11:41:01 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * ui-out.h (field_string_ftype, ui_out_field_string): Make string
+ parameter const.
+ * cli-out.c (cli_field_string): Update.
+ * ui-out.c (uo_field_string, ui_out_field_string,
+ default_field_string): Update.
+
1999-11-23 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* defs.h (show_load_progress): Export.
@@ -799,6 +843,8 @@ Wed Nov 24 17:07:28 1999 Andrew Cagney <cagney@b1.cygnus.com>
* symfile.c (show_load_progress): New hook for download.
(generic_load): Collect total size of executable to load.
Call progress hook when downloading.
+ Add output for ui case.
+ (print_transfer_performance): Add output for ui case.
Thu Nov 18 11:54:24 1999 Andrew Cagney <cagney@b1.cygnus.com>
@@ -813,6 +859,10 @@ Wed Nov 17 17:01:06 1999 Andrew Cagney <cagney@b1.cygnus.com>
* Makefile.in (i386-tdep.o): Update list of dependencies.
+1999-11-22 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * stack.c (print_frame_info_base): Adjust output for stepi/nexti case.
+
1999-11-22 Jim Blandy <jimb@cygnus.com>
* config/i386/tm-i386v.h (NUM_REGS, REGISTER_NAMES,
@@ -848,6 +898,10 @@ Thu Nov 18 18:12:48 1999 Andrew Cagney <cagney@b1.cygnus.com>
(exec_file_attach), corefile.c (core_file_command,
reopen_exec_file): Replace strdup with xstrdup.
+ * varobj.c (varobj_gen_name, c_name_of_child, c_value_of_variable,
+ cplus_value_of_variable): Replace strdup with xstrdup.
+ * ui-out.c (ui_out_table_begin): Ditto.
+
Mon Nov 22 12:02:47 1999 Andrew Cagney <cagney@b1.cygnus.com>
* bcache.c (print_bcache_statistics): Fix printf_filtered
@@ -967,6 +1021,20 @@ Wed Nov 17 17:40:30 1999 Andrew Cagney <cagney@b1.cygnus.com>
* remote-rdi.c: Fix indentation accordingly to GNU standards.
+1999-11-11 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * breakpoint.h: Export {watch, awatch, rwatch}_command_wrapper().
+
+ * breakpoint.c (print_it_typical): Add output for bp_watchpoint,
+ bp_hardware_watchpoint, read_watchpoint, access_watchpoint cases.
+ (watchpoint_check): Add output for when the watchpoint goes out of
+ scope.
+ (mention): Add output for bp_watchpoint, bp_hardware_watchpoint,
+ read_watchpoint, access_watchpointcases. Move end of list to end
+ of function.
+ ({watch, awatch, rwatch}_command_wrapper): New functions, to
+ export {watch, awatch, rwatch}_command().
+
Thu Oct 28 00:28:51 1999 Andrew Cagney <cagney@b1.cygnus.com>
* d10v-tdep.c (d10v_gdbarch_init): Make the d10v:ts3 the default.
@@ -1058,6 +1126,8 @@ Wed Nov 10 16:47:06 1999 Andrew Cagney <cagney@b1.cygnus.com>
* corefile.c (memory_error): Use mem_fileopen instead of
tui_sfileopen. Don't call error_begin.
+ * varobj.c (c_value_of_variable): Use mem_fileopen () and
+ gdb_file_xstrdup() instead of strdup and tui_sfileopen.
* remote-sim.c (gdb_os_error): Rewrite using verror. Don't call
error_begin.
@@ -1065,6 +1135,8 @@ Wed Nov 10 14:21:43 1999 Andrew Cagney <cagney@b1.cygnus.com>
* defs.h (gdb_file_xstrdup): New function.
* utils.c (gdb_file_xstrdup, do_gdb_file_xstrdup): Implement.
+ * ui-out.c (ui_out_stream_new): Simplify, XMALLOC doesn't return
+ if malloc failed. Use mem_fileopen and gdb_file_xstrdup.
1999-11-09 Stan Shebs <shebs@andros.cygnus.com>
@@ -1117,6 +1189,18 @@ Tue Nov 9 15:33:43 1999 Andrew Cagney <cagney@b1.cygnus.com>
* utils.c (floatformat_to_doublest): Fix conversion of denormals.
+1999-11-08 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * breakpoint.c (hbreak_command_wrapper): New function, to export
+ hbreak_command.
+ (thbreak_command_wrapper): New function, to export thbreak_command.
+
+ * symtab.c (rbreak_command_wrapper): New function, to export
+ rbreak_command.
+
+ * breakpoint.h (hbreak_command_wrapper, thbreak_command_wrapper,
+ rbreak_command_wrapper): Export.
+
Mon Nov 8 20:14:13 1999 Andrew Cagney <cagney@amy.cygnus.com>
* remote.c (get_memory_read_packet_size): For moment limit read
@@ -1131,6 +1215,9 @@ Mon Nov 8 20:14:13 1999 Andrew Cagney <cagney@amy.cygnus.com>
Mon Nov 8 18:18:07 1999 Andrew Cagney <cagney@b1.cygnus.com>
* defs.h, utils.c (gdb_file_deallocate): Delete.
+ * varobj.c (varobj_get_type, c_value_of_variable): Use
+ make_cleanup_gdb_file_delete.
+ * ui-out.c (ui_out_stream_delete): Use gdb_file_delete.
* corefile.c (memory_error): Use make_cleanup_gdb_file_delete.
* defs.h, utils.c (gdb_file_init_astring): Delete.
@@ -1139,6 +1226,8 @@ Mon Nov 8 18:18:07 1999 Andrew Cagney <cagney@b1.cygnus.com>
gdb_file_get_strbuf.
(tui_file_adjust_strbuf): Rename gdb_file_adjust_strbuf.
* utils.c (error_stream, error_last_message): Update.
+ * varobj.c (varobj_get_type, c_value_of_variable): Update.
+ * ui-out.c (ui_out_field_stream): Update.
Mon Nov 8 16:28:00 1999 Andrew Cagney <cagney@b1.cygnus.com>
@@ -1226,6 +1315,10 @@ Sun Nov 7 18:09:54 1999 Andrew Cagney <cagney@b1.cygnus.com>
(procfs_thread_alive): Remove unused variables, conditionalize
vars declarations to eliminate compiler warnings.
+1999-11-05 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * infcmd.c (print_return_value): Add output for UI.
+
Fri Nov 5 16:32:04 1999 Andrew Cagney <cagney@b1.cygnus.com>
* inferior.h (CALL_DUMMY_ADDRESS, CALL_DUMMY_START_OFFSET,
@@ -1267,8 +1360,18 @@ Fri Nov 5 16:32:04 1999 Andrew Cagney <cagney@b1.cygnus.com>
1999-11-04 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+ * breakpoint.c (print_it_typical): Print reason for stopping in
+ case of bp_finish.
+
+1999-11-04 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
* infrun.c (handle_inferior_event): Add calls to print_stop_reason()
for end of stepping range cases.
+ (print_stop_reason): Add output for END_STEPPING_RANGE, EXITED,
+ SIGNAL_EXITED, SIGNAL_RECEIVED cases.
+
+ * breakpoint.c (print_it_typical): Add printing of stop reason for
+ bp_breakpoint case.
Thu Nov 4 17:46:36 1999 Andrew Cagney <cagney@b1.cygnus.com>
@@ -1466,6 +1569,11 @@ Thu Nov 4 17:36:27 1999 Andrew Cagney <cagney@b1.cygnus.com>
be unreliable above 9600), and the EPI Jeeni seems to run at
38.4K.
+1999-11-01 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * stack.c (print_frame_info_base): Do not change printing of stack
+ frame info if not running with our interpreter.
+
1999-11-01 Fernando Nasser <fnasser@totem.to.cygnus.com>
From Grant Edwards <grante@visi.com>:
@@ -1533,6 +1641,16 @@ Thu Nov 4 17:36:27 1999 Andrew Cagney <cagney@b1.cygnus.com>
* infcmd.c: Fix typo.
+1999-10-28 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * stack.c (select_frame_command_wrapper): Fix typo.
+
+ * infcmd.c (interrupt_target_command_wrapper): Wrapper to allow use of
+ static interrupt_target_command outside of file.
+
+ * stack.c (select_frame_command_wrapper): Wrapper to allow use of
+ static select_frame_command outside of file.
+
1999-10-28 Jim Blandy <jimb@cygnus.com>
* gdbtypes.c (init_simd_type): The upper bound to
@@ -1618,6 +1736,14 @@ Thu Nov 4 17:36:27 1999 Andrew Cagney <cagney@b1.cygnus.com>
* arm-tdep.c (THUMB_BE_BREAKPOINT): Change to 0xbebe.
(THUMB_LE_BREAKPOINT): Change to 0xbebe.
+1999-10-25 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * stack.c (print_frame_info_base): Don't print the arguments
+ during a backtrace.
+ * stack.c (print_frame_info_base): When setting source to 0, save
+ and restore old value. Do this only if source is greater than
+ zero.
+
Mon Oct 25 18:22:06 1999 Andrew Cagney <cagney@b1.cygnus.com>
* remote.c: Document future of compare_sections_command.
@@ -1644,6 +1770,12 @@ Sat Oct 23 16:39:34 1999 Andrew Cagney <cagney@b1.cygnus.com>
* gdbarch.h (initialize_current_architecture): Declare.
* gdbarch.c (initialize_current_architecture): New function.
+1999-10-22 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * stack.c (print_frame_info_base): Check for value of source
+ parameter equal to 2, and print address anyway. Set source to 0
+ later, to avoid printing file & line info again.
+
1999-10-21 Michael Snyder <msnyder@cleaver.cygnus.com>
* utils.c (chars_per_line): fix typo in comment.
@@ -1691,6 +1823,9 @@ Sat Oct 23 16:39:34 1999 Andrew Cagney <cagney@b1.cygnus.com>
1999-10-18 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+ * stack.c (print_frame_info_base): Add printing of list
+ begin and end.
+
* breakpoint.h: Change return type of field print_it of struct
bpstats to enumeration print_stop_action.
Define new enumeration print_stop_action.
@@ -2160,6 +2295,13 @@ Thu Oct 7 19:24:05 1999 Andrew Cagney <cagney@b1.cygnus.com>
1999-10-04 Fernando Nasser <fnasser@totem.to.cygnus.com>
+ * varobj.c (varobj_get_type): Call tui_sfileopen() instead of
+ deprecated gdb_file_init_astream().
+ (c_value_of_variable): Ditto.
+ * ui-out.c (ui_out_stream_new): Ditto.
+
+1999-10-04 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
* utils.c (tui_sfileopen): New function. Replaces
gdb_file_init_astring().
* defs.h: Add prototype for the above.
@@ -2402,6 +2544,7 @@ Wed Sep 29 21:27:16 1999 Jeffrey A Law (law@cygnus.com)
* remote-sim.c (gdbsim_create_inferior): Ditto.
* target.c (target_link): Ditto.
* win32-nat.c (child_create_inferior): Ditto.
+ * varobj.c (varobj_create, new_root_variable): Ditto.
Thu Sep 30 10:36:19 1999 Andrew Cagney <cagney@b1.cygnus.com>
@@ -2737,6 +2880,16 @@ Thu Sep 23 20:48:22 1999 Andrew Cagney <cagney@b1.cygnus.com>
than stdout, so they don't get mixed into the result stream from
commands.
+1999-09-23 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * varobj.c (varobj_set_value): Fix handling of baseclasses and
+ correct the behavior when it is not a baseclass (both cases were
+ dumping core).
+
+1999-09-23 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * varobj.c (varobj_update): Fix setting of child error field.
+
1999-09-23 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* event-loop.c (poll_timers): Use correct timeval field names,
@@ -2744,6 +2897,12 @@ Thu Sep 23 20:48:22 1999 Andrew Cagney <cagney@b1.cygnus.com>
(gdb_wait_for_event): Pass a pointer to the timeout structure to
select(), not the structure.
+1999-09-23 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * varobj.c (varobj_gen_name): Dynamically allocate variable object
+ name string.
+ (varobj_update): Fix creation of result list.
+
Wed Sep 22 10:35:32 1999 Andrew Cagney <cagney@b1.cygnus.com>
* Makefile.in (init.c): Change generated file to include "defs.h"
@@ -2760,6 +2919,27 @@ Wed Sep 22 10:35:32 1999 Andrew Cagney <cagney@b1.cygnus.com>
* procfs.c (init_procinfo): move fltset initialization to caller.
(do_attach, create_procinfo): initialize fltset.
+1999-09-22 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * varobj.c (_initialize_varobj): Rename varobjdebug to debugvarobj
+ to avoid conflict with "set var".
+
+1999-09-22 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * varobj.c (varobj_get_type, c_value_of_variable): Remove
+ dependency on ui_out.[ch].
+
+1999-09-22 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * varobj.c (varobj_update): Fix order in which changed variables
+ are reported to match that of the old code.
+
+1999-09-22 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * varobj.c (type_changeable): Fix for testsuite case 2.12. Do not
+ report as changed a structure when one of it's children has changed.
+ (get_type, get_type_deref): Remove uneeded initialization.
+
1999-09-22 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* event-loop.c, event-top.c, event-loop.h: Rerun indent.
@@ -2768,6 +2948,18 @@ Wed Sep 22 10:35:32 1999 Andrew Cagney <cagney@b1.cygnus.com>
* m32r-stub.c (handle_exception): Fix typo in patch of 1999-08-26.
+1999-09-21 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * varobj.c (_initialize_varobj): Add set/show for varobjdebug.
+ (uninstall_variable): Test for varobjdebug before printing trace
+ and send it to gdb_stdlog.
+
+1999-09-21 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * varobj.c (c_type_of_child): Fix missing break, improve comment
+ and add warning.
+ (c_number_of_children): Add comment.
+
Tue Sep 21 14:55:29 1999 Andrew Cagney <cagney@b1.cygnus.com>
From 1999-08-20 J.T. Conklin <jtc@redback.com>:
@@ -2775,10 +2967,54 @@ Tue Sep 21 14:55:29 1999 Andrew Cagney <cagney@b1.cygnus.com>
inline as is done for the standard encoding.
(remote_cisco_expand): Removed.
+1999-09-20 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * varobj.c (varobj_update): Test for illegal invocation for
+ non-root variable object.
+
+1999-09-20 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * varobj.c (my_value_equal): Style. Eliminate side-effects.
+ (varobj_update): Adjust calls to reflect the above change.
+
+1999-09-20 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * varobj.c (c_value_of_variable): Fix return value for struct
+ members when parent is a invalid pointer.
+
1999-09-20 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* event-loop.c: Include <sys/time.h>.
+1999-09-20 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * varobj.c (cplus_number_of_children): Coding style improvement.
+ (cplus_value_of_child): Ditto.
+
+1999-09-20 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * varobj.c (c_name_of_child): Add missing default clause in switch
+ statement.
+ (c_type_of_child): Ditto.
+ (varobj_set_value): Test for NULL type.
+
+1999-09-20 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * varobj.c (varobj_set_value): Wrap call to evaluate_expression.
+
+1999-09-20 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * varobj.c (format_string[]): Remove unused variable(s).
+ (varobj_set_value): Ditto.
+ (c_value_of_root): Ditto.
+ (cplus_value_of_child): Ditto.
+
+1999-09-20 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * varobj.c: Add missing header file include.
+ (new_variable, new_root_variable): Fix prototype and header.
+ (_initialize_varobj): Add prototype.
+
1999-09-20 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* ser-ocd.c: (ser_ocd_open, ser_ocd_raw, ser_ocd_readchar,
@@ -2827,6 +3063,10 @@ Mon Sep 20 17:00:06 1999 Andrew Cagney <cagney@b1.cygnus.com>
of ``cleanup_sigint_signal_handler''.
* Makefile.in (infrun.o): Add dependency on remote.h.
+Mon Sep 20 16:15:29 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * ui-out.h (ui_out_test_flags): Add missing declaration.
+
Mon Sep 20 13:41:04 1999 Andrew Cagney <cagney@b1.cygnus.com>
* kod.c (ecos_kod_open, ecos_kod_request, ecos_kod_close,
@@ -2850,6 +3090,11 @@ Mon Sep 20 12:13:27 1999 Andrew Cagney <cagney@b1.cygnus.com>
declaration. Make static.
* event-top.c (rl_callback_read_char_wrapper): Ditto.
+Mon Sep 20 10:54:19 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * Makefile.in (varobj.o): Disable warnings. Currently
+ work-in-progress.
+
Fri Sep 17 19:28:17 1999 Andrew Cagney <cagney@b1.cygnus.com>
* source.c: Include "source.h".
@@ -2935,6 +3180,10 @@ Sat Sep 18 07:13:03 1999 Jeffrey A Law (law@cygnus.com)
* hppa-tdep.c (in_solib_call_trampoline): Handle PA64 shared library
trampolines.
+1999-09-17 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * wrapper.h: Add missing define brackets.
+
1999-09-17 Jim Blandy <jimb@zwingli.cygnus.com>
* breakpoint.c (permanent_breakpoint_here_p): Delete.
@@ -2957,6 +3206,24 @@ Sat Sep 18 07:13:03 1999 Jeffrey A Law (law@cygnus.com)
register width; pad aggregates smaller than eight bytes on the
right.
+1999-09-17 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * Makefile.in: Add entries for varobj.[cho] and wrapper.[cho].
+
+1999-09-17 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * varobj.h: New file. GDB variable objects API.
+ * varobj.c: New file. Implementation of the GDB variable objects
+ API.
+
+1999-09-17 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * wrapper.h: New file. Longjump free calls to gdb internal
+ routines.
+ * wrapper.c (gdb_evaluate_expression, wrap_evaluate_expression,
+ gdb_value_fetch_lazy, wrap_value_fetch_lazy, gdb_value_equal,
+ wrap_value_equal, gdb_value_ind, wrap_value_ind): New functions.
+
Thu Sep 16 17:33:35 1999 Andrew Cagney <cagney@b1.cygnus.com>
* remote.c (remote_async_open_1): Use SERIAL_ASYNC to
@@ -3101,8 +3368,6 @@ Tue Sep 14 14:34:28 1999 Andrew Cagney <cagney@b1.cygnus.com>
* defs.h (continuation): Make this a typedef.
- * Makefile.in (gdbtk.o, gdbtk-cmds.o): Depend on $(top_h).
-
* Makefile.in (i386-linux-nat.o): Depend on symfile.h, not
$(symfile_h); the latter has no definition.
@@ -3146,8 +3411,6 @@ Tue Sep 14 14:34:28 1999 Andrew Cagney <cagney@b1.cygnus.com>
__dld_break, which contains the permanent breakpoint, when interesting
things happen. Tell GDB that the breakpoint in __dld_break is
permanent.
- * gdbtk-cmds.c (gdb_get_breakpoint_info): Report a permanent
- breakpoint as enabled.
* infrun.c (SKIP_PERMANENT_BREAKPOINT): Provide default definition.
(default_skip_permanent_breakpoint): New function.
(resume): If we're trying to resume at a permanent breakpoint, use
@@ -3319,6 +3582,12 @@ Mon Sep 13 17:51:28 1999 Andrew Cagney <cagney@b1.cygnus.com>
* remote.c (_initialize_remote): Fix the specification of the
"remote" prefix to set and show commands.
+1999-09-09 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * command.c (print_doc_line): Update to use ui_out.
+ (do_setshow_command): Ditto.
+ (cmd_show_list): Ditto.
+
1999-09-09 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* event-loop.c (create_file_event): New function. Creates a gdb
@@ -4564,6 +4833,14 @@ Sun Aug 8 12:06:47 1999 Fred Fish <fnf@cygnus.com>
Also move Z packet support OUTSIDE of REMOTE_BREAKPOINT ifdef,
since this is not set for all targets that support the Z packet.
+Sun Aug 8 17:24:09 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * ui-out.c (ui_out_table_begin, ui_out_table_body,
+ ui_out_table_end, ui_out_table_header, ui_out_list_begin,
+ ui_out_list_end, ui_out_stream_new, verify_field_proper_position,
+ verify_field_alignment): Replace incorrect calls to error with
+ calls to internal_error.
+
Fri Aug 6 17:17:28 1999 Andrew Cagney <cagney@b1.cygnus.com>
* defs.h (fatal): Delete declaration.
@@ -4786,6 +5063,14 @@ Wed Aug 4 10:42:58 1999 Fred Fish <fnf@cygnus.com>
an array of 5 internal_auxent to leave room for bfd to
write n_numaux entries. Change code to use the first one.
+Wed Aug 4 19:58:15 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * ui-out.h (cli_out_new): Move declaration from here.
+ * cli-out.h: To here. New file.
+ * Makefile.in (ui-out.o): Add missing dependencies.
+ (cli-out.o): Ditto.
+ * top.c, cli-out.c: #include "cli-out.h".
+
1999-08-02 Stan Shebs <shebs@andros.cygnus.com>
* c-valprint.c (c_val_print): When printing decimal equivalent
@@ -4979,6 +5264,10 @@ Mon Jul 26 17:13:39 1999 Andrew Cagney <cagney@b1.cygnus.com>
* NEWS: Mention the new configs.
+1999-07-15 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * ui-out.c (struct ui_out): Remove deprecated fields.
+
1999-07-15 Fernando Nasser <fnasser@cygnus.com>
* target.c (target_preopen): Prevent query when not from_tty.
@@ -4988,6 +5277,16 @@ Mon Jul 26 17:13:39 1999 Andrew Cagney <cagney@b1.cygnus.com>
* event-loop.c: Fix typo in comment.
+1999-07-15 Fernando Nasser <fnasser@cygnus.com>
+
+ * breakpoint.c (breakpoint_1): Fix output when no breakpoins are
+ found.
+
+1999-07-15 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * event-top.c (display_gdb_prompt): Don't do anything if we are
+ running under the interpreter.
+
Wed Jul 14 17:29:31 1999 Andrew Cagney <cagney@b1.cygnus.com>
* ser-pipe.c (struct pipe_state): Define.
@@ -5416,6 +5715,11 @@ Wed Jun 30 15:45:48 1999 Jeffrey A Law (law@cygnus.com)
* main.c: Turn on async by default by setting async_p to 1.
+Wed Jun 23 20:39:24 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * main.c (main): Recognize --ui. Will eventually replace
+ --interpreter.
+
Wed Jun 23 15:44:39 1999 Andrew Cagney <cagney@b1.cygnus.com>
From Jimmy Guo <guo@cup.hp.com>:
@@ -5488,6 +5792,22 @@ Wed Jun 23 15:30:46 1999 Andrew Cagney <cagney@b1.cygnus.com>
is NULL, call find_proc_desc so we know how to restore
the registers.
+1999-06-16 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * cli-out.c (cli_out_new): Add flags argument to ui-out-new call.
+ * source.c (print_source_lines_base): Test for ui_source_list flag
+ and use ui_out for file and line output.
+ * ui-out.c (struct ui_out): Add flags field to struct and to default
+ initialization.
+ (ui_out_set_flags): New function. Handle flags.
+ (ui_out_clear_flags): New function. Ditto.
+ (ui_out_test_flags): New function. Ditto.
+ (ui_out_new): Add flags parameter.
+ * ui-out.h: Add flags argument to ui_out_new declaration.
+ Add declarations for ui_out_*_flags functions.
+ (enum ui_flags): New enum. Defines ui_out flags.
+ * top.c (gdb_init): Fix misspelling typo.
+
1999-06-15 Michael Snyder <msnyder@cleaver.cygnus.com>
* event-top.c (start_event_loop): call get_prompt.
@@ -5514,6 +5834,7 @@ Wed Jun 23 15:30:46 1999 Andrew Cagney <cagney@b1.cygnus.com>
(read_command_lines): rename "prompt" to prompt_arg for clarity.
(stop_sig): call get_prompt instead of reading prompt string directly.
(command_loop): ditto.
+ (simplified_command_loop): ditto.
(gdb_prompt_escape): New variable. Esc char for prompt parameters.
(get_prompt_1): New function, workhorse for get_prompt.
(get_prompt): Completely rewrite. Add functionality for a
@@ -5546,6 +5867,10 @@ Sun Jun 13 10:44:13 1999 Andrew Cagney <cagney@b1.cygnus.com>
Please examine your test suite output carefully, and report any
problems to me.
+1999-06-11 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * top.c (gdb_init): Add pre-processor test for UI_OUT.
+
1999-06-11 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* event-top.c (setup_event_loop): Change name to start_event_loop.
@@ -5570,6 +5895,57 @@ Fri Jun 11 18:34:33 1999 Andrew Cagney <cagney@b1.cygnus.com>
(tui_file_rewind, tui_file_put): New functions.
(tui_file_new): Add rewind and put.
+ * cli-out.c (cli_spaces): Replace gdb_stdout with data->stream.
+ (cli_text, cli_message, cli_flush, out_field_fmt,
+ field_separator): Ditto.
+
+Fri Jun 11 16:08:37 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * cli-out.c (cli_out_new): Replace init_cli_out,
+ * top.c (gdb_init): Call cli_out_new.
+ * main.c (main): Delete call to set_ui_out_impl.
+
+ * ui-out.h (set_ui_out_impl, cli_ui_out_impl), ui-out.c: Delete.
+ (cli_out_new): Add declaration. Will move later.
+
+ * ui-out.c (ui_out_new, ui_out_data), ui-out.h: New functions.
+ (struct ui_out): Add field data.
+ (ui_out_new): Replace init_ui_out_state.
+
+ * ui-out.c (XMALLOC): Define.
+ (ui_out_stream_new, append_header_to_list): Use XMALLOC instead of
+ xmalloc.
+ * cli-out.c (XMALLOC): Define.
+
+Fri Jun 11 10:31:29 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * ui-out.c (ui_out_field_int, ui_out_field_skip,
+ ui_out_field_fmt): Rewrite statements to remove infix operators.
+
+ * ui-out.c (get_curr_header, verify_field_proper_position,
+ verify_field_alignment, init_ui_out_state, set_ui_out_impl,
+ append_header_to_list): Add explicit ui_out parameter.
+ (struct ui_out): Move the local variables ``table_flag'',
+ ``body_flag'', ``table_columns'', ``table_id'', ``list_flat'',
+ ``field_count'', ``headerfirst'', ``headerlast'', ``headercurr''
+ into this struct.
+ (typedef ui_out_hdr): Delete.
+ (struct ui_out_hdr): Rename struct _ui_out_hdr.
+ (ui_out_table_begin, ui_out_table_end, ui_out_table_body,
+ ui_out_table_header, ui_out_field_int, ui_out_list_begin,
+ ui_out_table_end, ui_out_list_end, ui_out_field_skip,
+ ui_out_table_body, ui_out_list_begin, ui_out_list_end,
+ ui_out_field_string, ui_out_field_fmt, init_ui_out_state,
+ verify_field_proper_position, verify_field_alignment,
+ clear_header_list, append_header_to_list, _initialize_ui_out):
+ Update.
+
+ * ui-out.h (typedef streambuf): Delete.
+ (struct _streambuf): Rename to struct ui_stream.
+ * breakpoint.c (breakpoint_1), stack.c (print_frame_info_base),
+ printcmd.c (print_frame_args): Rename streambuf to struct
+ ui_stream.
+
Fri Jun 11 15:10:32 1999 Andrew Cagney <cagney@b1.cygnus.com>
* d10v-tdep.c (d10v_push_arguments): Fix order of arguments passed
@@ -5697,6 +6073,14 @@ Thu Jun 10 20:04:02 1999 Andrew Cagney <cagney@b1.cygnus.com>
mn10300-tdep.c: New function.
* config/mn10300/tm-mn10300.h (SAVED_PC_AFTER_CALL): Update.
+Wed Jun 9 16:42:16 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * top.h, top.c (simplified_command_loop): Make global.
+
+ * main.c (main): Delete call to call_interp_loop. Interpreters
+ hook in using command_loop_hook.
+ * top.c (call_interp_loop): Delete function.
+
1999-06-10 Keith Seitz <keiths@cygnus.com>
* mcore-rom.c (picobug_dumpregs): Return a value. Any value, it
@@ -5868,6 +6252,13 @@ Fri Jun 4 17:10:36 1999 Andrew Cagney <cagney@b1.cygnus.com>
FP_REGNUM, PC_REGNUM, NUM_REGS, REGISTER_NAME.
* d10v-tdep.c, config/d10v/tm-d10v.h: Update.
+1999-06-03 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * printcmd.c (print_frame_args): Convert some of the output to use
+ ui_out.
+ * stack.c (print_frame_info_base): Adjust the call to the above
+ function.
+
1999-06-03 Michael Snyder <msnyder@cleaver.cygnus.com>
* thread.c: eliminate the target_thread_vector (functionality
@@ -6090,6 +6481,21 @@ Tue Jun 1 10:45:24 1999 Andrew Cagney <cagney@b1.cygnus.com>
1999-05-31 Fernando Nasser <fnasser@totem.to.cygnus.com>
+ * breakpoint.c (print_it_normal): Convertion of part of the output
+ to use ui-out.
+ (mention): Same as above.
+ * infcmd.c (run_command): Same.
+ * source.c (print_source_lines_base): Same.
+ * stack.c (print_frame_info_base): Same.
+
+1999-05-31 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * breakpoint.c (breakpoint_1): Fix names of fields on ui_out
+ produced output.
+ * ui-out.h: Cosmetic change.
+
+1999-05-31 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
* stack.c (print_args_stub): Add missing stream parameter.
Mon May 31 15:50:08 1999 Andrew Cagney <cagney@b1.cygnus.com>
@@ -6098,6 +6504,21 @@ Mon May 31 15:50:08 1999 Andrew Cagney <cagney@b1.cygnus.com>
* valops.c, value.h (default_push_arguments): Fix order of
parameters to match PUSH_ARGUMENTS arguments.
+1999-05-28 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * top.c (print_command_lines): Simplified script format for
+ non-console output.
+
+1999-05-28 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * top.c (print_command_lines): Fixed printing of if clauses.
+ * breakpoint.c (breakpoint_1): Adjust call to the above.
+ * top.c (show_user_1): Same as above.
+
+1999-05-27 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * top.c (call_interp_loop): Correct build problem with UI_OUT defined.
+
Thu May 27 11:42:55 1999 Andrew Cagney <cagney@b1.cygnus.com>
* gdbarch.h (EXTRACT_STRUCT_VALUE_ADDRESS): Return 0.
@@ -6167,6 +6588,14 @@ Wed May 26 13:51:25 1999 Andrew Cagney <cagney@b1.cygnus.com>
gdb_file_get_strbuf, gdb_file_adjust_strbuf, tui_file_flush):
Verify ts_magic.
+1999-05-25 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * top.c (print_command_lines): New function, fix bug in printing
+ while commands and uses ui_out.
+ * gdbcmd.c: Add prototype for the above.
+ * breakpoint.c (breakpoint_1): Fix breakpoint script printing.
+ * command.c (show_user_1): Fix user command script printing.
+
1999-05-25 Jim Blandy <jimb@zwingli.cygnus.com>
* breakpoint.c (insert_breakpoints, remove_breakpoint,
@@ -6217,6 +6646,9 @@ Tue May 25 13:01:43 1999 Andrew Cagney <cagney@amy.cygnus.com>
* main.c (gdb_init): Move declaration from here.
* top.h: To here.
+ * main.c (call_interp_loop): Move declaration from here.
+ * top.h: To here.
+
* defs.h (init_page_info): Add declaration.
* top.c (initialize_utils): Move declaration from here.
@@ -6293,6 +6725,8 @@ Mon May 24 16:16:29 1999 Andrew Cagney <cagney@amy.cygnus.com>
demangle.c (_initialize_demangler), maint.c
(_initialize_maint_cmds), language.c (_initialize_language): Add
external declaration.
+ * ui-out.c (_initialize_ui_out), cli-out.c (_initialize_cli_out):
+ Ditto.
Mon May 24 10:04:56 1999 Andrew Cagney <cagney@b1.cygnus.com>
@@ -6406,6 +6840,34 @@ Fri May 21 11:23:54 1999 Andrew Cagney <cagney@b1.cygnus.com>
* rs6000-tdep.c (rs6000_push_arguments): Rename push_arguments.
+1999-05-21 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * breakpoint.c (breakpoint_1): Added ui_out output code but still
+ uses old code by default.
+
+1999-05-21 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * Makefile.in: Added ui-ou files.
+ * main.c (main): Install cli_out by default.
+ * ui-out.c (ui_out_table_begin): Use saved table id.
+
+1999-05-21 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * ui-out.h: Export implementation vectors so they can be
+ installed in main.c and top.c.
+
+1999-05-21 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * ui-out.h: New file. Defines the ui_out API.
+ * ui-out.c: New file. Implements the ui_out API abstraction only.
+ * cli-out.c: New file. Implements low-level ui-out primitives for
+ CLI-based interaction.
+
+1999-05-20 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * top.c (simplified_command_loop): Reformat using GNU style.
+ (call_interp_loop): Ditto.
+
Thu May 20 12:18:28 1999 Andrew Cagney <cagney@b1.cygnus.com>
* blockframe.c (get_prev_frame): Remove #ifdef around test for
@@ -6437,6 +6899,18 @@ Thu May 20 12:18:28 1999 Andrew Cagney <cagney@b1.cygnus.com>
* event-loop.c: Ditto.
* main.c: Ditto.
+1999-05-20 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * top.c (simplified_command_loop): New function. It is just a
+ bare minimal command_loop.
+ (call_interp_loop): New function. Call the correct version of the
+ command loop, with the appropriate input reading function,
+ depending on which interpreter gdb was invoked with.
+
+ * main.c (main): Recognize and handle the new command line option
+ --interpreter. If an interpreter is specified, call the appropriate
+ command handling function.
+
1999-05-19 Keith Seitz <keiths@cygnus.com>
* config/mcore/tm-mcore.h (BELIEVE_PCC_PROMOTION): Define. We
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index a97df49f9ff..e2215f1f057 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -229,7 +229,7 @@ CDEPS = $(XM_CDEPS) $(TM_CDEPS) $(NAT_CDEPS) $(SIM) $(BFD) $(READLINE) \
ADD_FILES = $(REGEX) $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES)
ADD_DEPS = $(REGEX1) $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES)
-VERSION = 20000201
+VERSION = 20000202
DIST=gdb
LINT=/usr/5bin/lint
@@ -388,6 +388,8 @@ SFILES = ax-general.c ax-gdb.c bcache.c blockframe.c breakpoint.c \
findvar.c gdbarch.c gdbtypes.c \
inf-loop.c infcmd.c inflow.c infrun.c language.c \
kod.c kod-cisco.c \
+ ui-out.c cli-out.c \
+ varobj.c wrapper.c \
jv-exp.y jv-lang.c jv-valprint.c jv-typeprint.c \
m2-exp.y m2-lang.c m2-typeprint.c m2-valprint.c main.c maint.c \
mem-break.c minsyms.c mipsread.c nlmread.c objfiles.c parse.c \
@@ -464,6 +466,8 @@ event_top_h = event-top.h
inf_loop_h = inf-loop.h
remote_h = remote.h
version_h = version.h
+ui_out_h = ui-out.h
+cli_out_h = cli-out.h
# Header files that need to have srcdir added. Note that in the cases
# where we use a macro like $(gdbcmd_h), things are carefully arranged
@@ -529,6 +533,8 @@ COMMON_OBS = version.o blockframe.o breakpoint.o findvar.o stack.o thread.o \
dbxread.o coffread.o elfread.o \
dwarfread.o dwarf2read.o mipsread.o stabsread.o corefile.o \
c-lang.o ch-exp.o ch-lang.o f-lang.o \
+ ui-out.o cli-out.o \
+ varobj.o wrapper.o \
jv-lang.o jv-valprint.o jv-typeprint.o \
m2-lang.o \
scm-exp.o scm-lang.o scm-valprint.o complaints.o typeprint.o \
@@ -1729,4 +1735,11 @@ m2-exp.tab.o: m2-exp.tab.c $(defs_h) $(expression_h) $(gdbtypes_h) \
gdb-events.o: gdb-events.c gdb-events.h $(defs_h) $(gdbcmd_h)
+ui-out.o: ui-out.c $(defs_h) $(ui_out_h) expression.h language.h
+cli-out.o: cli-out.c $(defs_h) $(ui_out_h) $(cli_out_h)
+varobj.o: varobj.c $(defs_h) $(frame_h) $(value_h) \
+ $(language_h) valprint.h varobj.h
+ $(CC) -c $(INTERNAL_WARN_CFLAGS) $(NO_WERROR_CFLAGS) $<
+wrapper.o: wrapper.c $(defs_h) $(frame_h) $(value_h) wrapper.h
+
### end of the gdb Makefile.in.
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index f10f66121ee..c3e9b5d42bc 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -103,6 +103,24 @@ struct frame_extra_info
int framereg;
};
+#define SWAP_TARGET_AND_HOST(buffer,len) \
+ do \
+ { \
+ if (TARGET_BYTE_ORDER != HOST_BYTE_ORDER) \
+ { \
+ char tmp; \
+ char *p = (char *)(buffer); \
+ char *q = ((char *)(buffer)) + len - 1; \
+ for (; p < q; p++, q--) \
+ { \
+ tmp = *q; \
+ *q = *p; \
+ *p = tmp; \
+ } \
+ } \
+ } \
+ while (0)
+
/* Will a function return an aggregate type in memory or in a
register? Return 0 if an aggregate type can be returned in a
register, 1 if it must be returned in memory. */
@@ -252,8 +270,9 @@ int
arm_pc_is_thumb_dummy (bfd_vma memaddr)
{
CORE_ADDR sp = read_sp ();
+ CORE_ADDR fp = read_fp ();
- if (PC_IN_CALL_DUMMY (memaddr, sp, sp + 64))
+ if (PC_IN_CALL_DUMMY (memaddr, sp, fp))
return caller_is_thumb;
else
return 0;
@@ -1227,10 +1246,22 @@ arm_push_arguments (int nargs, value_ptr * args, CORE_ADDR sp,
calling the function. */
if (TYPE_CODE_FLT == typecode && REGISTER_SIZE == len)
{
- float f = *(float *) val;
- dbl_arg = f;
- val = (char *) &dbl_arg;
+ float f;
+ double d;
+ char * bufo = (char *) &d;
+ char * bufd = (char *) &dbl_arg;
+
len = sizeof (double);
+ f = *(float *) val;
+ SWAP_TARGET_AND_HOST (&f, sizeof (float)); /* adjust endianess */
+ d = f;
+ /* We must revert the longwords so they get loaded into the
+ the right registers. */
+ memcpy (bufd, bufo + len / 2, len / 2);
+ SWAP_TARGET_AND_HOST (bufd, len / 2); /* adjust endianess */
+ memcpy (bufd + len / 2, bufo, len / 2);
+ SWAP_TARGET_AND_HOST (bufd + len / 2, len / 2); /* adjust endianess */
+ val = (char *) &dbl_arg;
}
#if 1
/* I don't know why this code was disable. The only logical use
@@ -1279,18 +1310,42 @@ arm_push_arguments (int nargs, value_ptr * args, CORE_ADDR sp,
void
arm_pop_frame (void)
{
- struct frame_info *frame = get_current_frame ();
int regnum;
- CORE_ADDR old_SP;
+ struct frame_info *frame = get_current_frame ();
+
+ if (!PC_IN_CALL_DUMMY(frame->pc, frame->frame, read_fp()))
+ {
+ CORE_ADDR old_SP;
- old_SP = read_register (frame->framereg);
- for (regnum = 0; regnum < NUM_REGS; regnum++)
- if (frame->fsr.regs[regnum] != 0)
- write_register (regnum,
+ old_SP = read_register (frame->framereg);
+ for (regnum = 0; regnum < NUM_REGS; regnum++)
+ if (frame->fsr.regs[regnum] != 0)
+ write_register (regnum,
read_memory_integer (frame->fsr.regs[regnum], 4));
- write_register (PC_REGNUM, FRAME_SAVED_PC (frame));
- write_register (SP_REGNUM, old_SP);
+ write_register (PC_REGNUM, FRAME_SAVED_PC (frame));
+ write_register (SP_REGNUM, old_SP);
+ }
+ else
+ {
+ CORE_ADDR sp;
+
+ sp = read_register (FP_REGNUM);
+ sp -= sizeof(CORE_ADDR); /* we don't care about this first word */
+
+ write_register (PC_REGNUM, read_memory_integer (sp, 4));
+ sp -= sizeof(CORE_ADDR);
+ write_register (SP_REGNUM, read_memory_integer (sp, 4));
+ sp -= sizeof(CORE_ADDR);
+ write_register (FP_REGNUM, read_memory_integer (sp, 4));
+ sp -= sizeof(CORE_ADDR);
+
+ for (regnum = 10; regnum >= 0; regnum--)
+ {
+ write_register (regnum, read_memory_integer (sp, 4));
+ sp -= sizeof(CORE_ADDR);
+ }
+ }
flush_cached_frames ();
}
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 6edfc62491b..c7b3ff69cbb 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -39,6 +39,9 @@
#include "annotate.h"
#include "symfile.h"
#include "objfiles.h"
+#ifdef UI_OUT
+#include "ui-out.h"
+#endif
#include "gdb-events.h"
@@ -1888,6 +1891,12 @@ static enum print_stop_action
print_it_typical (bs)
bpstat bs;
{
+#ifdef UI_OUT
+ struct cleanup *old_chain;
+ struct ui_stream *stb;
+ stb = ui_out_stream_new (uiout);
+ old_chain = make_cleanup ((make_cleanup_func) ui_out_stream_delete, stb);
+#endif /* UI_OUT */
/* bs->breakpoint_at can be NULL if it was a momentary breakpoint
which has since been deleted. */
if (bs->breakpoint_at == NULL)
@@ -1897,11 +1906,19 @@ print_it_typical (bs)
{
case bp_breakpoint:
case bp_hardware_breakpoint:
+#ifdef UI_OUT
+ annotate_breakpoint (bs->breakpoint_at->number);
+ ui_out_text (uiout, "\nBreakpoint ");
+ ui_out_field_int (uiout, "bkptno", bs->breakpoint_at->number);
+ ui_out_text (uiout, ", ");
+ return PRINT_SRC_AND_LOC;
+#else
/* I think the user probably only wants to see one breakpoint
number, not all of them. */
annotate_breakpoint (bs->breakpoint_at->number);
printf_filtered ("\nBreakpoint %d, ", bs->breakpoint_at->number);
return PRINT_SRC_AND_LOC;
+#endif
break;
case bp_shlib_event:
@@ -2034,6 +2051,18 @@ print_it_typical (bs)
if (bs->old_val != NULL)
{
annotate_watchpoint (bs->breakpoint_at->number);
+#ifdef UI_OUT
+ mention (bs->breakpoint_at);
+ ui_out_list_begin (uiout, "value");
+ ui_out_text (uiout, "\nOld value = ");
+ value_print (bs->old_val, stb->stream, 0, Val_pretty_default);
+ ui_out_field_stream (uiout, "old", stb);
+ ui_out_text (uiout, "\nNew value = ");
+ value_print (bs->breakpoint_at->val, stb->stream, 0, Val_pretty_default);
+ ui_out_field_stream (uiout, "new", stb);
+ ui_out_list_end (uiout);
+ ui_out_text (uiout, "\n");
+#else
mention (bs->breakpoint_at);
printf_filtered ("\nOld value = ");
value_print (bs->old_val, gdb_stdout, 0, Val_pretty_default);
@@ -2041,6 +2070,7 @@ print_it_typical (bs)
value_print (bs->breakpoint_at->val, gdb_stdout, 0,
Val_pretty_default);
printf_filtered ("\n");
+#endif
value_free (bs->old_val);
bs->old_val = NULL;
}
@@ -2049,15 +2079,49 @@ print_it_typical (bs)
break;
case bp_read_watchpoint:
+#ifdef UI_OUT
+ mention (bs->breakpoint_at);
+ ui_out_list_begin (uiout, "value");
+ ui_out_text (uiout, "\nValue = ");
+ value_print (bs->breakpoint_at->val, stb->stream, 0, Val_pretty_default);
+ ui_out_field_stream (uiout, "value", stb);
+ ui_out_list_end (uiout);
+ ui_out_text (uiout, "\n");
+#else
mention (bs->breakpoint_at);
printf_filtered ("\nValue = ");
value_print (bs->breakpoint_at->val, gdb_stdout, 0,
Val_pretty_default);
printf_filtered ("\n");
+#endif
return PRINT_UNKNOWN;
break;
case bp_access_watchpoint:
+#ifdef UI_OUT
+ if (bs->old_val != NULL)
+ {
+ annotate_watchpoint (bs->breakpoint_at->number);
+ mention (bs->breakpoint_at);
+ ui_out_list_begin (uiout, "value");
+ ui_out_text (uiout, "\nOld value = ");
+ value_print (bs->old_val, stb->stream, 0, Val_pretty_default);
+ ui_out_field_stream (uiout, "old", stb);
+ value_free (bs->old_val);
+ bs->old_val = NULL;
+ ui_out_text (uiout, "\nNew value = ");
+ }
+ else
+ {
+ mention (bs->breakpoint_at);
+ ui_out_field_string (uiout, "reason", "access-watchpoint-trigger");
+ ui_out_text (uiout, "\nValue = ");
+ }
+ value_print (bs->breakpoint_at->val, stb->stream, 0,Val_pretty_default);
+ ui_out_field_stream (uiout, "new", stb);
+ ui_out_list_end (uiout);
+ ui_out_text (uiout, "\n");
+#else
if (bs->old_val != NULL)
{
annotate_watchpoint (bs->breakpoint_at->number);
@@ -2076,6 +2140,7 @@ print_it_typical (bs)
value_print (bs->breakpoint_at->val, gdb_stdout, 0,
Val_pretty_default);
printf_filtered ("\n");
+#endif
return PRINT_UNKNOWN;
break;
@@ -2083,7 +2148,13 @@ print_it_typical (bs)
here. */
case bp_finish:
+ return PRINT_UNKNOWN;
+ break;
+
case bp_until:
+ return PRINT_UNKNOWN;
+ break;
+
case bp_none:
case bp_longjmp:
case bp_longjmp_resume:
@@ -2288,9 +2359,16 @@ watchpoint_check (p)
in this case, by the time we call print_it_typical() this bp
will be deleted already. So we have no choice but print the
information here. */
+#ifdef UI_OUT
+ ui_out_text (uiout, "\nWatchpoint ");
+ ui_out_field_int (uiout, "wpnum", bs->breakpoint_at->number);
+ ui_out_text (uiout, " deleted because the program has left the block in\n\
+which its expression is valid.\n");
+#else
printf_filtered ("\
Watchpoint %d deleted because the program has left the block in\n\
which its expression is valid.\n", bs->breakpoint_at->number);
+#endif
if (b->related_breakpoint)
b->related_breakpoint->disposition = del_at_next_stop;
@@ -3033,12 +3111,23 @@ print_one_breakpoint (struct breakpoint *b,
{"del", "dstp", "dis", "keep"};
static char bpenables[] = "nynny";
char wrap_indent[80];
+#ifdef UI_OUT
+ struct ui_stream *stb = ui_out_stream_new (uiout);
+ struct cleanup *old_chain = make_cleanup_ui_out_stream_delete (stb);
+#endif
annotate_record ();
+#ifdef UI_OUT
+ ui_out_list_begin (uiout, "bkpt");
+#endif
/* 1 */
annotate_field (0);
+#ifdef UI_OUT
+ ui_out_field_int (uiout, "number", b->number);
+#else
printf_filtered ("%-3d ", b->number);
+#endif
/* 2 */
annotate_field (1);
@@ -3046,15 +3135,28 @@ print_one_breakpoint (struct breakpoint *b,
|| ((int) b->type != bptypes[(int) b->type].type))
internal_error ("bptypes table does not describe type #%d.",
(int) b->type);
+#ifdef UI_OUT
+ ui_out_field_string (uiout, "type", bptypes[(int) b->type].description);
+#else
printf_filtered ("%-14s ", bptypes[(int) b->type].description);
+#endif
/* 3 */
annotate_field (2);
+#ifdef UI_OUT
+ ui_out_field_string (uiout, "disp", bpdisps[(int) b->disposition]);
+#else
printf_filtered ("%-4s ", bpdisps[(int) b->disposition]);
+#endif
/* 4 */
annotate_field (3);
+#ifdef UI_OUT
+ ui_out_field_fmt (uiout, "enabled", "%c", bpenables[(int) b->enable]);
+ ui_out_spaces (uiout, 2);
+#else
printf_filtered ("%-3c ", bpenables[(int) b->enable]);
+#endif
/* 5 and 6 */
strcpy (wrap_indent, " ");
@@ -3073,8 +3175,16 @@ print_one_breakpoint (struct breakpoint *b,
/* Field 4, the address, is omitted (which makes the columns
not line up too nicely with the headers, but the effect
is relatively readable). */
+#ifdef UI_OUT
+ if (addressprint)
+ ui_out_field_skip (uiout, "addr");
+ annotate_field (5);
+ print_expression (b->exp, stb->stream);
+ ui_out_field_stream (uiout, "what", stb);
+#else
annotate_field (5);
print_expression (b->exp, gdb_stdout);
+#endif
break;
case bp_catch_load:
@@ -3082,11 +3192,28 @@ print_one_breakpoint (struct breakpoint *b,
/* Field 4, the address, is omitted (which makes the columns
not line up too nicely with the headers, but the effect
is relatively readable). */
+#ifdef UI_OUT
+ if (addressprint)
+ ui_out_field_skip (uiout, "addr");
+ annotate_field (5);
+ if (b->dll_pathname == NULL)
+ {
+ ui_out_field_string (uiout, "what", "<any library>");
+ ui_out_spaces (uiout, 1);
+ }
+ else
+ {
+ ui_out_text (uiout, "library \"");
+ ui_out_field_string (uiout, "what", b->dll_pathname);
+ ui_out_text (uiout, "\" ");
+ }
+#else
annotate_field (5);
if (b->dll_pathname == NULL)
printf_filtered ("<any library> ");
else
printf_filtered ("library \"%s\" ", b->dll_pathname);
+#endif
break;
case bp_catch_fork:
@@ -3094,34 +3221,74 @@ print_one_breakpoint (struct breakpoint *b,
/* Field 4, the address, is omitted (which makes the columns
not line up too nicely with the headers, but the effect
is relatively readable). */
+#ifdef UI_OUT
+ if (addressprint)
+ ui_out_field_skip (uiout, "addr");
+ annotate_field (5);
+ if (b->forked_inferior_pid != 0)
+ {
+ ui_out_text (uiout, "process ");
+ ui_out_field_int (uiout, "what", b->forked_inferior_pid);
+ ui_out_spaces (uiout, 1);
+ }
+#else
annotate_field (5);
if (b->forked_inferior_pid != 0)
printf_filtered ("process %d ", b->forked_inferior_pid);
break;
+#endif
case bp_catch_exec:
/* Field 4, the address, is omitted (which makes the columns
not line up too nicely with the headers, but the effect
is relatively readable). */
+#ifdef UI_OUT
+ if (addressprint)
+ ui_out_field_skip (uiout, "addr");
+ annotate_field (5);
+ if (b->exec_pathname != NULL)
+ {
+ ui_out_text (uiout, "program \"");
+ ui_out_field_string (uiout, "what", b->exec_pathname);
+ ui_out_text (uiout, "\" ");
+ }
+#else
annotate_field (5);
if (b->exec_pathname != NULL)
printf_filtered ("program \"%s\" ", b->exec_pathname);
+#endif
break;
case bp_catch_catch:
/* Field 4, the address, is omitted (which makes the columns
not line up too nicely with the headers, but the effect
is relatively readable). */
+#ifdef UI_OUT
+ if (addressprint)
+ ui_out_field_skip (uiout, "addr");
+ annotate_field (5);
+ ui_out_field_string (uiout, "what", "exception catch");
+ ui_out_spaces (uiout, 1);
+#else
annotate_field (5);
printf_filtered ("exception catch ");
+#endif
break;
case bp_catch_throw:
/* Field 4, the address, is omitted (which makes the columns
not line up too nicely with the headers, but the effect
is relatively readable). */
+#ifdef UI_OUT
+ if (addressprint)
+ ui_out_field_skip (uiout, "addr");
+ annotate_field (5);
+ ui_out_field_string (uiout, "what", "exception throw");
+ ui_out_spaces (uiout, 1);
+#else
annotate_field (5);
printf_filtered ("exception throw ");
+#endif
break;
case bp_breakpoint:
@@ -3136,6 +3303,35 @@ print_one_breakpoint (struct breakpoint *b,
case bp_call_dummy:
case bp_shlib_event:
case bp_thread_event:
+#ifdef UI_OUT
+ if (addressprint)
+ {
+ annotate_field (4);
+ ui_out_field_core_addr (uiout, "addr", b->address);
+ }
+ annotate_field (5);
+ *last_addr = b->address;
+ if (b->source_file)
+ {
+ sym = find_pc_sect_function (b->address, b->section);
+ if (sym)
+ {
+ ui_out_text (uiout, "in ");
+ ui_out_field_string (uiout, "func",
+ SYMBOL_SOURCE_NAME (sym));
+ ui_out_wrap_hint (uiout, wrap_indent);
+ ui_out_text (uiout, " at ");
+ }
+ ui_out_field_string (uiout, "file", b->source_file);
+ ui_out_text (uiout, ":");
+ ui_out_field_int (uiout, "line", b->line_number);
+ }
+ else
+ {
+ print_address_symbolic (b->address, stb->stream, demangle, "");
+ ui_out_field_stream (uiout, "at", stb);
+ }
+#else
if (addressprint)
{
annotate_field (4);
@@ -3163,64 +3359,125 @@ print_one_breakpoint (struct breakpoint *b,
}
else
print_address_symbolic (b->address, gdb_stdout, demangle, " ");
+#endif
break;
}
if (b->thread != -1)
{
+#ifdef UI_OUT
+ /* FIXME: This seems to be redundant and lost here; see the
+ "stop only in" line a little further down. */
+ ui_out_text (uiout, " thread ");
+ ui_out_field_int (uiout, "thread", b->thread);
+#else
printf_filtered (" thread %d", b->thread);
+#endif
}
+#ifdef UI_OUT
+ ui_out_text (uiout, "\n");
+#else
printf_filtered ("\n");
+#endif
if (b->frame)
{
annotate_field (6);
+#ifdef UI_OUT
+ ui_out_text (uiout, "\tstop only in stack frame at ");
+ ui_out_field_core_addr (uiout, "frame", b->frame);
+ ui_out_text (uiout, "\n");
+#else
printf_filtered ("\tstop only in stack frame at ");
print_address_numeric (b->frame, 1, gdb_stdout);
printf_filtered ("\n");
+#endif
}
if (b->cond)
{
annotate_field (7);
+#ifdef UI_OUT
+ ui_out_text (uiout, "\tstop only if ");
+ print_expression (b->cond, stb->stream);
+ ui_out_field_stream (uiout, "cond", stb);
+ ui_out_text (uiout, "\n");
+#else
printf_filtered ("\tstop only if ");
print_expression (b->cond, gdb_stdout);
printf_filtered ("\n");
+#endif
}
if (b->thread != -1)
{
/* FIXME should make an annotation for this */
+#ifdef UI_OUT
+ ui_out_text (uiout, "\tstop only in thread ");
+ ui_out_field_int (uiout, "thread", b->thread);
+ ui_out_text (uiout, "\n");
+#else
printf_filtered ("\tstop only in thread %d\n", b->thread);
+#endif
}
if (show_breakpoint_hit_counts && b->hit_count)
{
/* FIXME should make an annotation for this */
+#ifdef UI_OUT
+ if (ep_is_catchpoint (b))
+ ui_out_text (uiout, "\tcatchpoint");
+ else
+ ui_out_text (uiout, "\tbreakpoint");
+ ui_out_text (uiout, " already hit ");
+ ui_out_field_int (uiout, "times", b->hit_count);
+ if (b->hit_count == 1)
+ ui_out_text (uiout, " time\n");
+ else
+ ui_out_text (uiout, " times\n");
+#else
if (ep_is_catchpoint (b))
printf_filtered ("\tcatchpoint");
else
printf_filtered ("\tbreakpoint");
printf_filtered (" already hit %d time%s\n",
b->hit_count, (b->hit_count == 1 ? "" : "s"));
+#endif
}
+
if (b->ignore_count)
{
annotate_field (8);
+#ifdef UI_OUT
+ ui_out_text (uiout, "\tignore next ");
+ ui_out_field_int (uiout, "ignore", b->ignore_count);
+ ui_out_text (uiout, " hits\n");
+#else
printf_filtered ("\tignore next %d hits\n", b->ignore_count);
+#endif
}
if ((l = b->commands))
{
annotate_field (9);
+#ifdef UI_OUT
+ ui_out_list_begin (uiout, "script");
+ print_command_lines (uiout, l, 4);
+ ui_out_list_end (uiout);
+#else
while (l)
{
print_command_line (l, 4, gdb_stdout);
l = l->next;
}
+#endif
}
+#ifdef UI_OUT
+ ui_out_list_end (uiout);
+ do_cleanups (old_chain);
+#endif
}
struct captured_breakpoint_query_args
@@ -3269,6 +3526,13 @@ breakpoint_1 (bnum, allflag)
CORE_ADDR last_addr = (CORE_ADDR) -1;
int found_a_breakpoint = 0;
+#ifdef UI_OUT
+ if (addressprint)
+ ui_out_table_begin (uiout, 6, "BreakpointTable");
+ else
+ ui_out_table_begin (uiout, 5, "BreakpointTable");
+#endif /* UI_OUT */
+
ALL_BREAKPOINTS (b)
if (bnum == -1
|| bnum == b->number)
@@ -3294,6 +3558,24 @@ breakpoint_1 (bnum, allflag)
if (!found_a_breakpoint++)
{
annotate_breakpoints_headers ();
+#ifdef UI_OUT
+ annotate_field (0);
+ ui_out_table_header (uiout, 3, ui_left, "Num"); /* 1 */
+ annotate_field (1);
+ ui_out_table_header (uiout, 14, ui_left, "Type"); /* 2 */
+ annotate_field (2);
+ ui_out_table_header (uiout, 4, ui_left, "Disp"); /* 3 */
+ annotate_field (3);
+ ui_out_table_header (uiout, 3, ui_left, "Enb"); /* 4 */
+ if (addressprint)
+ {
+ annotate_field (4);
+ ui_out_table_header (uiout, 10, ui_left, "Address"); /* 5 */
+ }
+ annotate_field (5);
+ ui_out_table_header (uiout, 40, ui_noalign, "What"); /* 6 */
+ ui_out_table_body (uiout);
+#else
annotate_field (0);
printf_filtered ("Num ");
annotate_field (1);
@@ -3309,6 +3591,7 @@ breakpoint_1 (bnum, allflag)
}
annotate_field (5);
printf_filtered ("What\n");
+#endif /* UI_OUT */
annotate_breakpoints_table ();
}
@@ -3317,10 +3600,18 @@ breakpoint_1 (bnum, allflag)
if (!found_a_breakpoint)
{
+#ifdef UI_OUT
+ if (bnum == -1)
+ ui_out_message (uiout, 0, "No breakpoints or watchpoints.\n");
+ else
+ ui_out_message (uiout, 0, "No breakpoint or watchpoint number %d.\n",
+ bnum);
+#else
if (bnum == -1)
printf_filtered ("No breakpoints or watchpoints.\n");
else
printf_filtered ("No breakpoint or watchpoint number %d.\n", bnum);
+#endif /* UI_OUT */
}
else
{
@@ -3330,6 +3621,9 @@ breakpoint_1 (bnum, allflag)
set_next_address (last_addr);
}
+#ifdef UI_OUT
+ ui_out_table_end (uiout);
+#endif /* UI_OUT */
/* FIXME? Should this be moved up so that it is only called when
there have been breakpoints? */
annotate_breakpoints_table_end ();
@@ -4070,6 +4364,13 @@ mention (b)
struct breakpoint *b;
{
int say_where = 0;
+#ifdef UI_OUT
+ struct cleanup *old_chain;
+ struct ui_stream *stb;
+
+ stb = ui_out_stream_new (uiout);
+ old_chain = make_cleanup ((make_cleanup_func) ui_out_stream_delete, stb);
+#endif /* UI_OUT */
/* FIXME: This is misplaced; mention() is called by things (like hitting a
watchpoint) other than breakpoint creation. It should be possible to
@@ -4085,6 +4386,26 @@ mention (b)
case bp_none:
printf_filtered ("(apparently deleted?) Eventpoint %d: ", b->number);
break;
+#ifdef UI_OUT
+ case bp_watchpoint:
+ ui_out_text (uiout, "Watchpoint ");
+ ui_out_list_begin (uiout, "wpt");
+ ui_out_field_int (uiout, "number", b->number);
+ ui_out_text (uiout, ": ");
+ print_expression (b->exp, stb->stream);
+ ui_out_field_stream (uiout, "exp", stb);
+ ui_out_list_end (uiout);
+ break;
+ case bp_hardware_watchpoint:
+ ui_out_text (uiout, "Hardware watchpoint ");
+ ui_out_list_begin (uiout, "wpt");
+ ui_out_field_int (uiout, "number", b->number);
+ ui_out_text (uiout, ": ");
+ print_expression (b->exp, stb->stream);
+ ui_out_field_stream (uiout, "exp", stb);
+ ui_out_list_end (uiout);
+ break;
+#else
case bp_watchpoint:
printf_filtered ("Watchpoint %d: ", b->number);
print_expression (b->exp, gdb_stdout);
@@ -4093,6 +4414,27 @@ mention (b)
printf_filtered ("Hardware watchpoint %d: ", b->number);
print_expression (b->exp, gdb_stdout);
break;
+#endif
+#ifdef UI_OUT
+ case bp_read_watchpoint:
+ ui_out_text (uiout, "Hardware read watchpoint ");
+ ui_out_list_begin (uiout, "hw-rwpt");
+ ui_out_field_int (uiout, "number", b->number);
+ ui_out_text (uiout, ": ");
+ print_expression (b->exp, stb->stream);
+ ui_out_field_stream (uiout, "exp", stb);
+ ui_out_list_end (uiout);
+ break;
+ case bp_access_watchpoint:
+ ui_out_text (uiout, "Hardware access (read/write) watchpoint ");
+ ui_out_list_begin (uiout, "hw-awpt");
+ ui_out_field_int (uiout, "number", b->number);
+ ui_out_text (uiout, ": ");
+ print_expression (b->exp, stb->stream);
+ ui_out_field_stream (uiout, "exp", stb);
+ ui_out_list_end (uiout);
+ break;
+#else
case bp_read_watchpoint:
printf_filtered ("Hardware read watchpoint %d: ", b->number);
print_expression (b->exp, gdb_stdout);
@@ -4102,6 +4444,7 @@ mention (b)
b->number);
print_expression (b->exp, gdb_stdout);
break;
+#endif
case bp_breakpoint:
printf_filtered ("Breakpoint %d", b->number);
say_where = 1;
@@ -4160,6 +4503,9 @@ mention (b)
TUIDO (((TuiOpaqueFuncPtr) tui_vAllSetHasBreakAt, b, 1));
TUIDO (((TuiOpaqueFuncPtr) tuiUpdateAllExecInfos));
}
+#ifdef UI_OUT
+ do_cleanups (old_chain);
+#endif
printf_filtered ("\n");
}
@@ -5180,6 +5526,15 @@ can_use_hardware_watchpoint (v)
return found_memory_cnt;
}
+#ifdef UI_OUT
+void
+watch_command_wrapper (arg, from_tty)
+ char *arg;
+ int from_tty;
+{
+ watch_command (arg, from_tty);
+}
+#endif
static void
watch_command (arg, from_tty)
char *arg;
@@ -5188,6 +5543,15 @@ watch_command (arg, from_tty)
watch_command_1 (arg, hw_write, from_tty);
}
+#ifdef UI_OUT
+void
+rwatch_command_wrapper (arg, from_tty)
+ char *arg;
+ int from_tty;
+{
+ rwatch_command (arg, from_tty);
+}
+#endif
static void
rwatch_command (arg, from_tty)
char *arg;
@@ -5196,6 +5560,15 @@ rwatch_command (arg, from_tty)
watch_command_1 (arg, hw_read, from_tty);
}
+#ifdef UI_OUT
+void
+awatch_command_wrapper (arg, from_tty)
+ char *arg;
+ int from_tty;
+{
+ awatch_command (arg, from_tty);
+}
+#endif
static void
awatch_command (arg, from_tty)
char *arg;
diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h
index d0aa8bd661a..f8358a9fa12 100644
--- a/gdb/breakpoint.h
+++ b/gdb/breakpoint.h
@@ -551,6 +551,12 @@ extern void breakpoint_clear_ignore_counts PARAMS ((void));
extern void break_command PARAMS ((char *, int));
+extern void hbreak_command_wrapper PARAMS ((char *, int));
+extern void thbreak_command_wrapper PARAMS ((char *, int));
+extern void rbreak_command_wrapper PARAMS ((char *, int));
+extern void watch_command_wrapper PARAMS ((char *, int));
+extern void awatch_command_wrapper PARAMS ((char *, int));
+extern void rwatch_command_wrapper PARAMS ((char *, int));
extern void tbreak_command PARAMS ((char *, int));
extern int insert_breakpoints PARAMS ((void));
diff --git a/gdb/cli-out.c b/gdb/cli-out.c
index 2f2c0aa6405..d906510aba3 100644
--- a/gdb/cli-out.c
+++ b/gdb/cli-out.c
@@ -1,8 +1,5 @@
/* Output generating routines for GDB CLI.
-
- Copyright (C) 1999, 2000, 2002, 2003, 2005, 2007, 2008
- Free Software Foundation, Inc.
-
+ Copyright 1999-2000 Free Software Foundation, Inc.
Contributed by Cygnus Solutions.
Written by Fernando Nasser for Cygnus.
@@ -10,7 +7,7 @@
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
+ the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@@ -19,53 +16,50 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
#include "defs.h"
#include "ui-out.h"
#include "cli-out.h"
-#include "gdb_string.h"
-#include "gdb_assert.h"
+
+/* Convenience macro for allocting typesafe memory. */
+
+#ifndef XMALLOC
+#define XMALLOC(TYPE) (TYPE*) xmalloc (sizeof (TYPE))
+#endif
struct ui_out_data
{
struct ui_file *stream;
- struct ui_file *original_stream;
- int suppress_output;
};
-typedef struct ui_out_data cli_out_data;
/* These are the CLI output functions */
-static void cli_table_begin (struct ui_out *uiout, int nbrofcols,
- int nr_rows, const char *tblid);
+static void cli_table_begin (struct ui_out *uiout, int nbrofcols, char *tblid);
static void cli_table_body (struct ui_out *uiout);
static void cli_table_end (struct ui_out *uiout);
static void cli_table_header (struct ui_out *uiout, int width,
- enum ui_align alig, const char *col_name,
- const char *colhdr);
-static void cli_begin (struct ui_out *uiout, enum ui_out_type type,
- int level, const char *lstid);
-static void cli_end (struct ui_out *uiout, enum ui_out_type type, int level);
+ enum ui_align alig, char *colhdr);
+static void cli_list_begin (struct ui_out *uiout, int list_flag, char *lstid);
+static void cli_list_end (struct ui_out *uiout, int list_flag);
static void cli_field_int (struct ui_out *uiout, int fldno, int width,
- enum ui_align alig, const char *fldname, int value);
+ enum ui_align alig, char *fldname, int value);
static void cli_field_skip (struct ui_out *uiout, int fldno, int width,
- enum ui_align alig, const char *fldname);
+ enum ui_align alig, char *fldname);
static void cli_field_string (struct ui_out *uiout, int fldno, int width,
- enum ui_align alig, const char *fldname,
+ enum ui_align alig, char *fldname,
const char *string);
static void cli_field_fmt (struct ui_out *uiout, int fldno,
int width, enum ui_align align,
- const char *fldname, const char *format,
- va_list args) ATTR_FORMAT (printf, 6, 0);
+ char *fldname, char *format, va_list args);
static void cli_spaces (struct ui_out *uiout, int numspaces);
-static void cli_text (struct ui_out *uiout, const char *string);
-static void cli_message (struct ui_out *uiout, int verbosity,
- const char *format, va_list args)
- ATTR_FORMAT (printf, 3, 0);
+static void cli_text (struct ui_out *uiout, char *string);
+static void cli_message (struct ui_out *uiout, int verbosity, char *format,
+ va_list args);
static void cli_wrap_hint (struct ui_out *uiout, char *identstring);
static void cli_flush (struct ui_out *uiout);
-static int cli_redirect (struct ui_out *uiout, struct ui_file *outstream);
/* This is the CLI ui-out implementation functions vector */
@@ -78,8 +72,8 @@ static struct ui_out_impl cli_ui_out_impl =
cli_table_body,
cli_table_end,
cli_table_header,
- cli_begin,
- cli_end,
+ cli_list_begin,
+ cli_list_end,
cli_field_int,
cli_field_skip,
cli_field_string,
@@ -88,20 +82,17 @@ static struct ui_out_impl cli_ui_out_impl =
cli_text,
cli_message,
cli_wrap_hint,
- cli_flush,
- cli_redirect,
- 0, /* Does not need MI hacks (i.e. needs CLI hacks). */
+ cli_flush
};
/* Prototypes for local functions */
-extern void _initialize_cli_out (void);
+extern void _initialize_cli_out PARAMS ((void));
static void field_separator (void);
-static void out_field_fmt (struct ui_out *uiout, int fldno,
- const char *fldname,
- const char *format,...) ATTR_FORMAT (printf, 4, 5);
+static void out_field_fmt (struct ui_out *uiout, int fldno, char *fldname,
+ char *format,...);
/* local variables */
@@ -110,27 +101,19 @@ static void out_field_fmt (struct ui_out *uiout, int fldno,
/* Mark beginning of a table */
void
-cli_table_begin (struct ui_out *uiout, int nbrofcols,
- int nr_rows,
- const char *tblid)
+cli_table_begin (uiout, nbrofcols, tblid)
+ struct ui_out *uiout;
+ int nbrofcols;
+ char *tblid;
{
- cli_out_data *data = ui_out_data (uiout);
- if (nr_rows == 0)
- data->suppress_output = 1;
- else
- /* Only the table suppresses the output and, fortunately, a table
- is not a recursive data structure. */
- gdb_assert (data->suppress_output == 0);
}
/* Mark beginning of a table body */
void
-cli_table_body (struct ui_out *uiout)
+cli_table_body (uiout)
+ struct ui_out *uiout;
{
- cli_out_data *data = ui_out_data (uiout);
- if (data->suppress_output)
- return;
/* first, close the table header line */
cli_text (uiout, "\n");
}
@@ -138,62 +121,55 @@ cli_table_body (struct ui_out *uiout)
/* Mark end of a table */
void
-cli_table_end (struct ui_out *uiout)
+cli_table_end (uiout)
+ struct ui_out *uiout;
{
- cli_out_data *data = ui_out_data (uiout);
- data->suppress_output = 0;
}
/* Specify table header */
void
-cli_table_header (struct ui_out *uiout, int width, enum ui_align alignment,
- const char *col_name,
- const char *colhdr)
+cli_table_header (uiout, width, alignment, colhdr)
+ struct ui_out *uiout;
+ int width;
+ int alignment;
+ char *colhdr;
{
- cli_out_data *data = ui_out_data (uiout);
- if (data->suppress_output)
- return;
cli_field_string (uiout, 0, width, alignment, 0, colhdr);
}
/* Mark beginning of a list */
void
-cli_begin (struct ui_out *uiout,
- enum ui_out_type type,
- int level,
- const char *id)
+cli_list_begin (uiout, list_flag, lstid)
+ struct ui_out *uiout;
+ int list_flag;
+ char *lstid;
{
- cli_out_data *data = ui_out_data (uiout);
- if (data->suppress_output)
- return;
}
/* Mark end of a list */
void
-cli_end (struct ui_out *uiout,
- enum ui_out_type type,
- int level)
+cli_list_end (uiout, list_flag)
+ struct ui_out *uiout;
+ int list_flag;
{
- cli_out_data *data = ui_out_data (uiout);
- if (data->suppress_output)
- return;
}
/* output an int field */
void
-cli_field_int (struct ui_out *uiout, int fldno, int width,
- enum ui_align alignment,
- const char *fldname, int value)
+cli_field_int (uiout, fldno, width, alignment, fldname, value)
+ struct ui_out *uiout;
+ int fldno;
+ int width;
+ int alignment;
+ char *fldname;
+ int value;
{
char buffer[20]; /* FIXME: how many chars long a %d can become? */
- cli_out_data *data = ui_out_data (uiout);
- if (data->suppress_output)
- return;
sprintf (buffer, "%d", value);
cli_field_string (uiout, fldno, width, alignment, fldname, buffer);
}
@@ -201,13 +177,13 @@ cli_field_int (struct ui_out *uiout, int fldno, int width,
/* used to ommit a field */
void
-cli_field_skip (struct ui_out *uiout, int fldno, int width,
- enum ui_align alignment,
- const char *fldname)
+cli_field_skip (uiout, fldno, width, alignment, fldname)
+ struct ui_out *uiout;
+ int fldno;
+ int width;
+ int alignment;
+ char *fldname;
{
- cli_out_data *data = ui_out_data (uiout);
- if (data->suppress_output)
- return;
cli_field_string (uiout, fldno, width, alignment, fldname, "");
}
@@ -218,17 +194,13 @@ void
cli_field_string (struct ui_out *uiout,
int fldno,
int width,
- enum ui_align align,
- const char *fldname,
+ int align,
+ char *fldname,
const char *string)
{
int before = 0;
int after = 0;
- cli_out_data *data = ui_out_data (uiout);
- if (data->suppress_output)
- return;
-
if ((align != ui_noalign) && string)
{
before = width - strlen (string);
@@ -263,19 +235,14 @@ cli_field_string (struct ui_out *uiout,
field_separator ();
}
-/* This is the only field function that does not align. */
+/* This is the only field function that does not align */
void
cli_field_fmt (struct ui_out *uiout, int fldno,
int width, enum ui_align align,
- const char *fldname,
- const char *format,
- va_list args)
+ char *fldname, char *format, va_list args)
{
- cli_out_data *data = ui_out_data (uiout);
- if (data->suppress_output)
- return;
-
+ struct ui_out_data *data = ui_out_data (uiout);
vfprintf_filtered (data->stream, format, args);
if (align != ui_noalign)
@@ -283,80 +250,58 @@ cli_field_fmt (struct ui_out *uiout, int fldno,
}
void
-cli_spaces (struct ui_out *uiout, int numspaces)
+cli_spaces (uiout, numspaces)
+ struct ui_out *uiout;
+ int numspaces;
{
- cli_out_data *data = ui_out_data (uiout);
- if (data->suppress_output)
- return;
+ struct ui_out_data *data = ui_out_data (uiout);
print_spaces_filtered (numspaces, data->stream);
}
void
-cli_text (struct ui_out *uiout, const char *string)
+cli_text (uiout, string)
+ struct ui_out *uiout;
+ char *string;
{
- cli_out_data *data = ui_out_data (uiout);
- if (data->suppress_output)
- return;
+ struct ui_out_data *data = ui_out_data (uiout);
fputs_filtered (string, data->stream);
}
void
-cli_message (struct ui_out *uiout, int verbosity,
- const char *format, va_list args)
+cli_message (struct ui_out *uiout, int verbosity, char *format, va_list args)
{
- cli_out_data *data = ui_out_data (uiout);
- if (data->suppress_output)
- return;
+ struct ui_out_data *data = ui_out_data (uiout);
if (ui_out_get_verblvl (uiout) >= verbosity)
vfprintf_unfiltered (data->stream, format, args);
}
void
-cli_wrap_hint (struct ui_out *uiout, char *identstring)
+cli_wrap_hint (uiout, identstring)
+ struct ui_out *uiout;
+ char *identstring;
{
- cli_out_data *data = ui_out_data (uiout);
- if (data->suppress_output)
- return;
wrap_here (identstring);
}
void
-cli_flush (struct ui_out *uiout)
-{
- cli_out_data *data = ui_out_data (uiout);
- gdb_flush (data->stream);
-}
-
-int
-cli_redirect (struct ui_out *uiout, struct ui_file *outstream)
+cli_flush (uiout)
+ struct ui_out *uiout;
{
struct ui_out_data *data = ui_out_data (uiout);
- if (outstream != NULL)
- {
- data->original_stream = data->stream;
- data->stream = outstream;
- }
- else if (data->original_stream != NULL)
- {
- data->stream = data->original_stream;
- data->original_stream = NULL;
- }
-
- return 0;
+ gdb_flush (data->stream);
}
/* local functions */
/* Like cli_field_fmt, but takes a variable number of args
- and makes a va_list and does not insert a separator. */
+ and makes a va_list and does not insert a separator */
/* VARARGS */
static void
-out_field_fmt (struct ui_out *uiout, int fldno,
- const char *fldname,
- const char *format,...)
+out_field_fmt (struct ui_out *uiout, int fldno, char *fldname,
+ char *format,...)
{
- cli_out_data *data = ui_out_data (uiout);
+ struct ui_out_data *data = ui_out_data (uiout);
va_list args;
va_start (args, format);
@@ -365,41 +310,30 @@ out_field_fmt (struct ui_out *uiout, int fldno,
va_end (args);
}
-/* Access to ui_out format private members. */
+/* access to ui_out format private members */
static void
-field_separator (void)
+field_separator ()
{
- cli_out_data *data = ui_out_data (uiout);
+ struct ui_out_data *data = ui_out_data (uiout);
fputc_filtered (' ', data->stream);
}
-/* Initalize private members at startup. */
+/* initalize private members at startup */
struct ui_out *
cli_out_new (struct ui_file *stream)
{
int flags = ui_source_list;
- cli_out_data *data = XMALLOC (cli_out_data);
+ struct ui_out_data *data = XMALLOC (struct ui_out_data);
data->stream = stream;
- data->original_stream = NULL;
- data->suppress_output = 0;
return ui_out_new (&cli_ui_out_impl, data, flags);
}
-struct ui_file *
-cli_out_set_stream (struct ui_out *uiout, struct ui_file *stream)
-{
- cli_out_data *data = ui_out_data (uiout);
- struct ui_file *old = data->stream;
- data->stream = stream;
- return old;
-}
-
-/* Standard gdb initialization hook. */
+/* standard gdb initialization hook */
void
-_initialize_cli_out (void)
+_initialize_cli_out ()
{
/* nothing needs to be done */
}
diff --git a/gdb/cli-out.h b/gdb/cli-out.h
index 5f32a114081..f017f807a96 100644
--- a/gdb/cli-out.h
+++ b/gdb/cli-out.h
@@ -1,12 +1,12 @@
/* Output generating routines for GDB CLI.
- Copyright (C) 1999, 2000, 2007, 2008 Free Software Foundation, Inc.
+ Copyright 1999-2000 Free Software Foundation, Inc.
Contributed by Cygnus Solutions.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
+ the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@@ -15,16 +15,13 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
#ifndef CLI_OUT_H
#define CLI_OUT_H
-struct ui_file;
-
extern struct ui_out *cli_out_new (struct ui_file *stream);
-extern struct ui_file *cli_out_set_stream (struct ui_out *uiout,
- struct ui_file *stream);
-
#endif
diff --git a/gdb/command.c b/gdb/command.c
index 76c98e6a8eb..0db8095b9fb 100644
--- a/gdb/command.c
+++ b/gdb/command.c
@@ -22,6 +22,9 @@
#include "value.h"
#include <ctype.h>
#include "gdb_string.h"
+#ifdef UI_OUT
+#include "ui-out.h"
+#endif
#if HAVE_SYS_WAIT_H
#include <sys/wait.h>
@@ -520,7 +523,11 @@ print_doc_line (stream, str)
line_buffer[p - str] = '\0';
if (islower (line_buffer[0]))
line_buffer[0] = toupper (line_buffer[0]);
+#ifdef UI_OUT
+ ui_out_text (uiout, line_buffer);
+#else
fputs_filtered (line_buffer, stream);
+#endif
}
/*
@@ -1363,9 +1370,73 @@ do_setshow_command (arg, from_tty, c)
}
else if (c->type == show_cmd)
{
+#ifdef UI_OUT
+ struct cleanup *old_chain;
+ struct ui_stream *stb;
+ int quote;
+
+ stb = ui_out_stream_new (uiout);
+ old_chain = make_cleanup ((make_cleanup_func) ui_out_stream_delete, stb);
+#endif /* UI_OUT */
+
/* Print doc minus "show" at start. */
print_doc_line (gdb_stdout, c->doc + 5);
+#ifdef UI_OUT
+ ui_out_text (uiout, " is ");
+ ui_out_wrap_hint (uiout, " ");
+ quote = 0;
+ switch (c->var_type)
+ {
+ case var_string:
+ {
+ unsigned char *p;
+
+ if (*(unsigned char **) c->var)
+ fputstr_filtered (*(unsigned char **) c->var, '"', stb->stream);
+ quote = 1;
+ }
+ break;
+ case var_string_noescape:
+ case var_filename:
+ case var_enum:
+ if (*(char **) c->var)
+ fputs_filtered (*(char **) c->var, stb->stream);
+ quote = 1;
+ break;
+ case var_boolean:
+ fputs_filtered (*(int *) c->var ? "on" : "off", stb->stream);
+ break;
+ case var_uinteger:
+ if (*(unsigned int *) c->var == UINT_MAX)
+ {
+ fputs_filtered ("unlimited", stb->stream);
+ break;
+ }
+ /* else fall through */
+ case var_zinteger:
+ fprintf_filtered (stb->stream, "%u", *(unsigned int *) c->var);
+ break;
+ case var_integer:
+ if (*(int *) c->var == INT_MAX)
+ {
+ fputs_filtered ("unlimited", stb->stream);
+ }
+ else
+ fprintf_filtered (stb->stream, "%d", *(int *) c->var);
+ break;
+
+ default:
+ error ("gdb internal error: bad var_type in do_setshow_command");
+ }
+ if (quote)
+ ui_out_text (uiout, "\"");
+ ui_out_field_stream (uiout, "value", stb);
+ if (quote)
+ ui_out_text (uiout, "\"");
+ ui_out_text (uiout, ".\n");
+ do_cleanups (old_chain);
+#else
fputs_filtered (" is ", gdb_stdout);
wrap_here (" ");
switch (c->var_type)
@@ -1412,6 +1483,7 @@ do_setshow_command (arg, from_tty, c)
error ("gdb internal error: bad var_type in do_setshow_command");
}
fputs_filtered (".\n", gdb_stdout);
+#endif
}
else
error ("gdb internal error: bad cmd_type in do_setshow_command");
@@ -1428,10 +1500,31 @@ cmd_show_list (list, from_tty, prefix)
int from_tty;
char *prefix;
{
+#ifdef UI_OUT
+ ui_out_list_begin (uiout, "showlist");
+#endif
for (; list != NULL; list = list->next)
{
/* If we find a prefix, run its list, prefixing our output by its
prefix (with "show " skipped). */
+#ifdef UI_OUT
+ if (list->prefixlist && !list->abbrev_flag)
+ {
+ ui_out_list_begin (uiout, "optionlist");
+ ui_out_field_string (uiout, "prefix", list->prefixname + 5);
+ cmd_show_list (*list->prefixlist, from_tty, list->prefixname + 5);
+ ui_out_list_end (uiout);
+ }
+ if (list->type == show_cmd)
+ {
+ ui_out_list_begin (uiout, "option");
+ ui_out_text (uiout, prefix);
+ ui_out_field_string (uiout, "name", list->name);
+ ui_out_text (uiout, ": ");
+ do_setshow_command ((char *) NULL, from_tty, list);
+ ui_out_list_end (uiout);
+ }
+#else
if (list->prefixlist && !list->abbrev_flag)
cmd_show_list (*list->prefixlist, from_tty, list->prefixname + 5);
if (list->type == show_cmd)
@@ -1441,7 +1534,11 @@ cmd_show_list (list, from_tty, prefix)
fputs_filtered (": ", gdb_stdout);
do_setshow_command ((char *) NULL, from_tty, list);
}
+#endif
}
+#ifdef UI_OUT
+ ui_out_list_end (uiout);
+#endif
}
/* ARGSUSED */
@@ -1541,12 +1638,17 @@ show_user_1 (c, stream)
fputs_filtered (c->name, stream);
fputs_filtered (":\n", stream);
+#ifdef UI_OUT
+ print_command_lines (uiout, cmdlines, 1);
+ fputs_filtered ("\n", stream);
+#else
while (cmdlines)
{
print_command_line (cmdlines, 4, stream);
cmdlines = cmdlines->next;
}
fputs_filtered ("\n", stream);
+#endif
}
/* ARGSUSED */
diff --git a/gdb/configure b/gdb/configure
index 6e456d71264..69d979290d2 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -30,10 +30,6 @@ ac_help="$ac_help
ac_help="$ac_help
--enable-targets Alternative target configurations"
ac_help="$ac_help
- --enable-ide Enable IDE support"
-ac_help="$ac_help
- --with-foundry-libs=DIR Use the Foundry SDK in DIR"
-ac_help="$ac_help
--with-cpu=CPU Set the default CPU variant to debug"
ac_help="$ac_help
--enable-gdbtk Enable GDBTK GUI front end"
@@ -587,7 +583,7 @@ fi
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:591: checking for $ac_word" >&5
+echo "configure:587: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -617,7 +613,7 @@ if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:621: checking for $ac_word" >&5
+echo "configure:617: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -668,7 +664,7 @@ fi
# Extract the first word of "cl", so it can be a program name with args.
set dummy cl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:672: checking for $ac_word" >&5
+echo "configure:668: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -700,7 +696,7 @@ fi
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:704: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:700: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -711,12 +707,12 @@ cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext << EOF
-#line 715 "configure"
+#line 711 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:716: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
@@ -742,12 +738,12 @@ if test $ac_cv_prog_cc_works = no; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:746: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:742: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:751: checking whether we are using GNU C" >&5
+echo "configure:747: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -756,7 +752,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:760: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:756: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
@@ -775,7 +771,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:779: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:775: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -807,7 +803,7 @@ else
fi
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:811: checking how to run the C preprocessor" >&5
+echo "configure:807: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -822,13 +818,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 826 "configure"
+#line 822 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:832: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:828: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -839,13 +835,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 843 "configure"
+#line 839 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:849: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:845: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -856,13 +852,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 860 "configure"
+#line 856 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:866: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:862: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -887,9 +883,9 @@ fi
echo "$ac_t""$CPP" 1>&6
echo $ac_n "checking for AIX""... $ac_c" 1>&6
-echo "configure:891: checking for AIX" >&5
+echo "configure:887: checking for AIX" >&5
cat > conftest.$ac_ext <<EOF
-#line 893 "configure"
+#line 889 "configure"
#include "confdefs.h"
#ifdef _AIX
yes
@@ -911,7 +907,7 @@ rm -f conftest*
echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
-echo "configure:915: checking for POSIXized ISC" >&5
+echo "configure:911: checking for POSIXized ISC" >&5
if test -d /etc/conf/kconfig.d &&
grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
then
@@ -935,7 +931,7 @@ fi
echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
-echo "configure:939: checking for ${CC-cc} option to accept ANSI C" >&5
+echo "configure:935: checking for ${CC-cc} option to accept ANSI C" >&5
if eval "test \"`echo '$''{'am_cv_prog_cc_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -951,7 +947,7 @@ for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__
do
CC="$ac_save_CC $ac_arg"
cat > conftest.$ac_ext <<EOF
-#line 955 "configure"
+#line 951 "configure"
#include "confdefs.h"
#include <stdarg.h>
#include <stdio.h>
@@ -988,7 +984,7 @@ return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
; return 0; }
EOF
-if { (eval echo configure:992: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:988: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
am_cv_prog_cc_stdc="$ac_arg"; break
else
@@ -1059,7 +1055,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi
echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:1063: checking host system type" >&5
+echo "configure:1059: checking host system type" >&5
host_alias=$host
case "$host_alias" in
@@ -1080,7 +1076,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$host" 1>&6
echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:1084: checking target system type" >&5
+echo "configure:1080: checking target system type" >&5
target_alias=$target
case "$target_alias" in
@@ -1098,7 +1094,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$target" 1>&6
echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:1102: checking build system type" >&5
+echo "configure:1098: checking build system type" >&5
build_alias=$build
case "$build_alias" in
@@ -1123,7 +1119,7 @@ test "$host_alias" != "$target_alias" &&
ALL_LINGUAS=
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:1127: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:1123: checking whether ${MAKE-make} sets \${MAKE}" >&5
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1152,7 +1148,7 @@ fi
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1156: checking for $ac_word" >&5
+echo "configure:1152: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1180,12 +1176,12 @@ else
fi
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1184: checking for ANSI C header files" >&5
+echo "configure:1180: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1189 "configure"
+#line 1185 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -1193,7 +1189,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1197: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1193: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1210,7 +1206,7 @@ rm -f conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 1214 "configure"
+#line 1210 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -1228,7 +1224,7 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 1232 "configure"
+#line 1228 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -1249,7 +1245,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 1253 "configure"
+#line 1249 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -1260,7 +1256,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:1264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1260: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -1284,12 +1280,12 @@ EOF
fi
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:1288: checking for working const" >&5
+echo "configure:1284: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1293 "configure"
+#line 1289 "configure"
#include "confdefs.h"
int main() {
@@ -1338,7 +1334,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
-if { (eval echo configure:1342: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1338: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
@@ -1359,21 +1355,21 @@ EOF
fi
echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:1363: checking for inline" >&5
+echo "configure:1359: checking for inline" >&5
if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_c_inline=no
for ac_kw in inline __inline__ __inline; do
cat > conftest.$ac_ext <<EOF
-#line 1370 "configure"
+#line 1366 "configure"
#include "confdefs.h"
int main() {
} $ac_kw foo() {
; return 0; }
EOF
-if { (eval echo configure:1377: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1373: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_inline=$ac_kw; break
else
@@ -1399,12 +1395,12 @@ EOF
esac
echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:1403: checking for off_t" >&5
+echo "configure:1399: checking for off_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1408 "configure"
+#line 1404 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -1432,12 +1428,12 @@ EOF
fi
echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:1436: checking for size_t" >&5
+echo "configure:1432: checking for size_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1441 "configure"
+#line 1437 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -1467,19 +1463,19 @@ fi
# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments. Useless!
echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:1471: checking for working alloca.h" >&5
+echo "configure:1467: checking for working alloca.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1476 "configure"
+#line 1472 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
-if { (eval echo configure:1483: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_header_alloca_h=yes
else
@@ -1500,12 +1496,12 @@ EOF
fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:1504: checking for alloca" >&5
+echo "configure:1500: checking for alloca" >&5
if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1509 "configure"
+#line 1505 "configure"
#include "confdefs.h"
#ifdef __GNUC__
@@ -1533,7 +1529,7 @@ int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
-if { (eval echo configure:1537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1533: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_func_alloca_works=yes
else
@@ -1565,12 +1561,12 @@ EOF
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:1569: checking whether alloca needs Cray hooks" >&5
+echo "configure:1565: checking whether alloca needs Cray hooks" >&5
if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1574 "configure"
+#line 1570 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@@ -1595,12 +1591,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6
if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1599: checking for $ac_func" >&5
+echo "configure:1595: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1604 "configure"
+#line 1600 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -1623,7 +1619,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:1627: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1623: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -1650,7 +1646,7 @@ done
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:1654: checking stack direction for C alloca" >&5
+echo "configure:1650: checking stack direction for C alloca" >&5
if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1658,7 +1654,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 1662 "configure"
+#line 1658 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@@ -1677,7 +1673,7 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:1681: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1677: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_c_stack_direction=1
else
@@ -1702,17 +1698,17 @@ for ac_hdr in unistd.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1706: checking for $ac_hdr" >&5
+echo "configure:1702: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1711 "configure"
+#line 1707 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1716: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1712: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1741,12 +1737,12 @@ done
for ac_func in getpagesize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1745: checking for $ac_func" >&5
+echo "configure:1741: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1750 "configure"
+#line 1746 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -1769,7 +1765,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:1773: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -1794,7 +1790,7 @@ fi
done
echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:1798: checking for working mmap" >&5
+echo "configure:1794: checking for working mmap" >&5
if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1802,7 +1798,7 @@ else
ac_cv_func_mmap_fixed_mapped=no
else
cat > conftest.$ac_ext <<EOF
-#line 1806 "configure"
+#line 1802 "configure"
#include "confdefs.h"
/* Thanks to Mike Haertel and Jim Avera for this test.
@@ -1942,7 +1938,7 @@ main()
}
EOF
-if { (eval echo configure:1946: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1942: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_mmap_fixed_mapped=yes
else
@@ -1970,17 +1966,17 @@ unistd.h values.h sys/param.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1974: checking for $ac_hdr" >&5
+echo "configure:1970: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1979 "configure"
+#line 1975 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1984: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1980: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -2010,12 +2006,12 @@ done
__argz_count __argz_stringify __argz_next
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2014: checking for $ac_func" >&5
+echo "configure:2010: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2019 "configure"
+#line 2015 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2038,7 +2034,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2042: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2038: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -2067,12 +2063,12 @@ done
for ac_func in stpcpy
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2071: checking for $ac_func" >&5
+echo "configure:2067: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2076 "configure"
+#line 2072 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2095,7 +2091,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2099: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2095: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -2129,19 +2125,19 @@ EOF
if test $ac_cv_header_locale_h = yes; then
echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
-echo "configure:2133: checking for LC_MESSAGES" >&5
+echo "configure:2129: checking for LC_MESSAGES" >&5
if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2138 "configure"
+#line 2134 "configure"
#include "confdefs.h"
#include <locale.h>
int main() {
return LC_MESSAGES
; return 0; }
EOF
-if { (eval echo configure:2145: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2141: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
am_cv_val_LC_MESSAGES=yes
else
@@ -2162,7 +2158,7 @@ EOF
fi
fi
echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
-echo "configure:2166: checking whether NLS is requested" >&5
+echo "configure:2162: checking whether NLS is requested" >&5
# Check whether --enable-nls or --disable-nls was given.
if test "${enable_nls+set}" = set; then
enableval="$enable_nls"
@@ -2182,7 +2178,7 @@ fi
EOF
echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6
-echo "configure:2186: checking whether included gettext is requested" >&5
+echo "configure:2182: checking whether included gettext is requested" >&5
# Check whether --with-included-gettext or --without-included-gettext was given.
if test "${with_included_gettext+set}" = set; then
withval="$with_included_gettext"
@@ -2201,17 +2197,17 @@ fi
ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for libintl.h""... $ac_c" 1>&6
-echo "configure:2205: checking for libintl.h" >&5
+echo "configure:2201: checking for libintl.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2210 "configure"
+#line 2206 "configure"
#include "confdefs.h"
#include <libintl.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2215: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2211: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -2228,19 +2224,19 @@ fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6
-echo "configure:2232: checking for gettext in libc" >&5
+echo "configure:2228: checking for gettext in libc" >&5
if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2237 "configure"
+#line 2233 "configure"
#include "confdefs.h"
#include <libintl.h>
int main() {
return (int) gettext ("")
; return 0; }
EOF
-if { (eval echo configure:2244: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2240: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
gt_cv_func_gettext_libc=yes
else
@@ -2256,7 +2252,7 @@ echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6
if test "$gt_cv_func_gettext_libc" != "yes"; then
echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6
-echo "configure:2260: checking for bindtextdomain in -lintl" >&5
+echo "configure:2256: checking for bindtextdomain in -lintl" >&5
ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2264,7 +2260,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lintl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2268 "configure"
+#line 2264 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -2275,7 +2271,7 @@ int main() {
bindtextdomain()
; return 0; }
EOF
-if { (eval echo configure:2279: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2275: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2291,19 +2287,19 @@ fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6
-echo "configure:2295: checking for gettext in libintl" >&5
+echo "configure:2291: checking for gettext in libintl" >&5
if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2300 "configure"
+#line 2296 "configure"
#include "confdefs.h"
int main() {
return (int) gettext ("")
; return 0; }
EOF
-if { (eval echo configure:2307: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2303: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
gt_cv_func_gettext_libintl=yes
else
@@ -2331,7 +2327,7 @@ EOF
# Extract the first word of "msgfmt", so it can be a program name with args.
set dummy msgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2335: checking for $ac_word" >&5
+echo "configure:2331: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2365,12 +2361,12 @@ fi
for ac_func in dcgettext
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2369: checking for $ac_func" >&5
+echo "configure:2365: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2374 "configure"
+#line 2370 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2393,7 +2389,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2397: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2393: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -2420,7 +2416,7 @@ done
# Extract the first word of "gmsgfmt", so it can be a program name with args.
set dummy gmsgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2424: checking for $ac_word" >&5
+echo "configure:2420: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2456,7 +2452,7 @@ fi
# Extract the first word of "xgettext", so it can be a program name with args.
set dummy xgettext; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2460: checking for $ac_word" >&5
+echo "configure:2456: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2488,7 +2484,7 @@ else
fi
cat > conftest.$ac_ext <<EOF
-#line 2492 "configure"
+#line 2488 "configure"
#include "confdefs.h"
int main() {
@@ -2496,7 +2492,7 @@ extern int _nl_msg_cat_cntr;
return _nl_msg_cat_cntr
; return 0; }
EOF
-if { (eval echo configure:2500: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2496: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
CATOBJEXT=.gmo
DATADIRNAME=share
@@ -2528,7 +2524,7 @@ fi
# Extract the first word of "msgfmt", so it can be a program name with args.
set dummy msgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2532: checking for $ac_word" >&5
+echo "configure:2528: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2562,7 +2558,7 @@ fi
# Extract the first word of "gmsgfmt", so it can be a program name with args.
set dummy gmsgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2566: checking for $ac_word" >&5
+echo "configure:2562: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2598,7 +2594,7 @@ fi
# Extract the first word of "xgettext", so it can be a program name with args.
set dummy xgettext; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2602: checking for $ac_word" >&5
+echo "configure:2598: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2688,7 +2684,7 @@ fi
LINGUAS=
else
echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
-echo "configure:2692: checking for catalogs to be installed" >&5
+echo "configure:2688: checking for catalogs to be installed" >&5
NEW_LINGUAS=
for lang in ${LINGUAS=$ALL_LINGUAS}; do
case "$ALL_LINGUAS" in
@@ -2716,17 +2712,17 @@ echo "configure:2692: checking for catalogs to be installed" >&5
if test "$CATOBJEXT" = ".cat"; then
ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6
-echo "configure:2720: checking for linux/version.h" >&5
+echo "configure:2716: checking for linux/version.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2725 "configure"
+#line 2721 "configure"
#include "confdefs.h"
#include <linux/version.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2730: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2726: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -2822,7 +2818,7 @@ do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2826: checking for $ac_word" >&5
+echo "configure:2822: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2863,7 +2859,7 @@ done
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:2867: checking for a BSD compatible install" >&5
+echo "configure:2863: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2924,7 +2920,7 @@ fi
# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
set dummy ${ac_tool_prefix}ar; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2928: checking for $ac_word" >&5
+echo "configure:2924: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2956,7 +2952,7 @@ fi
# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2960: checking for $ac_word" >&5
+echo "configure:2956: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2988,7 +2984,7 @@ if test -n "$ac_tool_prefix"; then
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2992: checking for $ac_word" >&5
+echo "configure:2988: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3025,7 +3021,7 @@ do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3029: checking for $ac_word" >&5
+echo "configure:3025: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3077,12 +3073,12 @@ test "$program_transform_name" = "" && program_transform_name="s,x,x,"
echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:3081: checking return type of signal handlers" >&5
+echo "configure:3077: checking return type of signal handlers" >&5
if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3086 "configure"
+#line 3082 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
@@ -3099,7 +3095,7 @@ int main() {
int i;
; return 0; }
EOF
-if { (eval echo configure:3103: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3099: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_type_signal=void
else
@@ -3119,12 +3115,12 @@ EOF
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:3123: checking for ANSI C header files" >&5
+echo "configure:3119: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3128 "configure"
+#line 3124 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -3132,7 +3128,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3136: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3132: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -3149,7 +3145,7 @@ rm -f conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 3153 "configure"
+#line 3149 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -3167,7 +3163,7 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 3171 "configure"
+#line 3167 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -3188,7 +3184,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 3192 "configure"
+#line 3188 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -3199,7 +3195,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:3203: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3199: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -3232,17 +3228,17 @@ for ac_hdr in ctype.h curses.h endian.h link.h thread_db.h proc_service.h \
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3236: checking for $ac_hdr" >&5
+echo "configure:3232: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3241 "configure"
+#line 3237 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3246: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3242: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -3269,12 +3265,12 @@ fi
done
echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6
-echo "configure:3273: checking whether stat file-mode macros are broken" >&5
+echo "configure:3269: checking whether stat file-mode macros are broken" >&5
if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3278 "configure"
+#line 3274 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
@@ -3326,12 +3322,12 @@ fi
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:3330: checking for working const" >&5
+echo "configure:3326: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3335 "configure"
+#line 3331 "configure"
#include "confdefs.h"
int main() {
@@ -3380,7 +3376,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
-if { (eval echo configure:3384: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3380: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
@@ -3404,12 +3400,12 @@ fi
for ac_func in setpgid sbrk sigaction isascii bzero bcopy btowc poll sigprocmask
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3408: checking for $ac_func" >&5
+echo "configure:3404: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3413 "configure"
+#line 3409 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3432,7 +3428,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3436: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3432: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -3459,19 +3455,19 @@ done
# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments. Useless!
echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:3463: checking for working alloca.h" >&5
+echo "configure:3459: checking for working alloca.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3468 "configure"
+#line 3464 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
-if { (eval echo configure:3475: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3471: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_header_alloca_h=yes
else
@@ -3492,12 +3488,12 @@ EOF
fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:3496: checking for alloca" >&5
+echo "configure:3492: checking for alloca" >&5
if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3501 "configure"
+#line 3497 "configure"
#include "confdefs.h"
#ifdef __GNUC__
@@ -3525,7 +3521,7 @@ int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
-if { (eval echo configure:3529: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3525: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_func_alloca_works=yes
else
@@ -3557,12 +3553,12 @@ EOF
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:3561: checking whether alloca needs Cray hooks" >&5
+echo "configure:3557: checking whether alloca needs Cray hooks" >&5
if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3566 "configure"
+#line 3562 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@@ -3587,12 +3583,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6
if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3591: checking for $ac_func" >&5
+echo "configure:3587: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3596 "configure"
+#line 3592 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3615,7 +3611,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3619: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3615: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -3642,7 +3638,7 @@ done
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:3646: checking stack direction for C alloca" >&5
+echo "configure:3642: checking stack direction for C alloca" >&5
if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3650,7 +3646,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 3654 "configure"
+#line 3650 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@@ -3669,7 +3665,7 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:3673: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3669: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_c_stack_direction=1
else
@@ -3692,19 +3688,19 @@ fi
echo $ac_n "checking for PTRACE_GETXFPREGS""... $ac_c" 1>&6
-echo "configure:3696: checking for PTRACE_GETXFPREGS" >&5
+echo "configure:3692: checking for PTRACE_GETXFPREGS" >&5
if eval "test \"`echo '$''{'gdb_cv_have_ptrace_getxfpregs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3701 "configure"
+#line 3697 "configure"
#include "confdefs.h"
#include <sys/ptrace.h>
int main() {
PTRACE_GETXFPREGS;
; return 0; }
EOF
-if { (eval echo configure:3708: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3704: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_ptrace_getxfpregs=yes
else
@@ -3725,7 +3721,7 @@ EOF
fi
echo $ac_n "checking for socketpair in -lsocket""... $ac_c" 1>&6
-echo "configure:3729: checking for socketpair in -lsocket" >&5
+echo "configure:3725: checking for socketpair in -lsocket" >&5
ac_lib_var=`echo socket'_'socketpair | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -3733,7 +3729,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsocket $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3737 "configure"
+#line 3733 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -3744,7 +3740,7 @@ int main() {
socketpair()
; return 0; }
EOF
-if { (eval echo configure:3748: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3744: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -3774,12 +3770,12 @@ fi
for ac_func in socketpair
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3778: checking for $ac_func" >&5
+echo "configure:3774: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3783 "configure"
+#line 3779 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3802,7 +3798,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3806: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3802: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -3829,12 +3825,12 @@ done
echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6
-echo "configure:3833: checking whether malloc must be declared" >&5
+echo "configure:3829: checking whether malloc must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_malloc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3838 "configure"
+#line 3834 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -3855,7 +3851,7 @@ int main() {
char *(*pfn) = (char *(*)) malloc
; return 0; }
EOF
-if { (eval echo configure:3859: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3855: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_malloc=no
else
@@ -3876,12 +3872,12 @@ EOF
fi
echo $ac_n "checking whether realloc must be declared""... $ac_c" 1>&6
-echo "configure:3880: checking whether realloc must be declared" >&5
+echo "configure:3876: checking whether realloc must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_realloc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3885 "configure"
+#line 3881 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -3902,7 +3898,7 @@ int main() {
char *(*pfn) = (char *(*)) realloc
; return 0; }
EOF
-if { (eval echo configure:3906: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3902: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_realloc=no
else
@@ -3923,12 +3919,12 @@ EOF
fi
echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6
-echo "configure:3927: checking whether free must be declared" >&5
+echo "configure:3923: checking whether free must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_free'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3932 "configure"
+#line 3928 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -3949,7 +3945,7 @@ int main() {
char *(*pfn) = (char *(*)) free
; return 0; }
EOF
-if { (eval echo configure:3953: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3949: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_free=no
else
@@ -3970,12 +3966,12 @@ EOF
fi
echo $ac_n "checking whether strerror must be declared""... $ac_c" 1>&6
-echo "configure:3974: checking whether strerror must be declared" >&5
+echo "configure:3970: checking whether strerror must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_strerror'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3979 "configure"
+#line 3975 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -3996,7 +3992,7 @@ int main() {
char *(*pfn) = (char *(*)) strerror
; return 0; }
EOF
-if { (eval echo configure:4000: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3996: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_strerror=no
else
@@ -4017,12 +4013,12 @@ EOF
fi
echo $ac_n "checking whether strdup must be declared""... $ac_c" 1>&6
-echo "configure:4021: checking whether strdup must be declared" >&5
+echo "configure:4017: checking whether strdup must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_strdup'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4026 "configure"
+#line 4022 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -4043,7 +4039,7 @@ int main() {
char *(*pfn) = (char *(*)) strdup
; return 0; }
EOF
-if { (eval echo configure:4047: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4043: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_strdup=no
else
@@ -4064,12 +4060,12 @@ EOF
fi
echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6
-echo "configure:4068: checking whether strstr must be declared" >&5
+echo "configure:4064: checking whether strstr must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_strstr'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4073 "configure"
+#line 4069 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -4090,7 +4086,7 @@ int main() {
char *(*pfn) = (char *(*)) strstr
; return 0; }
EOF
-if { (eval echo configure:4094: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4090: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_strstr=no
else
@@ -4117,9 +4113,9 @@ fi
# could be expunged. --jsm 1999-03-22
echo $ac_n "checking for HPUX save_state structure""... $ac_c" 1>&6
-echo "configure:4121: checking for HPUX save_state structure" >&5
+echo "configure:4117: checking for HPUX save_state structure" >&5
cat > conftest.$ac_ext <<EOF
-#line 4123 "configure"
+#line 4119 "configure"
#include "confdefs.h"
#include <machine/save_state.h>
EOF
@@ -4134,7 +4130,7 @@ fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 4138 "configure"
+#line 4134 "configure"
#include "confdefs.h"
#include <machine/save_state.h>
EOF
@@ -4201,19 +4197,19 @@ fi
if test "$ac_cv_header_sys_procfs_h" = yes; then
echo $ac_n "checking for pstatus_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:4205: checking for pstatus_t in sys/procfs.h" >&5
+echo "configure:4201: checking for pstatus_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pstatus_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4210 "configure"
+#line 4206 "configure"
#include "confdefs.h"
#include <sys/procfs.h>
int main() {
pstatus_t avar
; return 0; }
EOF
-if { (eval echo configure:4217: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4213: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_pstatus_t=yes
else
@@ -4235,19 +4231,19 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_pstatus_t" 1>&6
echo $ac_n "checking for prrun_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:4239: checking for prrun_t in sys/procfs.h" >&5
+echo "configure:4235: checking for prrun_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prrun_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4244 "configure"
+#line 4240 "configure"
#include "confdefs.h"
#include <sys/procfs.h>
int main() {
prrun_t avar
; return 0; }
EOF
-if { (eval echo configure:4251: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4247: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_prrun_t=yes
else
@@ -4269,19 +4265,19 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_prrun_t" 1>&6
echo $ac_n "checking for gregset_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:4273: checking for gregset_t in sys/procfs.h" >&5
+echo "configure:4269: checking for gregset_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_gregset_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4278 "configure"
+#line 4274 "configure"
#include "confdefs.h"
#include <sys/procfs.h>
int main() {
gregset_t avar
; return 0; }
EOF
-if { (eval echo configure:4285: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4281: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_gregset_t=yes
else
@@ -4303,19 +4299,19 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_gregset_t" 1>&6
echo $ac_n "checking for fpregset_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:4307: checking for fpregset_t in sys/procfs.h" >&5
+echo "configure:4303: checking for fpregset_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_fpregset_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4312 "configure"
+#line 4308 "configure"
#include "confdefs.h"
#include <sys/procfs.h>
int main() {
fpregset_t avar
; return 0; }
EOF
-if { (eval echo configure:4319: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4315: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_fpregset_t=yes
else
@@ -4339,12 +4335,12 @@ EOF
echo $ac_n "checking for PIOCSET ioctl entry in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:4343: checking for PIOCSET ioctl entry in sys/procfs.h" >&5
+echo "configure:4339: checking for PIOCSET ioctl entry in sys/procfs.h" >&5
if eval "test \"`echo '$''{'gdb_cv_have_procfs_piocset'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4348 "configure"
+#line 4344 "configure"
#include "confdefs.h"
#include <unistd.h>
#include <sys/types.h>
@@ -4357,7 +4353,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:4361: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4357: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_procfs_piocset=yes
else
@@ -4379,7 +4375,7 @@ EOF
fi
echo $ac_n "checking for main in -lm""... $ac_c" 1>&6
-echo "configure:4383: checking for main in -lm" >&5
+echo "configure:4379: checking for main in -lm" >&5
ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -4387,14 +4383,14 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lm $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4391 "configure"
+#line 4387 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:4398: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4394: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -4423,7 +4419,7 @@ fi
echo $ac_n "checking for wctype in -lc""... $ac_c" 1>&6
-echo "configure:4427: checking for wctype in -lc" >&5
+echo "configure:4423: checking for wctype in -lc" >&5
ac_lib_var=`echo c'_'wctype | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -4431,7 +4427,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lc $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4435 "configure"
+#line 4431 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -4442,7 +4438,7 @@ int main() {
wctype()
; return 0; }
EOF
-if { (eval echo configure:4446: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4442: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -4461,7 +4457,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for wctype in -lw""... $ac_c" 1>&6
-echo "configure:4465: checking for wctype in -lw" >&5
+echo "configure:4461: checking for wctype in -lw" >&5
ac_lib_var=`echo w'_'wctype | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -4469,7 +4465,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lw $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4473 "configure"
+#line 4469 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -4480,7 +4476,7 @@ int main() {
wctype()
; return 0; }
EOF
-if { (eval echo configure:4484: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4480: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -4512,12 +4508,12 @@ fi
echo $ac_n "checking for long long support in compiler""... $ac_c" 1>&6
-echo "configure:4516: checking for long long support in compiler" >&5
+echo "configure:4512: checking for long long support in compiler" >&5
if eval "test \"`echo '$''{'gdb_cv_c_long_long'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4521 "configure"
+#line 4517 "configure"
#include "confdefs.h"
int main() {
@@ -4527,7 +4523,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:4531: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4527: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_c_long_long=yes
else
@@ -4549,7 +4545,7 @@ fi
echo $ac_n "checking for long long support in printf""... $ac_c" 1>&6
-echo "configure:4553: checking for long long support in printf" >&5
+echo "configure:4549: checking for long long support in printf" >&5
if eval "test \"`echo '$''{'gdb_cv_printf_has_long_long'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4557,7 +4553,7 @@ else
gdb_cv_printf_has_long_long=no
else
cat > conftest.$ac_ext <<EOF
-#line 4561 "configure"
+#line 4557 "configure"
#include "confdefs.h"
int main () {
@@ -4571,7 +4567,7 @@ int main () {
return (strcmp ("0x0123456789abcdef", buf));
}
EOF
-if { (eval echo configure:4575: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4571: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
gdb_cv_printf_has_long_long=yes
else
@@ -4595,19 +4591,19 @@ echo "$ac_t""$gdb_cv_printf_has_long_long" 1>&6
echo $ac_n "checking for long double support in compiler""... $ac_c" 1>&6
-echo "configure:4599: checking for long double support in compiler" >&5
+echo "configure:4595: checking for long double support in compiler" >&5
if eval "test \"`echo '$''{'ac_cv_c_long_double'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4604 "configure"
+#line 4600 "configure"
#include "confdefs.h"
int main() {
long double foo;
; return 0; }
EOF
-if { (eval echo configure:4611: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4607: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_long_double=yes
else
@@ -4629,7 +4625,7 @@ fi
echo $ac_n "checking for long double support in printf""... $ac_c" 1>&6
-echo "configure:4633: checking for long double support in printf" >&5
+echo "configure:4629: checking for long double support in printf" >&5
if eval "test \"`echo '$''{'gdb_cv_printf_has_long_double'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4637,7 +4633,7 @@ else
gdb_cv_printf_has_long_double=no
else
cat > conftest.$ac_ext <<EOF
-#line 4641 "configure"
+#line 4637 "configure"
#include "confdefs.h"
int main () {
@@ -4647,7 +4643,7 @@ int main () {
return (strncmp ("3.14159", buf, 7));
}
EOF
-if { (eval echo configure:4651: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4647: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
gdb_cv_printf_has_long_double=yes
else
@@ -4671,7 +4667,7 @@ echo "$ac_t""$gdb_cv_printf_has_long_double" 1>&6
echo $ac_n "checking for long double support in scanf""... $ac_c" 1>&6
-echo "configure:4675: checking for long double support in scanf" >&5
+echo "configure:4671: checking for long double support in scanf" >&5
if eval "test \"`echo '$''{'gdb_cv_scanf_has_long_double'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4679,7 +4675,7 @@ else
gdb_cv_scanf_has_long_double=no
else
cat > conftest.$ac_ext <<EOF
-#line 4683 "configure"
+#line 4679 "configure"
#include "confdefs.h"
int main () {
@@ -4689,7 +4685,7 @@ int main () {
return !(f > 3.14159 && f < 3.14160);
}
EOF
-if { (eval echo configure:4693: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4689: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
gdb_cv_scanf_has_long_double=yes
else
@@ -4715,17 +4711,17 @@ for ac_hdr in unistd.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4719: checking for $ac_hdr" >&5
+echo "configure:4715: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4724 "configure"
+#line 4720 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4729: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4725: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -4754,12 +4750,12 @@ done
for ac_func in getpagesize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4758: checking for $ac_func" >&5
+echo "configure:4754: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4763 "configure"
+#line 4759 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4782,7 +4778,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4786: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4782: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -4807,7 +4803,7 @@ fi
done
echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:4811: checking for working mmap" >&5
+echo "configure:4807: checking for working mmap" >&5
if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4815,7 +4811,7 @@ else
ac_cv_func_mmap_fixed_mapped=no
else
cat > conftest.$ac_ext <<EOF
-#line 4819 "configure"
+#line 4815 "configure"
#include "confdefs.h"
/* Thanks to Mike Haertel and Jim Avera for this test.
@@ -4955,7 +4951,7 @@ main()
}
EOF
-if { (eval echo configure:4959: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4955: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_mmap_fixed_mapped=yes
else
@@ -4984,7 +4980,7 @@ if test ${build} = ${host} -a ${host} = ${target} ; then
case ${host_os} in
hpux*)
echo $ac_n "checking for HPUX/OSF thread support""... $ac_c" 1>&6
-echo "configure:4988: checking for HPUX/OSF thread support" >&5
+echo "configure:4984: checking for HPUX/OSF thread support" >&5
if test -f /usr/include/dce/cma_config.h ; then
if test "$GCC" = "yes" ; then
echo "$ac_t""yes" 1>&6
@@ -5003,7 +4999,7 @@ EOF
;;
solaris*)
echo $ac_n "checking for Solaris thread debugging library""... $ac_c" 1>&6
-echo "configure:5007: checking for Solaris thread debugging library" >&5
+echo "configure:5003: checking for Solaris thread debugging library" >&5
if test -f /usr/lib/libthread_db.so.1 ; then
echo "$ac_t""yes" 1>&6
cat >> confdefs.h <<\EOF
@@ -5013,7 +5009,7 @@ EOF
CONFIG_OBS="${CONFIG_OBS} sol-thread.o"
CONFIG_SRCS="${CONFIG_SRCS} sol-thread.c"
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:5017: checking for dlopen in -ldl" >&5
+echo "configure:5013: checking for dlopen in -ldl" >&5
ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -5021,7 +5017,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5025 "configure"
+#line 5021 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -5032,7 +5028,7 @@ int main() {
dlopen()
; return 0; }
EOF
-if { (eval echo configure:5036: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5032: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -5064,17 +5060,17 @@ fi
# all symbols visible in the dynamic symbol table.
hold_ldflags=$LDFLAGS
echo $ac_n "checking for the ld -export-dynamic flag""... $ac_c" 1>&6
-echo "configure:5068: checking for the ld -export-dynamic flag" >&5
+echo "configure:5064: checking for the ld -export-dynamic flag" >&5
LDFLAGS="${LDFLAGS} -Wl,-export-dynamic"
cat > conftest.$ac_ext <<EOF
-#line 5071 "configure"
+#line 5067 "configure"
#include "confdefs.h"
int main() {
int i;
; return 0; }
EOF
-if { (eval echo configure:5078: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5074: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
found=yes
else
@@ -5093,13 +5089,13 @@ rm -f conftest*
# Sun randomly tweaked the prototypes in <proc_service.h>
# at one point.
echo $ac_n "checking if <proc_service.h> is old""... $ac_c" 1>&6
-echo "configure:5097: checking if <proc_service.h> is old" >&5
+echo "configure:5093: checking if <proc_service.h> is old" >&5
if eval "test \"`echo '$''{'gdb_cv_proc_service_is_old'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5103 "configure"
+#line 5099 "configure"
#include "confdefs.h"
#include <proc_service.h>
@@ -5110,7 +5106,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:5114: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5110: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_proc_service_is_old=no
else
@@ -5256,12 +5252,12 @@ fi
# In the Cygwin environment, we need some additional flags.
echo $ac_n "checking for cygwin""... $ac_c" 1>&6
-echo "configure:5383: checking for cygwin" >&5
+echo "configure:5379: checking for cygwin" >&5
if eval "test \"`echo '$''{'gdb_cv_os_cygwin'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5388 "configure"
+#line 5384 "configure"
#include "confdefs.h"
#if defined (__CYGWIN__) || defined (__CYGWIN32__)
@@ -5295,7 +5291,7 @@ if test x$gdb_cv_os_cygwin = xyes; then
else
TERM_LIB=
echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
-echo "configure:5422: checking for tgetent in -lncurses" >&5
+echo "configure:5418: checking for tgetent in -lncurses" >&5
ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -5303,7 +5299,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lncurses $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5430 "configure"
+#line 5426 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -5314,7 +5310,7 @@ int main() {
tgetent()
; return 0; }
EOF
-if { (eval echo configure:5441: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5437: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -5333,7 +5329,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for tgetent in -lHcurses""... $ac_c" 1>&6
-echo "configure:5460: checking for tgetent in -lHcurses" >&5
+echo "configure:5456: checking for tgetent in -lHcurses" >&5
ac_lib_var=`echo Hcurses'_'tgetent | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -5341,7 +5337,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lHcurses $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5468 "configure"
+#line 5464 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -5352,7 +5348,7 @@ int main() {
tgetent()
; return 0; }
EOF
-if { (eval echo configure:5479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5475: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -5371,7 +5367,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for tgetent in -ltermlib""... $ac_c" 1>&6
-echo "configure:5498: checking for tgetent in -ltermlib" >&5
+echo "configure:5494: checking for tgetent in -ltermlib" >&5
ac_lib_var=`echo termlib'_'tgetent | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -5379,7 +5375,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ltermlib $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5506 "configure"
+#line 5502 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -5390,7 +5386,7 @@ int main() {
tgetent()
; return 0; }
EOF
-if { (eval echo configure:5517: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5513: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -5409,7 +5405,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
-echo "configure:5536: checking for tgetent in -ltermcap" >&5
+echo "configure:5532: checking for tgetent in -ltermcap" >&5
ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -5417,7 +5413,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ltermcap $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5544 "configure"
+#line 5540 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -5428,7 +5424,7 @@ int main() {
tgetent()
; return 0; }
EOF
-if { (eval echo configure:5555: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5551: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -5447,7 +5443,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6
-echo "configure:5574: checking for tgetent in -lcurses" >&5
+echo "configure:5570: checking for tgetent in -lcurses" >&5
ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -5455,7 +5451,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lcurses $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5582 "configure"
+#line 5578 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -5466,7 +5462,7 @@ int main() {
tgetent()
; return 0; }
EOF
-if { (eval echo configure:5593: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5589: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -5485,7 +5481,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for tgetent in -lterminfo""... $ac_c" 1>&6
-echo "configure:5612: checking for tgetent in -lterminfo" >&5
+echo "configure:5608: checking for tgetent in -lterminfo" >&5
ac_lib_var=`echo terminfo'_'tgetent | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -5493,7 +5489,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lterminfo $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5620 "configure"
+#line 5616 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -5504,7 +5500,7 @@ int main() {
tgetent()
; return 0; }
EOF
-if { (eval echo configure:5631: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5627: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -5555,12 +5551,54 @@ fi
+# Check whether --with-cpu or --without-cpu was given.
+if test "${with_cpu+set}" = set; then
+ withval="$with_cpu"
+ case "${target}" in
+ powerpc-* | powerpcle-* )
+ ## It would be nice to keep this table in sync with the one in
+ ## gcc/configure.
+ case "${with_cpu}" in
+ ppc-uisa | rs6000 | 403 | 403GC | 505 | 860 | 601 | 602 | 603 \
+ | 604 | 750 )
+ ## Those are all handled in variants in rs6000-tdep.c, so they're fine.
+ ;;
+ common | power | power2 | rios | rios1 | rios2 | rsc | rsc1 )
+ ## These are all RS6000 variants, as far as GDB is concerned.
+ with_cpu=rs6000
+ ;;
+ 603e | ec603e )
+ with_cpu=603
+ ;;
+ 604e )
+ with_cpu=604
+ ;;
+ * )
+ echo "configure: warning: GDB: unknown --with-cpu value: \`${with_cpu}'; using \`ppc-uisa'." 1>&2
+ with_cpu=ppc-uisa
+ ;;
+ esac
+ ;;
+ * )
+ echo "configure: warning: GDB may ignore the --with-cpu flag for ${target} targets" 1>&2
+ ;;
+esac
+cat >> confdefs.h <<EOF
+#define TARGET_CPU_DEFAULT "${with_cpu}"
+EOF
+
+
+fi
+
+
+
+
# If we find X, set shell vars x_includes and x_libraries to the
# paths, otherwise set no_x=yes.
# Uses ac_ vars as temps to allow command line to override cache and checks.
# --without-x overrides everything else, but does not touch the cache.
echo $ac_n "checking for X""... $ac_c" 1>&6
-echo "configure:6771: checking for X" >&5
+echo "configure:6704: checking for X" >&5
# Check whether --with-x or --without-x was given.
if test "${with_x+set}" = set; then
@@ -5622,12 +5660,12 @@ if test "$ac_x_includes" = NO; then
# First, try using that file with no special directory specified.
cat > conftest.$ac_ext <<EOF
-#line 6833 "configure"
+#line 6766 "configure"
#include "confdefs.h"
#include <$x_direct_test_include>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6838: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6771: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -5696,14 +5734,14 @@ if test "$ac_x_libraries" = NO; then
ac_save_LIBS="$LIBS"
LIBS="-l$x_direct_test_library $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6907 "configure"
+#line 6840 "configure"
#include "confdefs.h"
int main() {
${x_direct_test_function}()
; return 0; }
EOF
-if { (eval echo configure:6914: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6847: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
LIBS="$ac_save_LIBS"
# We can link X programs with no special library path.
@@ -5983,12 +6021,12 @@ fi
echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:7265: checking for Cygwin environment" >&5
+echo "configure:7198: checking for Cygwin environment" >&5
if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7270 "configure"
+#line 7203 "configure"
#include "confdefs.h"
int main() {
@@ -5999,7 +6037,7 @@ int main() {
return __CYGWIN__;
; return 0; }
EOF
-if { (eval echo configure:7281: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7214: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_cygwin=yes
else
@@ -6016,19 +6054,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6
CYGWIN=
test "$ac_cv_cygwin" = yes && CYGWIN=yes
echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
-echo "configure:7298: checking for mingw32 environment" >&5
+echo "configure:7231: checking for mingw32 environment" >&5
if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7303 "configure"
+#line 7236 "configure"
#include "confdefs.h"
int main() {
return __MINGW32__;
; return 0; }
EOF
-if { (eval echo configure:7310: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7243: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_mingw32=yes
else
@@ -6047,7 +6085,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes
echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:7329: checking for executable suffix" >&5
+echo "configure:7262: checking for executable suffix" >&5
if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -6057,7 +6095,7 @@ else
rm -f conftest*
echo 'int main () { return 0; }' > conftest.$ac_ext
ac_cv_exeext=
- if { (eval echo configure:7339: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ if { (eval echo configure:7272: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
for file in conftest.*; do
case $file in
*.c | *.o | *.obj | *.ilk | *.pdb) ;;
@@ -6271,15 +6309,8 @@ s%@DLLTOOL@%$DLLTOOL%g
s%@WINDRES@%$WINDRES%g
s%@TERM_LIB@%$TERM_LIB%g
s%@WIN32LIBS@%$WIN32LIBS%g
-s%@ENABLE_IDE@%$ENABLE_IDE%g
-s%@FOUNDRY_LIB_BASE@%$FOUNDRY_LIB_BASE%g
s%@LIBGUI@%$LIBGUI%g
s%@GUI_CFLAGS_X@%$GUI_CFLAGS_X%g
-s%@IDE_CFLAGS_X@%$IDE_CFLAGS_X%g
-s%@IDE_X@%$IDE_X%g
-s%@LIBIDETCL@%$LIBIDETCL%g
-s%@LIBIDE@%$LIBIDE%g
-s%@IDE_DEPS@%$IDE_DEPS%g
s%@WIN32LDAPP@%$WIN32LDAPP%g
s%@TCL_VERSION@%$TCL_VERSION%g
s%@TCL_MAJOR_VERSION@%$TCL_MAJOR_VERSION%g
diff --git a/gdb/configure.in b/gdb/configure.in
index e8d6c3bcc8c..1046d2e6234 100644
--- a/gdb/configure.in
+++ b/gdb/configure.in
@@ -497,6 +497,42 @@ fi
AC_SUBST(WIN32LIBS)
+AC_ARG_WITH(cpu,
+[ --with-cpu=CPU Set the default CPU variant to debug],
+[case "${target}" in
+ powerpc-* | powerpcle-* )
+ ## It would be nice to keep this table in sync with the one in
+ ## gcc/configure.
+ case "${with_cpu}" in
+ ppc-uisa | rs6000 | 403 | 403GC | 505 | 860 | 601 | 602 | 603 \
+ | 604 | 750 )
+ ## Those are all handled in variants in rs6000-tdep.c, so they're fine.
+ ;;
+ common | power | power2 | rios | rios1 | rios2 | rsc | rsc1 )
+ ## These are all RS6000 variants, as far as GDB is concerned.
+ with_cpu=rs6000
+ ;;
+ 603e | ec603e )
+ with_cpu=603
+ ;;
+ 604e )
+ with_cpu=604
+ ;;
+ * )
+ AC_MSG_WARN(GDB: unknown --with-cpu value: \`${with_cpu}'; using \`ppc-uisa'.)
+ with_cpu=ppc-uisa
+ ;;
+ esac
+ ;;
+ * )
+ AC_MSG_WARN(GDB may ignore the --with-cpu flag for ${target} targets)
+ ;;
+esac
+AC_DEFINE_UNQUOTED(TARGET_CPU_DEFAULT, "${with_cpu}")
+],)
+
+
+
AC_PATH_X
diff --git a/gdb/defs.h b/gdb/defs.h
index 47e9dfec9e5..8d592467f2e 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -1113,6 +1113,7 @@ extern CORE_ADDR push_word (CORE_ADDR, ULONGEST);
extern int watchdog;
/* Hooks for alternate command interfaces. */
+
struct target_waitstatus;
struct cmd_list_element;
@@ -1270,4 +1271,10 @@ enum gdb_rc gdb_breakpoint (char *address, char *condition,
int thread, int ignore_count);
enum gdb_rc gdb_thread_select (/* output object */ char *tidstr);
+#ifdef UI_OUT
+/* Print a list of known thread ids. */
+enum gdb_rc gdb_list_thread_ids (/* output object */);
+
+/* Switch thread and print notification. */
+#endif
#endif /* #ifndef DEFS_H */
diff --git a/gdb/event-top.c b/gdb/event-top.c
index 3d21a1a2b21..4fbd6a0f001 100644
--- a/gdb/event-top.c
+++ b/gdb/event-top.c
@@ -246,7 +246,6 @@ display_gdb_prompt (char *new_prompt)
int prompt_length = 0;
char *gdb_prompt = get_prompt ();
-
if (target_executing && sync_execution)
{
/* This is to trick readline into not trying to display the
diff --git a/gdb/gdbcmd.h b/gdb/gdbcmd.h
index b801f08147e..0441f314ac8 100644
--- a/gdb/gdbcmd.h
+++ b/gdb/gdbcmd.h
@@ -20,6 +20,9 @@
#define GDBCMD_H 1
#include "command.h"
+#ifdef UI_OUT
+#include "ui-out.h"
+#endif
/* Chain containing all defined commands. */
@@ -108,6 +111,10 @@ execute_control_command PARAMS ((struct command_line *));
extern void print_command_line (struct command_line *, unsigned int,
struct ui_file *);
+#ifdef UI_OUT
+extern void print_command_lines PARAMS ((struct ui_out *,
+ struct command_line *, unsigned int));
+#endif
extern char **noop_completer PARAMS ((char *, char *));
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index 082d957fea8..fb439849ea6 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -34,6 +34,9 @@
#include "language.h"
#include "symfile.h"
#include "objfiles.h"
+#ifdef UI_OUT
+#include "ui-out.h"
+#endif
#include "event-top.h"
#include "parser-defs.h"
@@ -317,6 +320,16 @@ Start it from the beginning? "))
if (from_tty)
{
+#ifdef UI_OUT
+ ui_out_field_string (uiout, NULL, "Starting program");
+ ui_out_text (uiout, ": ");
+ if (exec_file)
+ ui_out_field_string (uiout, "execfile", exec_file);
+ ui_out_spaces (uiout, 1);
+ ui_out_field_string (uiout, "infargs", inferior_args);
+ ui_out_text (uiout, "\n");
+ ui_out_flush (uiout);
+#else
puts_filtered ("Starting program: ");
if (exec_file)
puts_filtered (exec_file);
@@ -324,6 +337,7 @@ Start it from the beginning? "))
puts_filtered (inferior_args);
puts_filtered ("\n");
gdb_flush (gdb_stdout);
+#endif
}
target_create_inferior (exec_file, inferior_args,
@@ -1030,13 +1044,26 @@ static void
print_return_value (int structure_return, struct type *value_type)
{
register value_ptr value;
+#ifdef UI_OUT
+ static struct ui_stream *stb = NULL;
+#endif /* UI_OUT */
if (!structure_return)
{
value = value_being_returned (value_type, stop_registers, structure_return);
+#ifdef UI_OUT
+ stb = ui_out_stream_new (uiout);
+ ui_out_text (uiout, "Value returned is ");
+ ui_out_field_fmt (uiout, "gdb-result-var", "$%d", record_latest_value (value));
+ ui_out_text (uiout, "= ");
+ value_print (value, stb->stream, 0, Val_no_prettyprint);
+ ui_out_field_stream (uiout, "return-value", stb);
+ ui_out_text (uiout, "\n");
+#else /* UI_OUT */
printf_filtered ("Value returned is $%d = ", record_latest_value (value));
value_print (value, gdb_stdout, 0, Val_no_prettyprint);
printf_filtered ("\n");
+#endif /* UI_OUT */
}
else
{
@@ -1045,14 +1072,31 @@ print_return_value (int structure_return, struct type *value_type)
initiate the call, as opposed to the call_function_by_hand case */
#ifdef VALUE_RETURNED_FROM_STACK
value = 0;
+#ifdef UI_OUT
+ ui_out_text (uiout, "Value returned has type: ");
+ ui_out_field_string (uiout, "return-type", TYPE_NAME (value_type));
+ ui_out_text (uiout, ".");
+ ui_out_text (uiout, " Cannot determine contents\n");
+#else /* UI_OUT */
printf_filtered ("Value returned has type: %s.", TYPE_NAME (value_type));
printf_filtered (" Cannot determine contents\n");
+#endif /* UI_OUT */
#else
value = value_being_returned (value_type, stop_registers, structure_return);
+#ifdef UI_OUT
+ stb = ui_out_stream_new (uiout);
+ ui_out_text (uiout, "Value returned is ");
+ ui_out_field_fmt (uiout, "gdb-result-var", "$%d", record_latest_value (value));
+ ui_out_text (uiout, "= ");
+ value_print (value, stb->stream, 0, Val_no_prettyprint);
+ ui_out_field_stream (uiout, "return-value", stb);
+ ui_out_text (uiout, "\n");
+#else
printf_filtered ("Value returned is $%d = ", record_latest_value (value));
value_print (value, gdb_stdout, 0, Val_no_prettyprint);
printf_filtered ("\n");
#endif
+#endif
}
}
@@ -1760,6 +1804,15 @@ detach_command (args, from_tty)
/* Stop the execution of the target while running in async mode, in
the backgound. */
+#ifdef UI_OUT
+void
+interrupt_target_command_wrapper (args, from_tty)
+ char *args;
+ int from_tty;
+{
+ interrupt_target_command (args, from_tty);
+}
+#endif
static void
interrupt_target_command (args, from_tty)
char *args;
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 549c515327f..57ab57607c3 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -1441,7 +1441,13 @@ handle_inferior_event (struct execution_control_state *ecs)
{
add_thread (ecs->pid);
+#ifdef UI_OUT
+ ui_out_text (uiout, "[New ");
+ ui_out_text (uiout, target_pid_or_tid_to_str (ecs->pid));
+ ui_out_text (uiout, "]\n");
+#else
printf_filtered ("[New %s]\n", target_pid_or_tid_to_str (ecs->pid));
+#endif
#if 0
/* NOTE: This block is ONLY meant to be invoked in case of a
@@ -3223,6 +3229,19 @@ print_stop_reason (enum inferior_stop_reason stop_reason, int stop_info)
break;
case SIGNAL_EXITED:
/* The inferior was terminated by a signal. */
+#ifdef UI_OUT
+ annotate_signalled ();
+ ui_out_text (uiout, "\nProgram terminated with signal ");
+ annotate_signal_name ();
+ ui_out_field_string (uiout, "signal-name", target_signal_to_name (stop_info));
+ annotate_signal_name_end ();
+ ui_out_text (uiout, ", ");
+ annotate_signal_string ();
+ ui_out_field_string (uiout, "signal-meaning", target_signal_to_string (stop_info));
+ annotate_signal_string_end ();
+ ui_out_text (uiout, ".\n");
+ ui_out_text (uiout, "The program no longer exists.\n");
+#else
annotate_signalled ();
printf_filtered ("\nProgram terminated with signal ");
annotate_signal_name ();
@@ -3236,19 +3255,46 @@ print_stop_reason (enum inferior_stop_reason stop_reason, int stop_info)
printf_filtered ("The program no longer exists.\n");
gdb_flush (gdb_stdout);
+#endif
break;
case EXITED:
/* The inferior program is finished. */
+#ifdef UI_OUT
+ annotate_exited (stop_info);
+ if (stop_info)
+ {
+ ui_out_text (uiout, "\nProgram exited with code ");
+ ui_out_field_fmt (uiout, "exit-code", "0%o", (unsigned int) stop_info);
+ ui_out_text (uiout, ".\n");
+ }
+ else
+ {
+ ui_out_text (uiout, "\nProgram exited normally.\n");
+ }
+#else
annotate_exited (stop_info);
if (stop_info)
printf_filtered ("\nProgram exited with code 0%o.\n",
(unsigned int) stop_info);
else
printf_filtered ("\nProgram exited normally.\n");
+#endif
break;
case SIGNAL_RECEIVED:
/* Signal received. The signal table tells us to print about
it. */
+#ifdef UI_OUT
+ annotate_signal ();
+ ui_out_text (uiout, "\nProgram received signal ");
+ annotate_signal_name ();
+ ui_out_field_string (uiout, "signal-name", target_signal_to_name (stop_info));
+ annotate_signal_name_end ();
+ ui_out_text (uiout, ", ");
+ annotate_signal_string ();
+ ui_out_field_string (uiout, "signal-meaning", target_signal_to_string (stop_info));
+ annotate_signal_string_end ();
+ ui_out_text (uiout, ".\n");
+#else
annotate_signal ();
printf_filtered ("\nProgram received signal ");
annotate_signal_name ();
@@ -3260,6 +3306,7 @@ print_stop_reason (enum inferior_stop_reason stop_reason, int stop_info)
annotate_signal_string_end ();
printf_filtered (".\n");
gdb_flush (gdb_stdout);
+#endif
break;
default:
internal_error ("print_stop_reason: unrecognized enum value");
diff --git a/gdb/main.c b/gdb/main.c
index c5c4e96fd9f..6c9baa34c21 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -32,6 +32,7 @@
#include "gdb_string.h"
#include "event-loop.h"
+#include "ui-out.h"
#if defined (TUI) || defined (GDBTK)
/* FIXME: cagney/2000-01-31: This #include is to allow older code such
as that found in the TUI to continue to build. */
@@ -254,6 +255,9 @@ captured_main (void *data)
{"command", required_argument, 0, 'x'},
{"version", no_argument, &print_version, 1},
{"x", required_argument, 0, 'x'},
+ {"ui", required_argument, 0, 'i'},
+ {"interpreter", required_argument, 0, 'i'},
+ {"i", required_argument, 0, 'i'},
{"directory", required_argument, 0, 'd'},
{"d", required_argument, 0, 'd'},
{"cd", required_argument, 0, 11},
@@ -739,6 +743,10 @@ Options:\n\n\
--help Print this message.\n\
", stream);
fputs_unfiltered ("\
+ --interpreter=INTERP\n\
+ Select a specific interpreter / user interface\n\
+", stream);
+ fputs_unfiltered ("\
--mapped Use mapped symbol files if supported on this system.\n\
--nw Do not use a window interface.\n\
--nx Do not read ", stream);
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
index 9fac1f39b4b..0528e2b0426 100644
--- a/gdb/printcmd.c
+++ b/gdb/printcmd.c
@@ -35,6 +35,9 @@
#include "annotate.h"
#include "symfile.h" /* for overlay functions */
#include "objfiles.h" /* ditto */
+#ifdef UI_OUT
+#include "ui-out.h"
+#endif
extern int asm_demangle; /* Whether to demangle syms in asm printouts */
extern int addressprint; /* Whether to print hex addresses in HLL " */
@@ -1777,6 +1780,13 @@ print_frame_args (func, fi, num, stream)
int arg_size;
/* Number of ints of arguments that we have printed so far. */
int args_printed = 0;
+#ifdef UI_OUT
+ struct cleanup *old_chain;
+ struct ui_stream *stb;
+
+ stb = ui_out_stream_new (uiout);
+ old_chain = make_cleanup ((make_cleanup_func) ui_out_stream_delete, stb);
+#endif /* UI_OUT */
if (func)
{
@@ -1881,6 +1891,21 @@ print_frame_args (func, fi, num, stream)
sym = nsym;
}
+#ifdef UI_OUT
+ /* Print the current arg. */
+ if (!first)
+ ui_out_text (uiout, ", ");
+ ui_out_wrap_hint (uiout, " ");
+
+ annotate_arg_begin ();
+
+ ui_out_list_begin (uiout, NULL);
+ fprintf_symbol_filtered (stb->stream, SYMBOL_SOURCE_NAME (sym),
+ SYMBOL_LANGUAGE (sym), DMGL_PARAMS | DMGL_ANSI);
+ ui_out_field_stream (uiout, "name", stb);
+ annotate_arg_name_end ();
+ ui_out_text (uiout, "=");
+#else
/* Print the current arg. */
if (!first)
fprintf_filtered (stream, ", ");
@@ -1892,6 +1917,7 @@ print_frame_args (func, fi, num, stream)
SYMBOL_LANGUAGE (sym), DMGL_PARAMS | DMGL_ANSI);
annotate_arg_name_end ();
fputs_filtered ("=", stream);
+#endif
/* Avoid value_print because it will deref ref parameters. We just
want to print their addresses. Print ??? for args whose address
@@ -1907,12 +1933,24 @@ print_frame_args (func, fi, num, stream)
if (GDB_TARGET_IS_D10V
&& SYMBOL_CLASS (sym) == LOC_REGPARM && TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_PTR)
TYPE_LENGTH (VALUE_TYPE (val)) = 2;
+#ifdef UI_OUT
+ val_print (VALUE_TYPE (val), VALUE_CONTENTS (val), 0,
+ VALUE_ADDRESS (val),
+ stb->stream, 0, 0, 2, Val_no_prettyprint);
+ ui_out_field_stream (uiout, "value", stb);
+ }
+ else
+ ui_out_text (uiout, "???");
+
+ ui_out_list_end (uiout);
+#else
val_print (VALUE_TYPE (val), VALUE_CONTENTS (val), 0,
VALUE_ADDRESS (val),
stream, 0, 0, 2, Val_no_prettyprint);
}
else
fputs_filtered ("???", stream);
+#endif
annotate_arg_end ();
@@ -1933,6 +1971,9 @@ print_frame_args (func, fi, num, stream)
print_frame_nameless_args (fi, start, num - args_printed,
first, stream);
}
+#ifdef UI_OUT
+ do_cleanups (old_chain);
+#endif /* no UI_OUT */
}
/* Print nameless args on STREAM.
diff --git a/gdb/remote.c b/gdb/remote.c
index 72ff24d05ec..674a03ea5c4 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -758,7 +758,13 @@ record_currthread (currthread)
if (!in_thread_list (currthread))
{
add_thread (currthread);
+#ifdef UI_OUT
+ ui_out_text (uiout, "[New ");
+ ui_out_text (uiout, target_pid_to_str (currthread));
+ ui_out_text (uiout, "]\n");
+#else
printf_filtered ("[New %s]\n", target_pid_to_str (currthread));
+#endif
}
}
diff --git a/gdb/source.c b/gdb/source.c
index 358cac9e496..dd26043b2cb 100644
--- a/gdb/source.c
+++ b/gdb/source.c
@@ -38,6 +38,9 @@
#include "objfiles.h"
#include "annotate.h"
#include "gdbtypes.h"
+#ifdef UI_OUT
+#include "ui-out.h"
+#endif
#ifdef CRLF_SOURCE_FILES
@@ -1011,6 +1014,11 @@ print_source_lines_base (s, line, stopline, noerror)
current_source_line = line;
first_line_listed = line;
+#ifdef UI_OUT
+ /* If printing of source lines is disabled, just print file and line number */
+ if (ui_out_test_flags (uiout, ui_source_list))
+ {
+#endif
/* Only prints "No such file or directory" once */
if ((s != last_source_visited) || (!last_source_error))
{
@@ -1022,6 +1030,14 @@ print_source_lines_base (s, line, stopline, noerror)
desc = last_source_error;
noerror = 1;
}
+#ifdef UI_OUT
+ }
+ else
+ {
+ desc = -1;
+ noerror = 1;
+ }
+#endif
if (desc < 0)
{
@@ -1034,7 +1050,14 @@ print_source_lines_base (s, line, stopline, noerror)
print_sys_errmsg (name, errno);
}
else
+#ifdef UI_OUT
+ ui_out_field_int (uiout, "line", line);
+ ui_out_text (uiout, "\tin ");
+ ui_out_field_string (uiout, "file", s->filename);
+ ui_out_text (uiout, "\n");
+#else
printf_filtered ("%d\tin %s\n", line, s->filename);
+#endif
return;
}
@@ -1062,6 +1085,44 @@ print_source_lines_base (s, line, stopline, noerror)
while (nlines-- > 0)
{
+#ifdef UI_OUT
+ char buf[20];
+
+ c = fgetc (stream);
+ if (c == EOF)
+ break;
+ last_line_listed = current_source_line;
+ sprintf (buf, "%d\t", current_source_line++);
+ ui_out_text (uiout, buf);
+ do
+ {
+ if (c < 040 && c != '\t' && c != '\n' && c != '\r')
+ {
+ sprintf (buf, "^%c", c + 0100);
+ ui_out_text (uiout, buf);
+ }
+ else if (c == 0177)
+ ui_out_text (uiout, "^?");
+#ifdef CRLF_SOURCE_FILES
+ else if (c == '\r')
+ {
+ /* Skip a \r character, but only before a \n. */
+ int c1 = fgetc (stream);
+
+ if (c1 != '\n')
+ printf_filtered ("^%c", c + 0100);
+ if (c1 != EOF)
+ ungetc (c1, stream);
+ }
+#endif
+ else
+ {
+ sprintf (buf, "%c", c);
+ ui_out_text (uiout, buf);
+ }
+ }
+ while (c != '\n' && (c = fgetc (stream)) >= 0);
+#else
c = fgetc (stream);
if (c == EOF)
break;
@@ -1083,6 +1144,7 @@ print_source_lines_base (s, line, stopline, noerror)
printf_filtered ("%c", c);
}
while (c != '\n' && (c = fgetc (stream)) >= 0);
+#endif
}
fclose (stream);
diff --git a/gdb/stack.c b/gdb/stack.c
index 7e414c549f8..f0cae6e14e5 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -36,6 +36,9 @@
#include "annotate.h"
#include "symfile.h"
#include "objfiles.h"
+#ifdef UI_OUT
+#include "ui-out.h"
+#endif
/* Prototypes for exported functions. */
@@ -429,8 +432,13 @@ print_frame_info_base (fi, level, source, args)
{
if (addressprint && mid_statement && !tui_version)
{
+#ifdef UI_OUT
+ ui_out_field_core_addr (uiout, "addr", fi->pc);
+ ui_out_text (uiout, "\t");
+#else
print_address_numeric (fi->pc, 1, gdb_stdout);
printf_filtered ("\t");
+#endif
}
if (print_frame_info_listing_hook)
print_frame_info_listing_hook (sal.symtab, sal.line, sal.line + 1, 0);
@@ -458,6 +466,13 @@ print_frame (struct frame_info *fi,
struct symbol *func;
register char *funname = 0;
enum language funlang = language_unknown;
+#ifdef UI_OUT
+ struct ui_stream *stb;
+ struct cleanup *old_chain;
+
+ stb = ui_out_stream_new (uiout);
+ old_chain = make_cleanup ((make_cleanup_func) ui_out_stream_delete, stb);
+#endif /* UI_OUT */
func = find_pc_function (fi->pc);
if (func)
@@ -536,37 +551,87 @@ print_frame (struct frame_info *fi,
annotate_frame_begin (level == -1 ? 0 : level, fi->pc);
+#ifdef UI_OUT
+ ui_out_list_begin (uiout, "frame");
+#endif
if (level >= 0)
- printf_filtered ("#%-2d ", level);
+ {
+#ifdef UI_OUT
+ ui_out_text (uiout, "#");
+ ui_out_field_fmt (uiout, "level", "%-2d", level);
+ ui_out_spaces (uiout, 1);
+#else
+ printf_filtered ("#%-2d ", level);
+#endif
+ }
if (addressprint)
if (fi->pc != sal.pc || !sal.symtab || source == LOC_AND_ADDRESS)
{
annotate_frame_address ();
+#ifdef UI_OUT
+ ui_out_field_core_addr (uiout, "addr", fi->pc);
+ annotate_frame_address_end ();
+ ui_out_text (uiout, " in ");
+#else
print_address_numeric (fi->pc, 1, gdb_stdout);
annotate_frame_address_end ();
printf_filtered (" in ");
+#endif
}
annotate_frame_function_name ();
+#ifdef UI_OUT
+ fprintf_symbol_filtered (stb->stream, funname ? funname : "??", funlang,
+ DMGL_ANSI);
+ ui_out_field_stream (uiout, "func", stb);
+ ui_out_wrap_hint (uiout, " ");
+#else
fprintf_symbol_filtered (gdb_stdout, funname ? funname : "??", funlang,
DMGL_ANSI);
wrap_here (" ");
+#endif
annotate_frame_args ();
+#ifdef UI_OUT
+ ui_out_text (uiout, " (");
+#else
fputs_filtered (" (", gdb_stdout);
+#endif
if (args)
{
struct print_args_args args;
args.fi = fi;
args.func = func;
args.stream = gdb_stdout;
+#ifdef UI_OUT
+ ui_out_list_begin (uiout, "args");
catch_errors (print_args_stub, &args, "", RETURN_MASK_ALL);
+ /* FIXME: args must be a list. If one argument is a string it will
+ have " that will not be properly escaped. */
+ ui_out_list_end (uiout);
+#else
+ catch_errors (print_args_stub, &args, "", RETURN_MASK_ALL);
+#endif
QUIT;
}
+#ifdef UI_OUT
+ ui_out_text (uiout, ")");
+#else
printf_filtered (")");
+#endif
if (sal.symtab && sal.symtab->filename)
{
annotate_frame_source_begin ();
+#ifdef UI_OUT
+ ui_out_wrap_hint (uiout, " ");
+ ui_out_text (uiout, " at ");
+ annotate_frame_source_file ();
+ ui_out_field_string (uiout, "file", sal.symtab->filename);
+ annotate_frame_source_file_end ();
+ ui_out_text (uiout, ":");
+ annotate_frame_source_line ();
+ ui_out_field_int (uiout, "line", sal.line);
+#else
wrap_here (" ");
printf_filtered (" at ");
annotate_frame_source_file ();
@@ -575,6 +640,7 @@ print_frame (struct frame_info *fi,
printf_filtered (":");
annotate_frame_source_line ();
printf_filtered ("%d", sal.line);
+#endif
annotate_frame_source_end ();
}
@@ -585,8 +651,14 @@ print_frame (struct frame_info *fi,
if (!funname)
{
annotate_frame_where ();
+#ifdef UI_OUT
+ ui_out_wrap_hint (uiout, " ");
+ ui_out_text (uiout, " from ");
+ ui_out_field_string (uiout, "from", PC_LOAD_SEGMENT (fi->pc));
+#else
wrap_here (" ");
printf_filtered (" from %s", PC_LOAD_SEGMENT (fi->pc));
+#endif
}
#endif /* PC_LOAD_SEGMENT */
@@ -597,13 +669,25 @@ print_frame (struct frame_info *fi,
if (lib)
{
annotate_frame_where ();
+#ifdef UI_OUT
+ ui_out_wrap_hint (uiout, " ");
+ ui_out_text (uiout, " from ");
+ ui_out_field_string (uiout, "from", lib);
+#else
wrap_here (" ");
printf_filtered (" from %s", lib);
+#endif
}
}
#endif /* PC_SOLIB */
+#ifdef UI_OUT
+ ui_out_list_end (uiout);
+ ui_out_text (uiout, "\n");
+ do_cleanups (old_chain);
+#else
printf_filtered ("\n");
+#endif
}
@@ -1649,6 +1733,15 @@ find_relative_frame (frame, level_offset_ptr)
frame expressions. */
/* ARGSUSED */
+#ifdef UI_OUT
+void
+select_frame_command_wrapper (level_exp, from_tty)
+ char *level_exp;
+ int from_tty;
+{
+ select_frame_command (level_exp, from_tty);
+}
+#endif
static void
select_frame_command (level_exp, from_tty)
char *level_exp;
@@ -1798,6 +1891,15 @@ down_command (count_exp, from_tty)
show_and_print_stack_frame (selected_frame, selected_frame_level, 1);
}
+#ifdef UI_OUT
+void
+return_command_wrapper (retval_exp, from_tty)
+ char *retval_exp;
+ int from_tty;
+{
+ return_command (retval_exp, from_tty);
+}
+#endif
static void
return_command (retval_exp, from_tty)
char *retval_exp;
diff --git a/gdb/symfile.c b/gdb/symfile.c
index 0726d1a6540..5b2a2ff5657 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -1299,9 +1299,14 @@ generic_load (char *args, int from_tty)
/* Is this really necessary? I guess it gives the user something
to look at during a long download. */
+#ifdef UI_OUT
+ ui_out_message (uiout, 0, "Loading section %s, size 0x%s lma 0x%s\n",
+ sect_name, paddr_nz (size), paddr_nz (lma));
+#else
fprintf_unfiltered (gdb_stdout,
"Loading section %s, size 0x%s lma 0x%s\n",
sect_name, paddr_nz (size), paddr_nz (lma));
+#endif
bfd_get_section_contents (loadfile_bfd, s, buffer, 0, size);
@@ -1364,9 +1369,18 @@ generic_load (char *args, int from_tty)
{
CORE_ADDR entry;
entry = bfd_get_start_address (loadfile_bfd);
+#ifdef UI_OUT
+ ui_out_text (uiout, "Start address ");
+ ui_out_field_fmt (uiout, "address", "0x%s" , paddr_nz (entry));
+ ui_out_text (uiout, ", load size ");
+ ui_out_field_fmt (uiout, "load-size", "%ld" , data_count);
+ ui_out_text (uiout, "\n");
+
+#else
fprintf_unfiltered (gdb_stdout,
"Start address 0x%s , load size %ld\n",
paddr_nz (entry), data_count);
+#endif
/* We were doing this in remote-mips.c, I suspect it is right
for other targets too. */
write_pc (entry);
@@ -1404,6 +1418,27 @@ print_transfer_performance (struct ui_file *stream,
unsigned long write_count,
unsigned long time_count)
{
+#ifdef UI_OUT
+ ui_out_text (uiout, "Transfer rate: ");
+ if (time_count > 0)
+ {
+ ui_out_field_fmt (uiout, "transfer-rate", "%ld",
+ (data_count * 8) / time_count);
+ ui_out_text (uiout, " bits/sec");
+ }
+ else
+ {
+ ui_out_field_fmt (uiout, "transferred-bits", "%ld", (data_count * 8));
+ ui_out_text (uiout, " bits in <1 sec");
+ }
+ if (write_count > 0)
+ {
+ ui_out_text (uiout, ", ");
+ ui_out_field_fmt (uiout, "write-rate", "%ld", data_count / write_count);
+ ui_out_text (uiout, " bytes/write");
+ }
+ ui_out_text (uiout, ".\n");
+#else
fprintf_unfiltered (stream, "Transfer rate: ");
if (time_count > 0)
fprintf_unfiltered (stream, "%ld bits/sec", (data_count * 8) / time_count);
@@ -1412,6 +1447,7 @@ print_transfer_performance (struct ui_file *stream,
if (write_count > 0)
fprintf_unfiltered (stream, ", %ld bytes/write", data_count / write_count);
fprintf_unfiltered (stream, ".\n");
+#endif
}
/* This function allows the addition of incrementally linked object files.
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 91febd6a834..ceaa108e0b0 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -4031,6 +4031,15 @@ methods_info (regexp)
#endif /* 0 */
/* Breakpoint all functions matching regular expression. */
+#ifdef UI_OUT
+void
+rbreak_command_wrapper (regexp, from_tty)
+ char *regexp;
+ int from_tty;
+{
+ rbreak_command (regexp, from_tty);
+}
+#endif
static void
rbreak_command (regexp, from_tty)
char *regexp;
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 27c1004655a..b4d5d0133f2 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,14 @@
+2000-02-02 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * gdb.base/step-test.exp: Fix the steps to enter a callee by means
+ of successive stepi commands -- while in the prologue we should see
+ the function entry bracket.
+
+2000-02-02 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * gdb.base/ending-run.exp: Add ARM in thumb mode case, where we
+ reach __change_mode() when stepping through the end of main().
+
2000-01-17 Fernando Nasser <fnasser@totem.to.cygnus.com>
* gdb.base/default.exp: Fix expected pattern.
diff --git a/gdb/testsuite/configure b/gdb/testsuite/configure
index 519e32bf086..19ddd895ac2 100755
--- a/gdb/testsuite/configure
+++ b/gdb/testsuite/configure
@@ -32,6 +32,7 @@ program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
+sitefile=
srcdir=
target=NONE
verbose=
@@ -146,6 +147,7 @@ Configuration:
--help print this message
--no-create do not create output files
--quiet, --silent do not print \`checking...' messages
+ --site-file=FILE use FILE as the site file
--version print the version of autoconf that created configure
Directory and file names:
--prefix=PREFIX install architecture-independent files in PREFIX
@@ -316,6 +318,11 @@ EOF
-site=* | --site=* | --sit=*)
site="$ac_optarg" ;;
+ -site-file | --site-file | --site-fil | --site-fi | --site-f)
+ ac_prev=sitefile ;;
+ -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*)
+ sitefile="$ac_optarg" ;;
+
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
@@ -481,12 +488,16 @@ fi
srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
# Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
- if test "x$prefix" != xNONE; then
- CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
- else
- CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+if test -z "$sitefile"; then
+ if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
fi
+else
+ CONFIG_SITE="$sitefile"
fi
for ac_site_file in $CONFIG_SITE; do
if test -r "$ac_site_file"; then
@@ -575,7 +586,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi
echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:579: checking host system type" >&5
+echo "configure:590: checking host system type" >&5
host_alias=$host
case "$host_alias" in
@@ -596,7 +607,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$host" 1>&6
echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:600: checking target system type" >&5
+echo "configure:611: checking target system type" >&5
target_alias=$target
case "$target_alias" in
@@ -614,7 +625,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$target" 1>&6
echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:618: checking build system type" >&5
+echo "configure:629: checking build system type" >&5
build_alias=$build
case "$build_alias" in
diff --git a/gdb/testsuite/gdb.base/ending-run.exp b/gdb/testsuite/gdb.base/ending-run.exp
index 0e76d89605f..ec0ea644e9d 100644
--- a/gdb/testsuite/gdb.base/ending-run.exp
+++ b/gdb/testsuite/gdb.base/ending-run.exp
@@ -145,6 +145,10 @@ gdb_expect {
# This is what happens on Solaris currently -sts 1999-08-25
pass "step out of main on Solaris"
}
+ -re ".*in ..change.mode ().*$gdb_prompt $" {
+ # This is what happens on ARM in thumb mode -fn 2000-02-01
+ pass "step out of main on ARM thumb"
+ }
-re ".*in.*\\\$START\\\$.*from.*dld.sl.*$gdb_prompt $" {
pass "step out of main"
}
diff --git a/gdb/testsuite/gdb.base/step-test.exp b/gdb/testsuite/gdb.base/step-test.exp
index 903700e540c..c0acf812cd4 100644
--- a/gdb/testsuite/gdb.base/step-test.exp
+++ b/gdb/testsuite/gdb.base/step-test.exp
@@ -142,6 +142,9 @@ test_i "stepi to next line" "stepi" \
test_i "stepi into function" "stepi" \
".*${decimal}.*callee.*STEPI" \
".*callee \\(\\) at .*step-test\\.c"
+test_i "stepi to function first line" "stepi" \
+ ".*int callee\\(\\) .*\\{" \
+ ".*myglob.*"
# Have to be careful here, if the finish does not work,
# then we may run to the end of the program, which
# will cause erroneous failures in the rest of the tests
@@ -178,7 +181,7 @@ gdb_expect {
return
}
timeout {
- fail "stepi: finish call"
+ fail "stepi: finish call (timeout)"
return
}
}
diff --git a/gdb/thread.c b/gdb/thread.c
index 0ef9a76e325..c910dbb05f8 100644
--- a/gdb/thread.c
+++ b/gdb/thread.c
@@ -35,6 +35,9 @@
#include <ctype.h>
#include <sys/types.h>
#include <signal.h>
+#ifdef UI_OUT
+#include "ui-out.h"
+#endif
/*#include "lynxos-core.h" */
@@ -250,6 +253,37 @@ in_thread_list (pid)
return 0; /* Never heard of 'im */
}
+#ifdef UI_OUT
+/* Print a list of thread ids currently known, and the total number of
+ threads. To be used from within catch_errors. */
+static int
+do_captured_list_thread_ids (void *arg)
+{
+ struct thread_info *tp;
+ int num = 0;
+
+ ui_out_list_begin (uiout, "thread-ids");
+
+ for (tp = thread_list; tp; tp = tp->next)
+ {
+ num++;
+ ui_out_field_int (uiout, "thread-id", tp->num);
+ }
+
+ ui_out_list_end (uiout);
+ ui_out_field_int (uiout, "number-of-threads", num);
+ return GDB_RC_OK;
+}
+
+/* Official gdblib interface function to get a list of thread ids and
+ the total number. */
+enum gdb_rc
+gdb_list_thread_ids (/* output object */)
+{
+ return catch_errors (do_captured_list_thread_ids, NULL,
+ NULL, RETURN_MASK_ALL);
+}
+#endif
/* Load infrun state for the thread PID. */
@@ -633,15 +667,31 @@ do_captured_thread_select (void *tidstr)
tp = find_thread_id (num);
+#ifdef UI_OUT
+ if (!tp)
+ error ("Thread ID %d not known.", num);
+#else
if (!tp)
error ("Thread ID %d not known. Use the \"info threads\" command to\n\
see the IDs of currently known threads.", num);
+#endif
if (!thread_alive (tp))
error ("Thread ID %d has terminated.\n", num);
switch_to_thread (tp->pid);
+#ifdef UI_OUT
+ ui_out_text (uiout, "[Switching to thread ");
+ ui_out_field_int (uiout, "new-thread-id", pid_to_thread_id (inferior_pid));
+ ui_out_text (uiout, " (");
+#if defined(HPUXHPPA)
+ ui_out_text (uiout, target_tid_to_str (inferior_pid));
+#else
+ ui_out_text (uiout, target_pid_to_str (inferior_pid));
+#endif
+ ui_out_text (uiout, ")]");
+#else /* UI_OUT */
printf_filtered ("[Switching to thread %d (%s)]\n",
pid_to_thread_id (inferior_pid),
#if defined(HPUXHPPA)
@@ -650,6 +700,7 @@ see the IDs of currently known threads.", num);
target_pid_to_str (inferior_pid)
#endif
);
+#endif /* UI_OUT */
print_stack_frame (selected_frame, selected_frame_level, 1);
return GDB_RC_OK;
diff --git a/gdb/top.c b/gdb/top.c
index 8a26c9ec0b8..2acbb745903 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -50,6 +50,10 @@
#include "gdb_string.h"
#include "gdb_stat.h"
#include <ctype.h>
+#ifdef UI_OUT
+#include "ui-out.h"
+#include "cli-out.h"
+#endif
/* Prototypes for local functions */
@@ -774,8 +778,11 @@ gdb_init (argv0)
set_language (language_c);
expected_language = current_language; /* don't warn about the change. */
- /* All the interpreters should have had a look at things by now.
- Initialize the selected interpreter. */
+#ifdef UI_OUT
+ /* Install the default UI */
+ uiout = cli_out_new (gdb_stdout);
+#endif
+
if (init_ui_hook)
init_ui_hook (argv0);
}
@@ -835,6 +842,97 @@ get_command_line (type, arg)
}
/* Recursively print a command (including full control structures). */
+#ifdef UI_OUT
+void
+print_command_lines (uiout, cmd, depth)
+ struct ui_out *uiout;
+ struct command_line *cmd;
+ unsigned int depth;
+{
+ struct command_line *list;
+
+ list = cmd;
+ while (list)
+ {
+
+ if (depth)
+ ui_out_spaces (uiout, 2 * depth);
+
+ /* A simple command, print it and continue. */
+ if (list->control_type == simple_control)
+ {
+ ui_out_field_string (uiout, NULL, list->line);
+ ui_out_text (uiout, "\n");
+ list = list->next;
+ continue;
+ }
+
+ /* loop_continue to jump to the start of a while loop, print it
+ and continue. */
+ if (list->control_type == continue_control)
+ {
+ ui_out_field_string (uiout, NULL, "loop_continue");
+ ui_out_text (uiout, "\n");
+ list = list->next;
+ continue;
+ }
+
+ /* loop_break to break out of a while loop, print it and continue. */
+ if (list->control_type == break_control)
+ {
+ ui_out_field_string (uiout, NULL, "loop_break");
+ ui_out_text (uiout, "\n");
+ list = list->next;
+ continue;
+ }
+
+ /* A while command. Recursively print its subcommands and continue. */
+ if (list->control_type == while_control)
+ {
+ ui_out_text (uiout, "while ");
+ ui_out_field_fmt (uiout, NULL, "while %s", list->line);
+ ui_out_text (uiout, "\n");
+ print_command_lines (uiout, *list->body_list, depth + 1);
+ ui_out_field_string (uiout, NULL, "end");
+ if (depth)
+ ui_out_spaces (uiout, 2 * depth);
+ ui_out_text (uiout, "end\n");
+ list = list->next;
+ continue;
+ }
+
+ /* An if command. Recursively print both arms before continueing. */
+ if (list->control_type == if_control)
+ {
+ ui_out_text (uiout, "if ");
+ ui_out_field_fmt (uiout, NULL, "if %s", list->line);
+ ui_out_text (uiout, "\n");
+ /* The true arm. */
+ print_command_lines (uiout, list->body_list[0], depth + 1);
+
+ /* Show the false arm if it exists. */
+ if (list->body_count == 2)
+ {
+ if (depth)
+ ui_out_spaces (uiout, 2 * depth);
+ ui_out_field_string (uiout, NULL, "else");
+ ui_out_text (uiout, "else\n");
+ print_command_lines (uiout, list->body_list[1], depth + 1);
+ }
+
+ ui_out_field_string (uiout, NULL, "end");
+ if (depth)
+ ui_out_spaces (uiout, 2 * depth);
+ ui_out_text (uiout, "end\n");
+ list = list->next;
+ continue;
+ }
+
+ /* ignore illegal command type and try next */
+ list = list->next;
+ } /* while (list) */
+}
+#else
void
print_command_line (cmd, depth, stream)
struct command_line *cmd;
@@ -915,6 +1013,7 @@ print_command_line (cmd, depth, stream)
fputs_filtered ("end\n", stream);
}
}
+#endif
/* Execute the command in CMD. */
@@ -1514,6 +1613,41 @@ command_loop ()
}
}
+/* Read commands from `instream' and execute them until end of file or
+ error reading instream. This command loop doesnt care about any
+ such things as displaying time and space usage. If the user asks
+ for those, they won't work. */
+void
+simplified_command_loop (read_input_func, execute_command_func)
+ char *(*read_input_func) (char *);
+ void (*execute_command_func) (char *, int);
+{
+ struct cleanup *old_chain;
+ char *command;
+ int stdin_is_tty = ISATTY (stdin);
+
+ while (instream && !feof (instream))
+ {
+ quit_flag = 0;
+ if (instream == stdin && stdin_is_tty)
+ reinitialize_more_filter ();
+ old_chain = make_cleanup ((make_cleanup_func) command_loop_marker, 0);
+
+ /* Get a command-line. */
+ command = (*read_input_func) (instream == stdin ?
+ get_prompt () : (char *) NULL);
+
+ if (command == 0)
+ return;
+
+ (*execute_command_func) (command, instream == stdin);
+
+ /* Do any commands attached to breakpoint we stopped at. */
+ bpstat_do_actions (&stop_bpstat);
+
+ do_cleanups (old_chain);
+ }
+}
/* Commands call this if they do not want to be repeated by null lines. */
@@ -2975,7 +3109,12 @@ print_gdb_version (stream)
program to parse, and is just canonical program name and version
number, which starts after last space. */
+#ifdef UI_OUT
+ /* Print it console style until a format is defined */
+ fprintf_filtered (stream, "GNU gdb %s (UI_OUT)\n", version);
+#else
fprintf_filtered (stream, "GNU gdb %s\n", version);
+#endif
/* Second line is a copyright notice. */
diff --git a/gdb/top.h b/gdb/top.h
index 9e962a350ba..42ee7126836 100644
--- a/gdb/top.h
+++ b/gdb/top.h
@@ -34,6 +34,8 @@ extern void cd_command PARAMS ((char *, int));
extern void read_command_file PARAMS ((FILE *));
extern void init_history PARAMS ((void));
extern void command_loop PARAMS ((void));
+extern void simplified_command_loop PARAMS ((char *(*read_input_func) (char *),
+ void (*execute_command_func) (char *, int)));
extern int quit_confirm PARAMS ((void));
extern void quit_force PARAMS ((char *, int));
extern void quit_command PARAMS ((char *, int));
diff --git a/gdb/ui-out.c b/gdb/ui-out.c
index dfdb61d6476..9e400111443 100644
--- a/gdb/ui-out.c
+++ b/gdb/ui-out.c
@@ -1,8 +1,5 @@
/* Output generating routines for GDB.
-
- Copyright (C) 1999, 2000, 2001, 2002, 2004, 2005, 2007, 2008
- Free Software Foundation, Inc.
-
+ Copyright 1999, 2000 Free Software Foundation, Inc.
Contributed by Cygnus Solutions.
Written by Fernando Nasser for Cygnus.
@@ -10,7 +7,7 @@
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
+ the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@@ -19,14 +16,20 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
#include "defs.h"
#include "gdb_string.h"
#include "expression.h" /* For language.h */
#include "language.h"
#include "ui-out.h"
-#include "gdb_assert.h"
+
+/* Convenience macro for allocting typesafe memory. */
+
+#undef XMALLOC
+#define XMALLOC(TYPE) (TYPE*) xmalloc (sizeof (TYPE))
/* table header structures */
@@ -35,62 +38,10 @@ struct ui_out_hdr
int colno;
int width;
int alignment;
- char *col_name;
char *colhdr;
struct ui_out_hdr *next;
};
-/* Maintain a stack so that the info applicable to the inner most list
- is always available. Stack/nested level 0 is reserved for the
- top-level result. */
-
-enum { MAX_UI_OUT_LEVELS = 6 };
-
-struct ui_out_level
- {
- /* Count each field; the first element is for non-list fields */
- int field_count;
- /* The type of this level. */
- enum ui_out_type type;
- };
-
-/* Tables are special. Maintain a separate structure that tracks
- their state. At present an output can only contain a single table
- but that restriction might eventually be lifted. */
-
-struct ui_out_table
-{
- /* If on, a table is being generated. */
- int flag;
-
- /* If on, the body of a table is being generated. If off, the table
- header is being generated. */
- int body_flag;
-
- /* The level at which each entry of the table is to be found. A row
- (a tuple) is made up of entries. Consequently ENTRY_LEVEL is one
- above that of the table. */
- int entry_level;
-
- /* Number of table columns (as specified in the table_begin call). */
- int columns;
-
- /* String identifying the table (as specified in the table_begin
- call). */
- char *id;
-
- /* Points to the first table header (if any). */
- struct ui_out_hdr *header_first;
-
- /* Points to the last table header (if any). */
- struct ui_out_hdr *header_last;
-
- /* Points to header of NEXT column to format. */
- struct ui_out_hdr *header_next;
-
-};
-
-
/* The ui_out structure */
/* Any change here requires a corresponding one in the initialization
of the default uiout, which is statically initialized */
@@ -102,87 +53,60 @@ struct ui_out
struct ui_out_impl *impl;
struct ui_out_data *data;
- /* Sub structure tracking the ui-out depth. */
- int level;
- struct ui_out_level levels[MAX_UI_OUT_LEVELS];
+ /* if on, a table is being generated */
+ int table_flag;
- /* A table, if any. At present only a single table is supported. */
- struct ui_out_table table;
- };
+ /* if on, the body of a table is being generated */
+ int body_flag;
-/* The current (inner most) level. */
-static struct ui_out_level *
-current_level (struct ui_out *uiout)
-{
- return &uiout->levels[uiout->level];
-}
+ /* number of table columns (as specified in the table_begin call) */
+ int table_columns;
-/* Create a new level, of TYPE. Return the new level's index. */
-static int
-push_level (struct ui_out *uiout,
- enum ui_out_type type,
- const char *id)
-{
- struct ui_out_level *current;
- /* We had better not overflow the buffer. */
- uiout->level++;
- gdb_assert (uiout->level >= 0 && uiout->level < MAX_UI_OUT_LEVELS);
- current = current_level (uiout);
- current->field_count = 0;
- current->type = type;
- return uiout->level;
-}
-
-/* Discard the current level, return the discarded level's index.
- TYPE is the type of the level being discarded. */
-static int
-pop_level (struct ui_out *uiout,
- enum ui_out_type type)
-{
- /* We had better not underflow the buffer. */
- gdb_assert (uiout->level > 0 && uiout->level < MAX_UI_OUT_LEVELS);
- gdb_assert (current_level (uiout)->type == type);
- uiout->level--;
- return uiout->level + 1;
-}
+ /* strinf identifying the table (as specified in the table_begin call) */
+ char *table_id;
+
+ /* if on, a list is being generated. The value is the level of nesting */
+ int list_flag;
+ /* we count each field; the first element is for non-list fields */
+ int field_count[5];
+
+ /* points to the first header (if any) */
+ struct ui_out_hdr *headerfirst;
+
+ /* points to the last header (if any) */
+ struct ui_out_hdr *headerlast;
+
+ /* points to header of next column to format */
+ struct ui_out_hdr *headercurr;
+
+ };
/* These are the default implementation functions */
static void default_table_begin (struct ui_out *uiout, int nbrofcols,
- int nr_rows, const char *tblid);
+ char *tblid);
static void default_table_body (struct ui_out *uiout);
static void default_table_end (struct ui_out *uiout);
static void default_table_header (struct ui_out *uiout, int width,
- enum ui_align alig, const char *col_name,
- const char *colhdr);
-static void default_begin (struct ui_out *uiout,
- enum ui_out_type type,
- int level, const char *id);
-static void default_end (struct ui_out *uiout,
- enum ui_out_type type,
- int level);
+ enum ui_align alig, char *colhdr);
+static void default_list_begin (struct ui_out *uiout, int list_flag,
+ char *lstid);
+static void default_list_end (struct ui_out *uiout, int list_flag);
static void default_field_int (struct ui_out *uiout, int fldno, int width,
- enum ui_align alig,
- const char *fldname,
- int value);
+ enum ui_align alig, char *fldname, int value);
static void default_field_skip (struct ui_out *uiout, int fldno, int width,
- enum ui_align alig,
- const char *fldname);
+ enum ui_align alig, char *fldname);
static void default_field_string (struct ui_out *uiout, int fldno, int width,
- enum ui_align align,
- const char *fldname,
+ enum ui_align align, char *fldname,
const char *string);
static void default_field_fmt (struct ui_out *uiout, int fldno,
int width, enum ui_align align,
- const char *fldname,
- const char *format,
- va_list args) ATTR_FORMAT (printf, 6, 0);
+ char *fldname, char *format, va_list args);
static void default_spaces (struct ui_out *uiout, int numspaces);
-static void default_text (struct ui_out *uiout, const char *string);
-static void default_message (struct ui_out *uiout, int verbosity,
- const char *format,
- va_list args) ATTR_FORMAT (printf, 3, 0);
+static void default_text (struct ui_out *uiout, char *string);
+static void default_message (struct ui_out *uiout, int verbosity, char *format,
+ va_list args);
static void default_wrap_hint (struct ui_out *uiout, char *identstring);
static void default_flush (struct ui_out *uiout);
@@ -194,8 +118,8 @@ struct ui_out_impl default_ui_out_impl =
default_table_body,
default_table_end,
default_table_header,
- default_begin,
- default_end,
+ default_list_begin,
+ default_list_end,
default_field_int,
default_field_skip,
default_field_string,
@@ -204,9 +128,7 @@ struct ui_out_impl default_ui_out_impl =
default_text,
default_message,
default_wrap_hint,
- default_flush,
- NULL,
- 0, /* Does not need MI hacks. */
+ default_flush
};
/* The default ui_out */
@@ -225,296 +147,195 @@ struct ui_out *uiout = &def_uiout;
/* These are the interfaces to implementation functions */
-static void uo_table_begin (struct ui_out *uiout, int nbrofcols,
- int nr_rows, const char *tblid);
+static void uo_table_begin (struct ui_out *uiout, int nbrofcols, char *tblid);
static void uo_table_body (struct ui_out *uiout);
static void uo_table_end (struct ui_out *uiout);
static void uo_table_header (struct ui_out *uiout, int width,
- enum ui_align align, const char *col_name,
- const char *colhdr);
-static void uo_begin (struct ui_out *uiout,
- enum ui_out_type type,
- int level, const char *id);
-static void uo_end (struct ui_out *uiout,
- enum ui_out_type type,
- int level);
+ enum ui_align align, char *colhdr);
+static void uo_list_begin (struct ui_out *uiout, int list_flag, char *lstid);
+static void uo_list_end (struct ui_out *uiout, int list_flag);
static void uo_field_int (struct ui_out *uiout, int fldno, int width,
- enum ui_align align, const char *fldname, int value);
+ enum ui_align align, char *fldname, int value);
static void uo_field_skip (struct ui_out *uiout, int fldno, int width,
- enum ui_align align, const char *fldname);
+ enum ui_align align, char *fldname);
static void uo_field_string (struct ui_out *uiout, int fldno, int width,
- enum ui_align align, const char *fldname,
- const char *string);
+ enum ui_align align, char *fldname, const char *string);
static void uo_field_fmt (struct ui_out *uiout, int fldno, int width,
- enum ui_align align, const char *fldname,
- const char *format, va_list args)
- ATTR_FORMAT (printf, 6, 0);
+ enum ui_align align, char *fldname,
+ char *format, va_list args);
static void uo_spaces (struct ui_out *uiout, int numspaces);
-static void uo_text (struct ui_out *uiout, const char *string);
+static void uo_text (struct ui_out *uiout, char *string);
static void uo_message (struct ui_out *uiout, int verbosity,
- const char *format, va_list args)
- ATTR_FORMAT (printf, 3, 0);
+ char *format, va_list args);
static void uo_wrap_hint (struct ui_out *uiout, char *identstring);
static void uo_flush (struct ui_out *uiout);
-static int uo_redirect (struct ui_out *uiout, struct ui_file *outstream);
/* Prototypes for local functions */
extern void _initialize_ui_out (void);
-static void append_header_to_list (struct ui_out *uiout, int width,
- int alignment, const char *col_name,
- const char *colhdr);
-static int get_next_header (struct ui_out *uiout, int *colno, int *width,
+static void append_header_to_list (struct ui_out *uiout, int width, int alignment, char *colhdr);
+static int get_curr_header (struct ui_out *uiout, int *colno, int *width,
int *alignment, char **colhdr);
static void clear_header_list (struct ui_out *uiout);
-static void verify_field (struct ui_out *uiout, int *fldno, int *width,
- int *align);
+static void verify_field_proper_position (struct ui_out *uiout);
+static void verify_field_alignment (struct ui_out *uiout, int fldno, int *width, int *alignment);
+
+static void init_ui_out_state (struct ui_out *uiout);
/* exported functions (ui_out API) */
/* Mark beginning of a table */
-static void
-ui_out_table_begin (struct ui_out *uiout, int nbrofcols,
- int nr_rows,
- const char *tblid)
-{
- if (uiout->table.flag)
- internal_error (__FILE__, __LINE__,
- _("tables cannot be nested; table_begin found before \
-previous table_end."));
-
- uiout->table.flag = 1;
- uiout->table.body_flag = 0;
- uiout->table.entry_level = uiout->level + 1;
- uiout->table.columns = nbrofcols;
+void
+ui_out_table_begin (uiout, nbrofcols, tblid)
+ struct ui_out *uiout;
+ int nbrofcols;
+ char *tblid;
+{
+ if (uiout->table_flag)
+ internal_error ("gdb/ui_out.c: tables cannot be nested; table_begin found before \
+previous table_end.");
+
+ uiout->table_flag = 1;
+ uiout->table_columns = nbrofcols;
if (tblid != NULL)
- uiout->table.id = xstrdup (tblid);
+ uiout->table_id = xstrdup (tblid);
else
- uiout->table.id = NULL;
+ uiout->table_id = NULL;
clear_header_list (uiout);
- uo_table_begin (uiout, nbrofcols, nr_rows, uiout->table.id);
+ uo_table_begin (uiout, nbrofcols, uiout->table_id);
}
void
-ui_out_table_body (struct ui_out *uiout)
-{
- if (!uiout->table.flag)
- internal_error (__FILE__, __LINE__,
- _("table_body outside a table is not valid; it must be \
-after a table_begin and before a table_end."));
- if (uiout->table.body_flag)
- internal_error (__FILE__, __LINE__,
- _("extra table_body call not allowed; there must be \
-only one table_body after a table_begin and before a table_end."));
- if (uiout->table.header_next->colno != uiout->table.columns)
- internal_error (__FILE__, __LINE__,
- _("number of headers differ from number of table \
-columns."));
-
- uiout->table.body_flag = 1;
- uiout->table.header_next = uiout->table.header_first;
+ui_out_table_body (uiout)
+ struct ui_out *uiout;
+{
+ if (!uiout->table_flag)
+ internal_error ("gdb/ui_out.c: table_body outside a table is not valid; it must be \
+after a table_begin and before a table_end.");
+ if (uiout->body_flag)
+ internal_error ("gdb/ui_out.c: extra table_body call not allowed; there must be \
+only one table_body after a table_begin and before a table_end.");
+ if (uiout->headercurr->colno != uiout->table_columns)
+ internal_error ("gdb/ui_out.c: number of headers differ from number of table \
+columns.");
+
+ uiout->body_flag = 1;
+ uiout->headercurr = uiout->headerfirst;
uo_table_body (uiout);
}
-static void
-ui_out_table_end (struct ui_out *uiout)
+void
+ui_out_table_end (uiout)
+ struct ui_out *uiout;
{
- if (!uiout->table.flag)
- internal_error (__FILE__, __LINE__,
- _("misplaced table_end or missing table_begin."));
+ if (!uiout->table_flag)
+ internal_error ("gdb/ui_out.c: misplaced table_end or missing table_begin.");
- uiout->table.entry_level = 0;
- uiout->table.body_flag = 0;
- uiout->table.flag = 0;
+ uiout->body_flag = 0;
+ uiout->table_flag = 0;
uo_table_end (uiout);
- if (uiout->table.id)
- xfree (uiout->table.id);
+ if (uiout->table_id)
+ free (uiout->table_id);
clear_header_list (uiout);
}
void
-ui_out_table_header (struct ui_out *uiout, int width, enum ui_align alignment,
- const char *col_name,
- const char *colhdr)
+ui_out_table_header (uiout, width, alignment, colhdr)
+ struct ui_out *uiout;
+ int width;
+ enum ui_align alignment;
+ char *colhdr;
{
- if (!uiout->table.flag || uiout->table.body_flag)
- internal_error (__FILE__, __LINE__,
- _("table header must be specified after table_begin \
-and before table_body."));
-
- append_header_to_list (uiout, width, alignment, col_name, colhdr);
-
- uo_table_header (uiout, width, alignment, col_name, colhdr);
-}
-
-static void
-do_cleanup_table_end (void *data)
-{
- struct ui_out *ui_out = data;
-
- ui_out_table_end (ui_out);
-}
-
-struct cleanup *
-make_cleanup_ui_out_table_begin_end (struct ui_out *ui_out, int nr_cols,
- int nr_rows, const char *tblid)
-{
- ui_out_table_begin (ui_out, nr_cols, nr_rows, tblid);
- return make_cleanup (do_cleanup_table_end, ui_out);
-}
-
-void
-ui_out_begin (struct ui_out *uiout,
- enum ui_out_type type,
- const char *id)
-{
- int new_level;
- if (uiout->table.flag && !uiout->table.body_flag)
- internal_error (__FILE__, __LINE__,
- _("table header or table_body expected; lists must be \
-specified after table_body."));
-
- /* Be careful to verify the ``field'' before the new tuple/list is
- pushed onto the stack. That way the containing list/table/row is
- verified and not the newly created tuple/list. This verification
- is needed (at least) for the case where a table row entry
- contains either a tuple/list. For that case bookkeeping such as
- updating the column count or advancing to the next heading still
- needs to be performed. */
- {
- int fldno;
- int width;
- int align;
- verify_field (uiout, &fldno, &width, &align);
- }
-
- new_level = push_level (uiout, type, id);
+ if (!uiout->table_flag || uiout->body_flag)
+ internal_error ("ui_out: table header must be specified after table_begin \
+and before table_body.");
- /* If the push puts us at the same level as a table row entry, we've
- got a new table row. Put the header pointer back to the start. */
- if (uiout->table.body_flag
- && uiout->table.entry_level == new_level)
- uiout->table.header_next = uiout->table.header_first;
+ append_header_to_list (uiout, width, alignment, colhdr);
- uo_begin (uiout, type, new_level, id);
+ uo_table_header (uiout, width, alignment, colhdr);
}
void
-ui_out_end (struct ui_out *uiout,
- enum ui_out_type type)
+ui_out_list_begin (uiout, lstid)
+ struct ui_out *uiout;
+ char *lstid;
{
- int old_level = pop_level (uiout, type);
- uo_end (uiout, type, old_level);
-}
+ if (uiout->table_flag && !uiout->body_flag)
+ internal_error ("ui_out: table header or table_body expected; lists must be \
+specified after table_body.");
+ if (uiout->list_flag >= 4)
+ internal_error ("ui_out: list depth exceeded; only 4 levels of lists can be \
+nested.");
-struct ui_out_end_cleanup_data
-{
- struct ui_out *uiout;
- enum ui_out_type type;
-};
+ uiout->list_flag++;
+ uiout->field_count[uiout->list_flag] = 0;
+ if (uiout->table_flag && (uiout->list_flag == 1))
+ uiout->headercurr = uiout->headerfirst;
-static void
-do_cleanup_end (void *data)
-{
- struct ui_out_end_cleanup_data *end_cleanup_data = data;
- ui_out_end (end_cleanup_data->uiout, end_cleanup_data->type);
- xfree (end_cleanup_data);
+ uo_list_begin (uiout, uiout->list_flag, lstid);
}
-static struct cleanup *
-make_cleanup_ui_out_end (struct ui_out *uiout,
- enum ui_out_type type)
+void
+ui_out_list_end (uiout)
+ struct ui_out *uiout;
{
- struct ui_out_end_cleanup_data *end_cleanup_data;
- end_cleanup_data = XMALLOC (struct ui_out_end_cleanup_data);
- end_cleanup_data->uiout = uiout;
- end_cleanup_data->type = type;
- return make_cleanup (do_cleanup_end, end_cleanup_data);
-}
+ if (!uiout->list_flag)
+ internal_error ("ui_out: misplaced list_end; there is no list to be closed.");
-struct cleanup *
-make_cleanup_ui_out_tuple_begin_end (struct ui_out *uiout,
- const char *id)
-{
- ui_out_begin (uiout, ui_out_type_tuple, id);
- return make_cleanup_ui_out_end (uiout, ui_out_type_tuple);
-}
+ uo_list_end (uiout, uiout->list_flag);
-struct cleanup *
-make_cleanup_ui_out_list_begin_end (struct ui_out *uiout,
- const char *id)
-{
- ui_out_begin (uiout, ui_out_type_list, id);
- return make_cleanup_ui_out_end (uiout, ui_out_type_list);
+ uiout->list_flag--;
}
void
-ui_out_field_int (struct ui_out *uiout,
- const char *fldname,
- int value)
+ui_out_field_int (uiout, fldname, value)
+ struct ui_out *uiout;
+ char *fldname;
+ int value;
{
int fldno;
int width;
int align;
- struct ui_out_level *current = current_level (uiout);
-
- verify_field (uiout, &fldno, &width, &align);
- uo_field_int (uiout, fldno, width, align, fldname, value);
-}
+ verify_field_proper_position (uiout);
-void
-ui_out_field_fmt_int (struct ui_out *uiout,
- int input_width,
- enum ui_align input_align,
- const char *fldname,
- int value)
-{
- int fldno;
- int width;
- int align;
- struct ui_out_level *current = current_level (uiout);
+ uiout->field_count[uiout->list_flag] += 1;
+ fldno = uiout->field_count[uiout->list_flag];
- verify_field (uiout, &fldno, &width, &align);
+ verify_field_alignment (uiout, fldno, &width, &align);
- uo_field_int (uiout, fldno, input_width, input_align, fldname, value);
+ uo_field_int (uiout, fldno, width, align, fldname, value);
}
void
-ui_out_field_core_addr (struct ui_out *uiout,
- const char *fldname,
- CORE_ADDR address)
+ui_out_field_core_addr (uiout, fldname, address)
+ struct ui_out *uiout;
+ char *fldname;
+ CORE_ADDR address;
{
char addstr[20];
- int addr_bit = gdbarch_addr_bit (current_gdbarch);
- if (addr_bit < (sizeof (CORE_ADDR) * HOST_CHAR_BIT))
- address &= ((CORE_ADDR) 1 << addr_bit) - 1;
-
- /* FIXME: cagney/2002-05-03: Need local_address_string() function
- that returns the language localized string formatted to a width
- based on gdbarch_addr_bit. */
- if (addr_bit <= 32)
- strcpy (addstr, hex_string_custom (address, 8));
- else
- strcpy (addstr, hex_string_custom (address, 16));
+ /* FIXME-32x64: need a print_address_numeric with field width */
+ /* print_address_numeric (address, 1, local_stream); */
+ strcpy (addstr, local_hex_string_custom ((unsigned long) address, "08l"));
ui_out_field_string (uiout, fldname, addstr);
}
void
-ui_out_field_stream (struct ui_out *uiout,
- const char *fldname,
- struct ui_stream *buf)
+ui_out_field_stream (uiout, fldname, buf)
+ struct ui_out *uiout;
+ char *fldname;
+ struct ui_stream *buf;
{
long length;
char *buffer = ui_file_xstrdup (buf->stream, &length);
- struct cleanup *old_cleanup = make_cleanup (xfree, buffer);
+ struct cleanup *old_cleanup = make_cleanup (free, buffer);
if (length > 0)
ui_out_field_string (uiout, fldname, buffer);
else
@@ -526,45 +347,59 @@ ui_out_field_stream (struct ui_out *uiout,
/* used to ommit a field */
void
-ui_out_field_skip (struct ui_out *uiout,
- const char *fldname)
+ui_out_field_skip (uiout, fldname)
+ struct ui_out *uiout;
+ char *fldname;
{
int fldno;
int width;
int align;
- verify_field (uiout, &fldno, &width, &align);
+ verify_field_proper_position (uiout);
+
+ uiout->field_count[uiout->list_flag] += 1;
+ fldno = uiout->field_count[uiout->list_flag];
+
+ verify_field_alignment (uiout, fldno, &width, &align);
uo_field_skip (uiout, fldno, width, align, fldname);
}
void
ui_out_field_string (struct ui_out *uiout,
- const char *fldname,
+ char *fldname,
const char *string)
{
int fldno;
int width;
int align;
- verify_field (uiout, &fldno, &width, &align);
+ verify_field_proper_position (uiout);
+
+ uiout->field_count[uiout->list_flag] += 1;
+ fldno = uiout->field_count[uiout->list_flag];
+
+ verify_field_alignment (uiout, fldno, &width, &align);
uo_field_string (uiout, fldno, width, align, fldname, string);
}
/* VARARGS */
void
-ui_out_field_fmt (struct ui_out *uiout,
- const char *fldname,
- const char *format, ...)
+ui_out_field_fmt (struct ui_out *uiout, char *fldname, char *format,...)
{
va_list args;
int fldno;
int width;
int align;
+ verify_field_proper_position (uiout);
+
+ uiout->field_count[uiout->list_flag] += 1;
+ fldno = uiout->field_count[uiout->list_flag];
+
/* will not align, but has to call anyway */
- verify_field (uiout, &fldno, &width, &align);
+ verify_field_alignment (uiout, fldno, &width, &align);
va_start (args, format);
@@ -574,21 +409,23 @@ ui_out_field_fmt (struct ui_out *uiout,
}
void
-ui_out_spaces (struct ui_out *uiout, int numspaces)
+ui_out_spaces (uiout, numspaces)
+ struct ui_out *uiout;
+ int numspaces;
{
uo_spaces (uiout, numspaces);
}
void
-ui_out_text (struct ui_out *uiout,
- const char *string)
+ui_out_text (uiout, string)
+ struct ui_out *uiout;
+ char *string;
{
uo_text (uiout, string);
}
void
-ui_out_message (struct ui_out *uiout, int verbosity,
- const char *format,...)
+ui_out_message (struct ui_out *uiout, int verbosity, char *format,...)
{
va_list args;
@@ -600,7 +437,8 @@ ui_out_message (struct ui_out *uiout, int verbosity,
}
struct ui_stream *
-ui_out_stream_new (struct ui_out *uiout)
+ui_out_stream_new (uiout)
+ struct ui_out *uiout;
{
struct ui_stream *tempbuf;
@@ -611,10 +449,11 @@ ui_out_stream_new (struct ui_out *uiout)
}
void
-ui_out_stream_delete (struct ui_stream *buf)
+ui_out_stream_delete (buf)
+ struct ui_stream *buf;
{
ui_file_delete (buf->stream);
- xfree (buf);
+ free (buf);
}
static void
@@ -631,39 +470,40 @@ make_cleanup_ui_out_stream_delete (struct ui_stream *buf)
void
-ui_out_wrap_hint (struct ui_out *uiout, char *identstring)
+ui_out_wrap_hint (uiout, identstring)
+ struct ui_out *uiout;
+ char *identstring;
{
uo_wrap_hint (uiout, identstring);
}
void
-ui_out_flush (struct ui_out *uiout)
+ui_out_flush (uiout)
+ struct ui_out *uiout;
{
uo_flush (uiout);
}
-int
-ui_out_redirect (struct ui_out *uiout, struct ui_file *outstream)
-{
- return uo_redirect (uiout, outstream);
-}
-
/* set the flags specified by the mask given */
int
-ui_out_set_flags (struct ui_out *uiout, int mask)
+ui_out_set_flags (uiout, mask)
+ struct ui_out *uiout;
+ int mask;
{
- int oldflags = uiout->flags;
+ int oldflags;
- uiout->flags |= mask;
+ uiout->flags != mask;
return oldflags;
}
/* clear the flags specified by the mask given */
int
-ui_out_clear_flags (struct ui_out *uiout, int mask)
+ui_out_clear_flags (uiout, mask)
+ struct ui_out *uiout;
+ int mask;
{
- int oldflags = uiout->flags;
+ int oldflags;
uiout->flags &= ~mask;
@@ -672,7 +512,9 @@ ui_out_clear_flags (struct ui_out *uiout, int mask)
/* test the flags against the mask given */
int
-ui_out_test_flags (struct ui_out *uiout, int mask)
+ui_out_test_flags (uiout, mask)
+ struct ui_out *uiout;
+ int mask;
{
return (uiout->flags & mask);
}
@@ -681,7 +523,8 @@ ui_out_test_flags (struct ui_out *uiout, int mask)
'set verbositylevel' command */
int
-ui_out_get_verblvl (struct ui_out *uiout)
+ui_out_get_verblvl (uiout)
+ struct ui_out *uiout;
{
/* FIXME: not implemented yet */
return 0;
@@ -689,42 +532,54 @@ ui_out_get_verblvl (struct ui_out *uiout)
#if 0
void
-ui_out_result_begin (struct ui_out *uiout, char *class)
+ui_out_result_begin (uiout, class)
+ struct ui_out *uiout;
+ char *class;
{
}
void
-ui_out_result_end (struct ui_out *uiout)
+ui_out_result_end (uiout)
+ struct ui_out *uiout;
{
}
void
-ui_out_info_begin (struct ui_out *uiout, char *class)
+ui_out_info_begin (uiout, class)
+ struct ui_out *uiout;
+ char *class;
{
}
void
-ui_out_info_end (struct ui_out *uiout)
+ui_out_info_end (uiout)
+ struct ui_out *uiout;
{
}
void
-ui_out_notify_begin (struct ui_out *uiout, char *class)
+ui_out_notify_begin (uiout, class)
+ struct ui_out *uiout;
+ char *class;
{
}
void
-ui_out_notify_end (struct ui_out *uiout)
+ui_out_notify_end (uiout)
+ struct ui_out *uiout;
{
}
void
-ui_out_error_begin (struct ui_out *uiout, char *class)
+ui_out_error_begin (uiout, class)
+ struct ui_out *uiout;
+ char *class;
{
}
void
-ui_out_error_end (struct ui_out *uiout)
+ui_out_error_end (uiout)
+ struct ui_out *uiout;
{
}
#endif
@@ -737,68 +592,78 @@ gdb_error (ui_out * uiout, int severity, char *format,...)
}
void
-gdb_query (struct ui_out *uiout, int qflags, char *qprompt)
+gdb_query (uiout, qflags, qprompt)
+ struct ui_out *uiout;
+ int flags;
+ char *qprompt;
{
}
#endif
-int
-ui_out_is_mi_like_p (struct ui_out *uiout)
-{
- return uiout->impl->is_mi_like_p;
-}
-
/* default gdb-out hook functions */
static void
-default_table_begin (struct ui_out *uiout, int nbrofcols,
- int nr_rows,
- const char *tblid)
+default_table_begin (uiout, nbrofcols, tblid)
+ struct ui_out *uiout;
+ int nbrofcols;
+ char *tblid;
{
}
static void
-default_table_body (struct ui_out *uiout)
+default_table_body (uiout)
+ struct ui_out *uiout;
{
}
static void
-default_table_end (struct ui_out *uiout)
+default_table_end (uiout)
+ struct ui_out *uiout;
{
}
static void
-default_table_header (struct ui_out *uiout, int width, enum ui_align alignment,
- const char *col_name,
- const char *colhdr)
+default_table_header (uiout, width, alignment, colhdr)
+ struct ui_out *uiout;
+ int width;
+ enum ui_align alignment;
+ char *colhdr;
{
}
static void
-default_begin (struct ui_out *uiout,
- enum ui_out_type type,
- int level,
- const char *id)
+default_list_begin (uiout, list_flag, lstid)
+ struct ui_out *uiout;
+ int list_flag;
+ char *lstid;
{
}
static void
-default_end (struct ui_out *uiout,
- enum ui_out_type type,
- int level)
+default_list_end (uiout, list_flag)
+ struct ui_out *uiout;
+ int list_flag;
{
}
static void
-default_field_int (struct ui_out *uiout, int fldno, int width,
- enum ui_align align,
- const char *fldname, int value)
+default_field_int (uiout, fldno, width, align, fldname, value)
+ struct ui_out *uiout;
+ int fldno;
+ int width;
+ enum ui_align align;
+ char *fldname;
+ int value;
{
}
static void
-default_field_skip (struct ui_out *uiout, int fldno, int width,
- enum ui_align align, const char *fldname)
+default_field_skip (uiout, fldno, width, align, fldname)
+ struct ui_out *uiout;
+ int fldno;
+ int width;
+ enum ui_align align;
+ char *fldname;
{
}
@@ -807,57 +672,67 @@ default_field_string (struct ui_out *uiout,
int fldno,
int width,
enum ui_align align,
- const char *fldname,
+ char *fldname,
const char *string)
{
}
static void
-default_field_fmt (struct ui_out *uiout, int fldno, int width,
- enum ui_align align,
- const char *fldname,
- const char *format,
- va_list args)
+default_field_fmt (uiout, fldno, width, align, fldname, format, args)
+ struct ui_out *uiout;
+ int fldno;
+ int width;
+ enum ui_align align;
+ char *fldname;
+ char *format;
+ va_list args;
{
}
static void
-default_spaces (struct ui_out *uiout, int numspaces)
+default_spaces (uiout, numspaces)
+ struct ui_out *uiout;
+ int numspaces;
{
}
static void
-default_text (struct ui_out *uiout, const char *string)
+default_text (uiout, string)
+ struct ui_out *uiout;
+ char *string;
{
}
static void
-default_message (struct ui_out *uiout, int verbosity,
- const char *format,
- va_list args)
+default_message (uiout, verbosity, format, args)
+ struct ui_out *uiout;
+ int verbosity;
+ char *format;
+ va_list args;
{
}
static void
-default_wrap_hint (struct ui_out *uiout, char *identstring)
+default_wrap_hint (uiout, identstring)
+ struct ui_out *uiout;
+ char *identstring;
{
}
static void
-default_flush (struct ui_out *uiout)
+default_flush (uiout)
+ struct ui_out *uiout;
{
}
/* Interface to the implementation functions */
void
-uo_table_begin (struct ui_out *uiout, int nbrofcols,
- int nr_rows,
- const char *tblid)
+uo_table_begin (struct ui_out *uiout, int nbrofcols, char *tblid)
{
if (!uiout->impl->table_begin)
return;
- uiout->impl->table_begin (uiout, nbrofcols, nr_rows, tblid);
+ uiout->impl->table_begin (uiout, nbrofcols, tblid);
}
void
@@ -877,40 +752,31 @@ uo_table_end (struct ui_out *uiout)
}
void
-uo_table_header (struct ui_out *uiout, int width, enum ui_align align,
- const char *col_name,
- const char *colhdr)
+uo_table_header (struct ui_out *uiout, int width, enum ui_align align, char *colhdr)
{
if (!uiout->impl->table_header)
return;
- uiout->impl->table_header (uiout, width, align, col_name, colhdr);
+ uiout->impl->table_header (uiout, width, align, colhdr);
}
void
-uo_begin (struct ui_out *uiout,
- enum ui_out_type type,
- int level,
- const char *id)
+uo_list_begin (struct ui_out *uiout, int list_flag, char *lstid)
{
- if (uiout->impl->begin == NULL)
+ if (!uiout->impl->list_begin)
return;
- uiout->impl->begin (uiout, type, level, id);
+ uiout->impl->list_begin (uiout, list_flag, lstid);
}
void
-uo_end (struct ui_out *uiout,
- enum ui_out_type type,
- int level)
+uo_list_end (struct ui_out *uiout, int list_flag)
{
- if (uiout->impl->end == NULL)
+ if (!uiout->impl->list_end)
return;
- uiout->impl->end (uiout, type, level);
+ uiout->impl->list_end (uiout, list_flag);
}
void
-uo_field_int (struct ui_out *uiout, int fldno, int width, enum ui_align align,
- const char *fldname,
- int value)
+uo_field_int (struct ui_out *uiout, int fldno, int width, enum ui_align align, char *fldname, int value)
{
if (!uiout->impl->field_int)
return;
@@ -918,8 +784,7 @@ uo_field_int (struct ui_out *uiout, int fldno, int width, enum ui_align align,
}
void
-uo_field_skip (struct ui_out *uiout, int fldno, int width, enum ui_align align,
- const char *fldname)
+uo_field_skip (struct ui_out *uiout, int fldno, int width, enum ui_align align, char *fldname)
{
if (!uiout->impl->field_skip)
return;
@@ -928,9 +793,7 @@ uo_field_skip (struct ui_out *uiout, int fldno, int width, enum ui_align align,
void
uo_field_string (struct ui_out *uiout, int fldno, int width,
- enum ui_align align,
- const char *fldname,
- const char *string)
+ enum ui_align align, char *fldname, const char *string)
{
if (!uiout->impl->field_string)
return;
@@ -938,10 +801,7 @@ uo_field_string (struct ui_out *uiout, int fldno, int width,
}
void
-uo_field_fmt (struct ui_out *uiout, int fldno, int width, enum ui_align align,
- const char *fldname,
- const char *format,
- va_list args)
+uo_field_fmt (struct ui_out *uiout, int fldno, int width, enum ui_align align, char *fldname, char *format, va_list args)
{
if (!uiout->impl->field_fmt)
return;
@@ -957,8 +817,7 @@ uo_spaces (struct ui_out *uiout, int numspaces)
}
void
-uo_text (struct ui_out *uiout,
- const char *string)
+uo_text (struct ui_out *uiout, char *string)
{
if (!uiout->impl->text)
return;
@@ -966,9 +825,7 @@ uo_text (struct ui_out *uiout,
}
void
-uo_message (struct ui_out *uiout, int verbosity,
- const char *format,
- va_list args)
+uo_message (struct ui_out *uiout, int verbosity, char *format, va_list args)
{
if (!uiout->impl->message)
return;
@@ -991,146 +848,124 @@ uo_flush (struct ui_out *uiout)
uiout->impl->flush (uiout);
}
-int
-uo_redirect (struct ui_out *uiout, struct ui_file *outstream)
-{
- if (!uiout->impl->redirect)
- return -1;
- uiout->impl->redirect (uiout, outstream);
- return 0;
-}
-
/* local functions */
/* list of column headers manipulation routines */
static void
-clear_header_list (struct ui_out *uiout)
+clear_header_list (uiout)
+ struct ui_out *uiout;
{
- while (uiout->table.header_first != NULL)
+ while (uiout->headerfirst != NULL)
{
- uiout->table.header_next = uiout->table.header_first;
- uiout->table.header_first = uiout->table.header_first->next;
- if (uiout->table.header_next->colhdr != NULL)
- xfree (uiout->table.header_next->colhdr);
- xfree (uiout->table.header_next);
+ uiout->headercurr = uiout->headerfirst;
+ uiout->headerfirst = uiout->headerfirst->next;
+ if (uiout->headercurr->colhdr != NULL)
+ free (uiout->headercurr->colhdr);
+ free (uiout->headercurr);
}
- gdb_assert (uiout->table.header_first == NULL);
- uiout->table.header_last = NULL;
- uiout->table.header_next = NULL;
+ uiout->headerlast = NULL;
+ uiout->headercurr = NULL;
}
static void
append_header_to_list (struct ui_out *uiout,
int width,
int alignment,
- const char *col_name,
- const char *colhdr)
+ char *colhdr)
{
struct ui_out_hdr *temphdr;
temphdr = XMALLOC (struct ui_out_hdr);
temphdr->width = width;
temphdr->alignment = alignment;
- /* We have to copy the column title as the original may be an
- automatic. */
+ /* we have to copy the column title as the original may be an automatic */
if (colhdr != NULL)
- temphdr->colhdr = xstrdup (colhdr);
- else
- temphdr->colhdr = NULL;
-
- if (col_name != NULL)
- temphdr->col_name = xstrdup (col_name);
- else if (colhdr != NULL)
- temphdr->col_name = xstrdup (colhdr);
- else
- temphdr->col_name = NULL;
-
+ {
+ temphdr->colhdr = xmalloc (strlen (colhdr) + 1);
+ strcpy (temphdr->colhdr, colhdr);
+ }
temphdr->next = NULL;
- if (uiout->table.header_first == NULL)
+ if (uiout->headerfirst == NULL)
{
temphdr->colno = 1;
- uiout->table.header_first = temphdr;
- uiout->table.header_last = temphdr;
+ uiout->headerfirst = temphdr;
+ uiout->headerlast = temphdr;
}
else
{
- temphdr->colno = uiout->table.header_last->colno + 1;
- uiout->table.header_last->next = temphdr;
- uiout->table.header_last = temphdr;
+ temphdr->colno = uiout->headerlast->colno + 1;
+ uiout->headerlast->next = temphdr;
+ uiout->headerlast = temphdr;
}
- uiout->table.header_next = uiout->table.header_last;
+ uiout->headercurr = uiout->headerlast;
}
-/* Extract the format information for the NEXT header and and advance
- the header pointer. Return 0 if there was no next header. */
+/* returns 0 if there is no more headers */
static int
-get_next_header (struct ui_out *uiout,
+get_curr_header (struct ui_out *uiout,
int *colno,
int *width,
int *alignment,
char **colhdr)
{
- /* There may be no headers at all or we may have used all columns. */
- if (uiout->table.header_next == NULL)
+ /* There may be no headers at all or we may have used all columns */
+ if (uiout->headercurr == NULL)
return 0;
- *colno = uiout->table.header_next->colno;
- *width = uiout->table.header_next->width;
- *alignment = uiout->table.header_next->alignment;
- *colhdr = uiout->table.header_next->colhdr;
- /* Advance the header pointer to the next entry. */
- uiout->table.header_next = uiout->table.header_next->next;
+ *colno = uiout->headercurr->colno;
+ *width = uiout->headercurr->width;
+ *alignment = uiout->headercurr->alignment;
+ *colhdr = uiout->headercurr->colhdr;
+ uiout->headercurr = uiout->headercurr->next;
return 1;
}
-
-/* Verify that the field/tuple/list is correctly positioned. Return
- the field number and corresponding alignment (if
- available/applicable). */
+/* makes sure the field_* calls were properly placed */
static void
-verify_field (struct ui_out *uiout, int *fldno, int *width, int *align)
+verify_field_proper_position (struct ui_out *uiout)
{
- struct ui_out_level *current = current_level (uiout);
- char *text;
-
- if (uiout->table.flag)
+ if (uiout->table_flag)
{
- if (!uiout->table.body_flag)
- internal_error (__FILE__, __LINE__,
- _("table_body missing; table fields must be \
-specified after table_body and inside a list."));
- /* NOTE: cagney/2001-12-08: There was a check here to ensure
- that this code was only executed when uiout->level was
- greater than zero. That no longer applies - this code is run
- before each table row tuple is started and at that point the
- level is zero. */
+ if (!uiout->body_flag)
+ internal_error ("ui_out: table_body missing; table fields must be \
+specified after table_body and inside a list.");
+ if (!uiout->list_flag)
+ internal_error ("ui_out: list_begin missing; table fields must be \
+specified after table_body and inside a list.");
}
+}
- current->field_count += 1;
+/* determines what is the alignment policy */
- if (uiout->table.body_flag
- && uiout->table.entry_level == uiout->level
- && get_next_header (uiout, fldno, width, align, &text))
+static void
+verify_field_alignment (struct ui_out *uiout,
+ int fldno,
+ int *width,
+ int *align)
+{
+ int colno;
+ char *text;
+
+ if (uiout->table_flag
+ && get_curr_header (uiout, &colno, width, align, &text))
{
- if (*fldno != current->field_count)
- internal_error (__FILE__, __LINE__,
- _("ui-out internal error in handling headers."));
+ if (fldno != colno)
+ internal_error ("gdb/ui-out.c: ui-out internal error in handling headers.");
}
else
{
*width = 0;
*align = ui_noalign;
- *fldno = current->field_count;
}
}
-
/* access to ui_out format private members */
void
-ui_out_get_field_separator (struct ui_out *uiout)
+ui_out_get_field_separator (uiout)
+ struct ui_out *uiout;
{
}
@@ -1153,20 +988,20 @@ ui_out_new (struct ui_out_impl *impl,
uiout->data = data;
uiout->impl = impl;
uiout->flags = flags;
- uiout->table.flag = 0;
- uiout->table.body_flag = 0;
- uiout->level = 0;
- memset (uiout->levels, 0, sizeof (uiout->levels));
- uiout->table.header_first = NULL;
- uiout->table.header_last = NULL;
- uiout->table.header_next = NULL;
+ uiout->table_flag = 0;
+ uiout->body_flag = 0;
+ uiout->list_flag = 0;
+ uiout->field_count[0] = 0;
+ uiout->headerfirst = NULL;
+ uiout->headerlast = NULL;
+ uiout->headercurr = NULL;
return uiout;
}
/* standard gdb initialization hook */
void
-_initialize_ui_out (void)
+_initialize_ui_out ()
{
/* nothing needs to be done */
}
diff --git a/gdb/ui-out.h b/gdb/ui-out.h
index d62a86c6dc5..d8db5885457 100644
--- a/gdb/ui-out.h
+++ b/gdb/ui-out.h
@@ -1,8 +1,5 @@
/* Output generating routines for GDB.
-
- Copyright (C) 1999, 2000, 2001, 2002, 2003, 2005, 2007, 2008
- Free Software Foundation, Inc.
-
+ Copyright 1999, 2000 Free Software Foundation, Inc.
Contributed by Cygnus Solutions.
Written by Fernando Nasser for Cygnus.
@@ -10,7 +7,7 @@
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
+ the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@@ -19,16 +16,20 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
#ifndef UI_OUT_H
#define UI_OUT_H 1
/* The ui_out structure */
+#if __STDC__
struct ui_out;
struct ui_out_data;
-struct ui_file;
+#endif
+
/* the current ui_out */
@@ -66,128 +67,90 @@ struct ui_stream
/* Prototypes for ui-out API. */
-/* A result is a recursive data structure consisting of lists and
- tuples. */
-
-enum ui_out_type
- {
- ui_out_type_tuple,
- ui_out_type_list
- };
-
-extern void ui_out_begin (struct ui_out *uiout,
- enum ui_out_type level_type,
- const char *id);
+extern void ui_out_table_begin PARAMS ((struct ui_out * uiout, int nbrofcols,
+ char *tblid));
-extern void ui_out_end (struct ui_out *uiout, enum ui_out_type type);
+extern void ui_out_table_header PARAMS ((struct ui_out * uiout, int width,
+ enum ui_align align, char *colhdr));
-extern struct cleanup *ui_out_begin_cleanup_end (struct ui_out *uiout,
- enum ui_out_type level_type,
- const char *id);
+extern void ui_out_table_body PARAMS ((struct ui_out * uiout));
-/* A table can be considered a special tuple/list combination with the
- implied structure: ``table = { hdr = { header, ... } , body = [ {
- field, ... }, ... ] }''. If NR_ROWS is negative then there is at
- least one row. */
-extern void ui_out_table_header (struct ui_out *uiout, int width,
- enum ui_align align, const char *col_name,
- const char *colhdr);
+extern void ui_out_table_end PARAMS ((struct ui_out * uiout));
-extern void ui_out_table_body (struct ui_out *uiout);
+extern void ui_out_list_begin PARAMS ((struct ui_out * uiout, char *lstid));
-extern struct cleanup *make_cleanup_ui_out_table_begin_end (struct ui_out *ui_out,
- int nr_cols,
- int nr_rows,
- const char *tblid);
-/* Compatibility wrappers. */
+extern void ui_out_list_end PARAMS ((struct ui_out * uiout));
-extern struct cleanup *make_cleanup_ui_out_list_begin_end (struct ui_out *uiout,
- const char *id);
+extern void ui_out_field_int PARAMS ((struct ui_out * uiout, char *fldname,
+ int value));
-extern struct cleanup *make_cleanup_ui_out_tuple_begin_end (struct ui_out *uiout,
- const char *id);
+extern void ui_out_field_core_addr PARAMS ((struct ui_out * uiout, char *fldname,
+ CORE_ADDR address));
-extern void ui_out_field_int (struct ui_out *uiout, const char *fldname,
- int value);
-
-extern void ui_out_field_fmt_int (struct ui_out *uiout, int width,
- enum ui_align align, const char *fldname,
- int value);
-
-extern void ui_out_field_core_addr (struct ui_out *uiout, const char *fldname,
- CORE_ADDR address);
-
-extern void ui_out_field_string (struct ui_out * uiout, const char *fldname,
+extern void ui_out_field_string (struct ui_out * uiout, char *fldname,
const char *string);
-extern void ui_out_field_stream (struct ui_out *uiout, const char *fldname,
- struct ui_stream *buf);
+extern void ui_out_field_stream PARAMS ((struct ui_out * uiout, char *fldname,
+ struct ui_stream * buf));
-extern void ui_out_field_fmt (struct ui_out *uiout, const char *fldname,
- const char *format, ...)
- ATTR_FORMAT (printf, 3, 4);
+extern void ui_out_field_fmt PARAMS ((struct ui_out * uiout, char *fldname,
+ char *format,...));
-extern void ui_out_field_skip (struct ui_out *uiout, const char *fldname);
+extern void ui_out_field_skip PARAMS ((struct ui_out * uiout, char *fldname));
-extern void ui_out_spaces (struct ui_out *uiout, int numspaces);
+extern void ui_out_spaces PARAMS ((struct ui_out * uiout, int numspaces));
-extern void ui_out_text (struct ui_out *uiout, const char *string);
+extern void ui_out_text PARAMS ((struct ui_out * uiout, char *string));
-extern void ui_out_message (struct ui_out *uiout, int verbosity,
- const char *format, ...)
- ATTR_FORMAT (printf, 3, 4);
+extern void ui_out_message PARAMS ((struct ui_out * uiout, int verbosity,
+ char *format,...));
-extern struct ui_stream *ui_out_stream_new (struct ui_out *uiout);
+extern struct ui_stream *ui_out_stream_new PARAMS ((struct ui_out * uiout));
-extern void ui_out_stream_delete (struct ui_stream *buf);
+extern void ui_out_stream_delete PARAMS ((struct ui_stream * buf));
struct cleanup *make_cleanup_ui_out_stream_delete (struct ui_stream *buf);
-extern void ui_out_wrap_hint (struct ui_out *uiout, char *identstring);
+extern void ui_out_wrap_hint PARAMS ((struct ui_out * uiout, char *identstring));
-extern void ui_out_flush (struct ui_out *uiout);
+extern void ui_out_flush PARAMS ((struct ui_out * uiout));
-extern void ui_out_get_field_separator (struct ui_out *uiout);
+extern void ui_out_get_field_separator PARAMS ((struct ui_out * uiout));
-extern int ui_out_set_flags (struct ui_out *uiout, int mask);
+extern int ui_out_set_flags PARAMS ((struct ui_out * uiout, int mask));
-extern int ui_out_clear_flags (struct ui_out *uiout, int mask);
+extern int ui_out_clear_flags PARAMS ((struct ui_out * uiout, int mask));
-extern int ui_out_get_verblvl (struct ui_out *uiout);
+extern int ui_out_get_verblvl PARAMS ((struct ui_out * uiout));
extern int ui_out_test_flags (struct ui_out *uiout, int mask);
#if 0
-extern void ui_out_result_begin (struct ui_out *uiout, char *class);
+extern void ui_out_result_begin PARAMS ((struct ui_out * uiout, char *class));
-extern void ui_out_result_end (struct ui_out *uiout);
+extern void ui_out_result_end PARAMS ((struct ui_out * uiout));
-extern void ui_out_info_begin (struct ui_out *uiout, char *class);
+extern void ui_out_info_begin PARAMS ((struct ui_out * uiout, char *class));
-extern void ui_out_info_end (struct ui_out *uiout);
+extern void ui_out_info_end PARAMS ((struct ui_out * uiout));
-extern void ui_out_notify_begin (struct ui_out *uiout, char *class);
+extern void ui_out_notify_begin PARAMS ((struct ui_out * uiout, char *class));
-extern void ui_out_notify_end (struct ui_out *uiout);
+extern void ui_out_notify_end PARAMS ((struct ui_out * uiout));
-extern void ui_out_error_begin (struct ui_out *uiout, char *class);
+extern void ui_out_error_begin PARAMS ((struct ui_out * uiout, char *class));
-extern void ui_out_error_end (struct ui_out *uiout);
+extern void ui_out_error_end PARAMS ((struct ui_out * uiout));
#endif
#if 0
-extern void gdb_error (struct ui_out *uiout, int severity, char *format, ...);
+extern void gdb_error PARAMS ((struct ui_out * uiout, int severity,
+ char *format,...));
-extern void gdb_query (struct ui_out *uiout, int qflags, char *qprompt);
+extern void gdb_query PARAMS ((struct ui_out * uiout,
+ int qflags, char *qprompt));
#endif
-/* HACK: Code in GDB is currently checking to see the type of ui_out
- builder when determining which output to produce. This function is
- a hack to encapsulate that test. Once GDB manages to separate the
- CLI/MI from the core of GDB the problem should just go away .... */
-
-extern int ui_out_is_mi_like_p (struct ui_out *uiout);
-
/* From here on we have things that are only needed by implementation
routines and main.c. We should pehaps have a separate file for that,
like a ui-out-impl.h file */
@@ -197,46 +160,30 @@ extern int ui_out_is_mi_like_p (struct ui_out *uiout);
/* Type definition of all implementation functions. */
typedef void (table_begin_ftype) (struct ui_out * uiout,
- int nbrofcols, int nr_rows,
- const char *tblid);
+ int nbrofcols, char *tblid);
typedef void (table_body_ftype) (struct ui_out * uiout);
typedef void (table_end_ftype) (struct ui_out * uiout);
typedef void (table_header_ftype) (struct ui_out * uiout, int width,
- enum ui_align align, const char *col_name,
- const char *colhdr);
-/* Note: level 0 is the top-level so LEVEL is always greater than
- zero. */
-typedef void (ui_out_begin_ftype) (struct ui_out *uiout,
- enum ui_out_type type,
- int level, const char *id);
-typedef void (ui_out_end_ftype) (struct ui_out *uiout,
- enum ui_out_type type,
- int level);
+ enum ui_align align, char *colhdr);
+typedef void (list_begin_ftype) (struct ui_out * uiout,
+ int list_flag, char *lstid);
+typedef void (list_end_ftype) (struct ui_out * uiout, int list_flag);
typedef void (field_int_ftype) (struct ui_out * uiout, int fldno, int width,
- enum ui_align align,
- const char *fldname, int value);
+ enum ui_align align, char *fldname, int value);
typedef void (field_skip_ftype) (struct ui_out * uiout, int fldno, int width,
- enum ui_align align,
- const char *fldname);
+ enum ui_align align, char *fldname);
typedef void (field_string_ftype) (struct ui_out * uiout, int fldno, int width,
- enum ui_align align,
- const char *fldname,
+ enum ui_align align, char *fldname,
const char *string);
typedef void (field_fmt_ftype) (struct ui_out * uiout, int fldno, int width,
- enum ui_align align,
- const char *fldname,
- const char *format,
- va_list args) ATTRIBUTE_FPTR_PRINTF(6,0);
+ enum ui_align align, char *fldname,
+ char *format, va_list args);
typedef void (spaces_ftype) (struct ui_out * uiout, int numspaces);
-typedef void (text_ftype) (struct ui_out * uiout,
- const char *string);
+typedef void (text_ftype) (struct ui_out * uiout, char *string);
typedef void (message_ftype) (struct ui_out * uiout, int verbosity,
- const char *format, va_list args)
- ATTRIBUTE_FPTR_PRINTF(3,0);
+ char *format, va_list args);
typedef void (wrap_hint_ftype) (struct ui_out * uiout, char *identstring);
typedef void (flush_ftype) (struct ui_out * uiout);
-typedef int (redirect_ftype) (struct ui_out * uiout,
- struct ui_file * outstream);
/* ui-out-impl */
@@ -249,8 +196,8 @@ struct ui_out_impl
table_body_ftype *table_body;
table_end_ftype *table_end;
table_header_ftype *table_header;
- ui_out_begin_ftype *begin;
- ui_out_end_ftype *end;
+ list_begin_ftype *list_begin;
+ list_end_ftype *list_end;
field_int_ftype *field_int;
field_skip_ftype *field_skip;
field_string_ftype *field_string;
@@ -260,8 +207,6 @@ struct ui_out_impl
message_ftype *message;
wrap_hint_ftype *wrap_hint;
flush_ftype *flush;
- redirect_ftype *redirect;
- int is_mi_like_p;
};
extern struct ui_out_data *ui_out_data (struct ui_out *uiout);
@@ -273,8 +218,4 @@ extern struct ui_out *ui_out_new (struct ui_out_impl *impl,
struct ui_out_data *data,
int flags);
-/* Redirect the ouptut of a ui_out object temporarily. */
-
-extern int ui_out_redirect (struct ui_out *uiout, struct ui_file *outstream);
-
#endif /* UI_OUT_H */
diff --git a/gdb/varobj.c b/gdb/varobj.c
index 3a0bf5e373d..f0740c69672 100644
--- a/gdb/varobj.c
+++ b/gdb/varobj.c
@@ -1,11 +1,9 @@
/* Implementation of the GDB variable objects API.
-
- Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
- Free Software Foundation, Inc.
+ Copyright 1999, 2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
+ the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@@ -14,385 +12,367 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
#include "defs.h"
-#include "exceptions.h"
#include "value.h"
#include "expression.h"
#include "frame.h"
+#include "valprint.h"
#include "language.h"
#include "wrapper.h"
#include "gdbcmd.h"
-#include "block.h"
-
-#include "gdb_assert.h"
-#include "gdb_string.h"
+#include <math.h>
#include "varobj.h"
-#include "vec.h"
-#include "gdbthread.h"
-#include "inferior.h"
/* Non-zero if we want to see trace of varobj level stuff. */
int varobjdebug = 0;
-static void
-show_varobjdebug (struct ui_file *file, int from_tty,
- struct cmd_list_element *c, const char *value)
-{
- fprintf_filtered (file, _("Varobj debugging is %s.\n"), value);
-}
/* String representations of gdb's format codes */
char *varobj_format_string[] =
- { "natural", "binary", "decimal", "hexadecimal", "octal" };
+{"natural", "binary", "decimal", "hexadecimal", "octal"};
/* String representations of gdb's known languages */
-char *varobj_language_string[] = { "unknown", "C", "C++", "Java" };
+char *varobj_language_string[] =
+{"unknown", "C", "C++", "Java"};
/* Data structures */
/* Every root variable has one of these structures saved in its
varobj. Members which must be free'd are noted. */
struct varobj_root
-{
-
- /* Alloc'd expression for this parent. */
- struct expression *exp;
-
- /* Block for which this expression is valid */
- struct block *valid_block;
+ {
- /* The frame for this expression. This field is set iff valid_block is
- not NULL. */
- struct frame_id frame;
+ /* Alloc'd expression for this parent. */
+ struct expression *exp;
- /* The thread ID that this varobj_root belong to. This field
- is only valid if valid_block is not NULL.
- When not 0, indicates which thread 'frame' belongs to.
- When 0, indicates that the thread list was empty when the varobj_root
- was created. */
- int thread_id;
+ /* Block for which this expression is valid */
+ struct block *valid_block;
- /* If 1, the -var-update always recomputes the value in the
- current thread and frame. Otherwise, variable object is
- always updated in the specific scope/thread/frame */
- int floating;
+ /* The frame for this expression */
+ CORE_ADDR frame;
- /* Flag that indicates validity: set to 0 when this varobj_root refers
- to symbols that do not exist anymore. */
- int is_valid;
+ /* Language info for this variable and its children */
+ struct language_specific *lang;
- /* Language info for this variable and its children */
- struct language_specific *lang;
+ /* The varobj for this root node. */
+ struct varobj *rootvar;
- /* The varobj for this root node. */
- struct varobj *rootvar;
-
- /* Next root variable */
- struct varobj_root *next;
-};
+ /* Next root variable */
+ struct varobj_root *next;
+ };
/* Every variable in the system has a structure of this type defined
for it. This structure holds all information necessary to manipulate
a particular object variable. Members which must be freed are noted. */
struct varobj
-{
+ {
- /* Alloc'd name of the variable for this object.. If this variable is a
- child, then this name will be the child's source name.
- (bar, not foo.bar) */
- /* NOTE: This is the "expression" */
- char *name;
+ /* Alloc'd name of the variable for this object.. If this variable is a
+ child, then this name will be the child's source name.
+ (bar, not foo.bar) */
+ /* NOTE: This is the "expression" */
+ char *name;
- /* Alloc'd expression for this child. Can be used to create a
- root variable corresponding to this child. */
- char *path_expr;
+ /* The alloc'd name for this variable's object. This is here for
+ convenience when constructing this object's children. */
+ char *obj_name;
- /* The alloc'd name for this variable's object. This is here for
- convenience when constructing this object's children. */
- char *obj_name;
+ /* Index of this variable in its parent or -1 */
+ int index;
- /* Index of this variable in its parent or -1 */
- int index;
+ /* The type of this variable. This may NEVER be NULL. */
+ struct type *type;
- /* The type of this variable. This can be NULL
- for artifial variable objects -- currently, the "accessibility"
- variable objects in C++. */
- struct type *type;
+ /* The value of this expression or subexpression. This may be NULL. */
+ value_ptr value;
- /* The value of this expression or subexpression. A NULL value
- indicates there was an error getting this value.
- Invariant: if varobj_value_is_changeable_p (this) is non-zero,
- the value is either NULL, or not lazy. */
- struct value *value;
+ /* Did an error occur evaluating the expression or getting its value? */
+ int error;
- /* The number of (immediate) children this variable has */
- int num_children;
+ /* The number of (immediate) children this variable has */
+ int num_children;
- /* If this object is a child, this points to its immediate parent. */
- struct varobj *parent;
+ /* If this object is a child, this points to its immediate parent. */
+ struct varobj *parent;
- /* Children of this object. */
- VEC (varobj_p) *children;
+ /* A list of this object's children */
+ struct varobj_child *children;
- /* Description of the root variable. Points to root variable for children. */
- struct varobj_root *root;
+ /* Description of the root variable. Points to root variable for children. */
+ struct varobj_root *root;
- /* The format of the output for this object */
- enum varobj_display_formats format;
+ /* The format of the output for this object */
+ enum varobj_display_formats format;
+ };
- /* Was this variable updated via a varobj_set_value operation */
- int updated;
+/* Every variable keeps a linked list of its children, described
+ by the following structure. */
+/* FIXME: Deprecated. All should use vlist instead */
- /* Last print value. */
- char *print_value;
+struct varobj_child
+ {
- /* Is this variable frozen. Frozen variables are never implicitly
- updated by -var-update *
- or -var-update <direct-or-indirect-parent>. */
- int frozen;
+ /* Pointer to the child's data */
+ struct varobj *child;
- /* Is the value of this variable intentionally not fetched? It is
- not fetched if either the variable is frozen, or any parents is
- frozen. */
- int not_fetched;
-};
+ /* Pointer to the next child */
+ struct varobj_child *next;
+ };
+
+/* A stack of varobjs */
+/* FIXME: Deprecated. All should use vlist instead */
+
+struct vstack
+ {
+ struct varobj *var;
+ struct vstack *next;
+ };
struct cpstack
-{
- char *name;
- struct cpstack *next;
-};
+ {
+ char *name;
+ struct cpstack *next;
+ };
/* A list of varobjs */
struct vlist
-{
- struct varobj *var;
- struct vlist *next;
-};
+ {
+ struct varobj *var;
+ struct vlist *next;
+ };
/* Private function prototypes */
/* Helper functions for the above subcommands. */
-static int delete_variable (struct cpstack **, struct varobj *, int);
+static int delete_variable PARAMS ((struct cpstack **, struct varobj *, int));
+
+static void delete_variable_1 PARAMS ((struct cpstack **, int *,
+ struct varobj *, int, int));
+
+static int install_variable PARAMS ((struct varobj *));
-static void delete_variable_1 (struct cpstack **, int *,
- struct varobj *, int, int);
+static void uninstall_variable PARAMS ((struct varobj *));
-static int install_variable (struct varobj *);
+static struct varobj *child_exists PARAMS ((struct varobj *, char *));
-static void uninstall_variable (struct varobj *);
+static struct varobj *create_child PARAMS ((struct varobj *, int, char *));
-static struct varobj *create_child (struct varobj *, int, char *);
+static void save_child_in_parent PARAMS ((struct varobj *, struct varobj *));
+
+static void remove_child_from_parent PARAMS ((struct varobj *, struct varobj *));
/* Utility routines */
-static struct varobj *new_variable (void);
+static struct varobj *new_variable PARAMS ((void));
+
+static struct varobj *new_root_variable PARAMS ((void));
-static struct varobj *new_root_variable (void);
+static void free_variable PARAMS ((struct varobj * var));
-static void free_variable (struct varobj *var);
+static struct type *get_type PARAMS ((struct varobj * var));
-static struct cleanup *make_cleanup_free_variable (struct varobj *var);
+static struct type *get_type_deref PARAMS ((struct varobj * var));
-static struct type *get_type (struct varobj *var);
+static struct type *get_target_type PARAMS ((struct type *));
-static struct type *get_value_type (struct varobj *var);
+static enum varobj_display_formats variable_default_display PARAMS ((struct varobj *));
-static struct type *get_target_type (struct type *);
+static int my_value_equal PARAMS ((value_ptr, value_ptr, int *));
-static enum varobj_display_formats variable_default_display (struct varobj *);
+static void vpush PARAMS ((struct vstack ** pstack, struct varobj * var));
-static void cppush (struct cpstack **pstack, char *name);
+static struct varobj *vpop PARAMS ((struct vstack ** pstack));
-static char *cppop (struct cpstack **pstack);
+static void cppush PARAMS ((struct cpstack ** pstack, char *name));
-static int install_new_value (struct varobj *var, struct value *value,
- int initial);
+static char *cppop PARAMS ((struct cpstack ** pstack));
/* Language-specific routines. */
-static enum varobj_languages variable_language (struct varobj *var);
+static enum varobj_languages variable_language PARAMS ((struct varobj * var));
-static int number_of_children (struct varobj *);
+static int number_of_children PARAMS ((struct varobj *));
-static char *name_of_variable (struct varobj *);
+static char *name_of_variable PARAMS ((struct varobj *));
-static char *name_of_child (struct varobj *, int);
+static char *name_of_child PARAMS ((struct varobj *, int));
-static struct value *value_of_root (struct varobj **var_handle, int *);
+static value_ptr value_of_root PARAMS ((struct varobj * var));
-static struct value *value_of_child (struct varobj *parent, int index);
+static value_ptr value_of_child PARAMS ((struct varobj * parent, int index));
-static char *my_value_of_variable (struct varobj *var,
- enum varobj_display_formats format);
+static struct type *type_of_child PARAMS ((struct varobj * var));
-static char *value_get_print_value (struct value *value,
- enum varobj_display_formats format);
+static int variable_editable PARAMS ((struct varobj * var));
-static int varobj_value_is_changeable_p (struct varobj *var);
+static char *my_value_of_variable PARAMS ((struct varobj * var));
-static int is_root_p (struct varobj *var);
+static int type_changeable PARAMS ((struct varobj * var));
/* C implementation */
-static int c_number_of_children (struct varobj *var);
+static int c_number_of_children PARAMS ((struct varobj * var));
-static char *c_name_of_variable (struct varobj *parent);
+static char *c_name_of_variable PARAMS ((struct varobj * parent));
-static char *c_name_of_child (struct varobj *parent, int index);
+static char *c_name_of_child PARAMS ((struct varobj * parent, int index));
-static char *c_path_expr_of_child (struct varobj *child);
+static value_ptr c_value_of_root PARAMS ((struct varobj * var));
-static struct value *c_value_of_root (struct varobj **var_handle);
+static value_ptr c_value_of_child PARAMS ((struct varobj * parent, int index));
-static struct value *c_value_of_child (struct varobj *parent, int index);
+static struct type *c_type_of_child PARAMS ((struct varobj * parent, int index));
-static struct type *c_type_of_child (struct varobj *parent, int index);
+static int c_variable_editable PARAMS ((struct varobj * var));
-static char *c_value_of_variable (struct varobj *var,
- enum varobj_display_formats format);
+static char *c_value_of_variable PARAMS ((struct varobj * var));
/* C++ implementation */
-static int cplus_number_of_children (struct varobj *var);
+static int cplus_number_of_children PARAMS ((struct varobj * var));
-static void cplus_class_num_children (struct type *type, int children[3]);
+static void cplus_class_num_children PARAMS ((struct type * type, int children[3]));
-static char *cplus_name_of_variable (struct varobj *parent);
+static char *cplus_name_of_variable PARAMS ((struct varobj * parent));
-static char *cplus_name_of_child (struct varobj *parent, int index);
+static char *cplus_name_of_child PARAMS ((struct varobj * parent, int index));
-static char *cplus_path_expr_of_child (struct varobj *child);
+static value_ptr cplus_value_of_root PARAMS ((struct varobj * var));
-static struct value *cplus_value_of_root (struct varobj **var_handle);
+static value_ptr cplus_value_of_child PARAMS ((struct varobj * parent, int index));
-static struct value *cplus_value_of_child (struct varobj *parent, int index);
+static struct type *cplus_type_of_child PARAMS ((struct varobj * parent, int index));
-static struct type *cplus_type_of_child (struct varobj *parent, int index);
+static int cplus_variable_editable PARAMS ((struct varobj * var));
-static char *cplus_value_of_variable (struct varobj *var,
- enum varobj_display_formats format);
+static char *cplus_value_of_variable PARAMS ((struct varobj * var));
/* Java implementation */
-static int java_number_of_children (struct varobj *var);
+static int java_number_of_children PARAMS ((struct varobj * var));
-static char *java_name_of_variable (struct varobj *parent);
+static char *java_name_of_variable PARAMS ((struct varobj * parent));
-static char *java_name_of_child (struct varobj *parent, int index);
+static char *java_name_of_child PARAMS ((struct varobj * parent, int index));
-static char *java_path_expr_of_child (struct varobj *child);
+static value_ptr java_value_of_root PARAMS ((struct varobj * var));
-static struct value *java_value_of_root (struct varobj **var_handle);
+static value_ptr java_value_of_child PARAMS ((struct varobj * parent, int index));
-static struct value *java_value_of_child (struct varobj *parent, int index);
+static struct type *java_type_of_child PARAMS ((struct varobj * parent, int index));
-static struct type *java_type_of_child (struct varobj *parent, int index);
+static int java_variable_editable PARAMS ((struct varobj * var));
-static char *java_value_of_variable (struct varobj *var,
- enum varobj_display_formats format);
+static char *java_value_of_variable PARAMS ((struct varobj * var));
/* The language specific vector */
struct language_specific
-{
+ {
- /* The language of this variable */
- enum varobj_languages language;
+ /* The language of this variable */
+ enum varobj_languages language;
- /* The number of children of PARENT. */
- int (*number_of_children) (struct varobj * parent);
+ /* The number of children of PARENT. */
+ int (*number_of_children) PARAMS ((struct varobj * parent));
- /* The name (expression) of a root varobj. */
- char *(*name_of_variable) (struct varobj * parent);
+ /* The name (expression) of a root varobj. */
+ char *(*name_of_variable) PARAMS ((struct varobj * parent));
- /* The name of the INDEX'th child of PARENT. */
- char *(*name_of_child) (struct varobj * parent, int index);
+ /* The name of the INDEX'th child of PARENT. */
+ char *(*name_of_child) PARAMS ((struct varobj * parent, int index));
- /* Returns the rooted expression of CHILD, which is a variable
- obtain that has some parent. */
- char *(*path_expr_of_child) (struct varobj * child);
+ /* The value_ptr of the root variable ROOT. */
+ value_ptr (*value_of_root) PARAMS ((struct varobj * root));
- /* The ``struct value *'' of the root variable ROOT. */
- struct value *(*value_of_root) (struct varobj ** root_handle);
+ /* The value_ptr of the INDEX'th child of PARENT. */
+ value_ptr (*value_of_child) PARAMS ((struct varobj * parent, int index));
- /* The ``struct value *'' of the INDEX'th child of PARENT. */
- struct value *(*value_of_child) (struct varobj * parent, int index);
+ /* The type of the INDEX'th child of PARENT. */
+ struct type *(*type_of_child) PARAMS ((struct varobj * parent, int index));
- /* The type of the INDEX'th child of PARENT. */
- struct type *(*type_of_child) (struct varobj * parent, int index);
+ /* Is VAR editable? */
+ int (*variable_editable) PARAMS ((struct varobj * var));
- /* The current value of VAR. */
- char *(*value_of_variable) (struct varobj * var,
- enum varobj_display_formats format);
-};
+ /* The current value of VAR. */
+ char *(*value_of_variable) PARAMS ((struct varobj * var));
+ };
/* Array of known source language routines. */
-static struct language_specific languages[vlang_end] = {
+static struct language_specific
+ languages[vlang_end][sizeof (struct language_specific)] =
+{
/* Unknown (try treating as C */
{
- vlang_unknown,
- c_number_of_children,
- c_name_of_variable,
- c_name_of_child,
- c_path_expr_of_child,
- c_value_of_root,
- c_value_of_child,
- c_type_of_child,
- c_value_of_variable}
+ vlang_unknown,
+ c_number_of_children,
+ c_name_of_variable,
+ c_name_of_child,
+ c_value_of_root,
+ c_value_of_child,
+ c_type_of_child,
+ c_variable_editable,
+ c_value_of_variable
+ }
,
/* C */
{
- vlang_c,
- c_number_of_children,
- c_name_of_variable,
- c_name_of_child,
- c_path_expr_of_child,
- c_value_of_root,
- c_value_of_child,
- c_type_of_child,
- c_value_of_variable}
+ vlang_c,
+ c_number_of_children,
+ c_name_of_variable,
+ c_name_of_child,
+ c_value_of_root,
+ c_value_of_child,
+ c_type_of_child,
+ c_variable_editable,
+ c_value_of_variable
+ }
,
/* C++ */
{
- vlang_cplus,
- cplus_number_of_children,
- cplus_name_of_variable,
- cplus_name_of_child,
- cplus_path_expr_of_child,
- cplus_value_of_root,
- cplus_value_of_child,
- cplus_type_of_child,
- cplus_value_of_variable}
+ vlang_cplus,
+ cplus_number_of_children,
+ cplus_name_of_variable,
+ cplus_name_of_child,
+ cplus_value_of_root,
+ cplus_value_of_child,
+ cplus_type_of_child,
+ cplus_variable_editable,
+ cplus_value_of_variable
+ }
,
/* Java */
{
- vlang_java,
- java_number_of_children,
- java_name_of_variable,
- java_name_of_child,
- java_path_expr_of_child,
- java_value_of_root,
- java_value_of_child,
- java_type_of_child,
- java_value_of_variable}
+ vlang_java,
+ java_number_of_children,
+ java_name_of_variable,
+ java_name_of_child,
+ java_value_of_root,
+ java_value_of_child,
+ java_type_of_child,
+ java_variable_editable,
+ java_value_of_variable
+ }
};
/* A little convenience enum for dealing with C++/Java */
enum vsections
-{
- v_public = 0, v_private, v_protected
-};
+ {
+ v_public = 0, v_private, v_protected
+ };
/* Private data */
/* Mappings of varobj_display_formats enums to gdb's format codes */
-static int format_code[] = { 0, 't', 'd', 'x', 'o' };
+static int format_code[] =
+{0, 't', 'd', 'x', 'o'};
/* Header of the list of root variable objects */
static struct varobj_root *rootlist;
@@ -405,153 +385,108 @@ static int rootcount = 0; /* number of root varobjs in the list */
/* Pointer to the varobj hash table (built at run time) */
static struct vlist **varobj_table;
+#if defined(FREEIF)
+#undef FREEIF
+#endif
+#define FREEIF(x) if (x != NULL) free((char *) (x))
+
/* Is the variable X one of our "fake" children? */
#define CPLUS_FAKE_CHILD(x) \
((x) != NULL && (x)->type == NULL && (x)->value == NULL)
/* API Implementation */
-static int
-is_root_p (struct varobj *var)
-{
- return (var->root->rootvar == var);
-}
/* Creates a varobj (not its children) */
-/* Return the full FRAME which corresponds to the given CORE_ADDR
- or NULL if no FRAME on the chain corresponds to CORE_ADDR. */
-
-static struct frame_info *
-find_frame_addr_in_frame_chain (CORE_ADDR frame_addr)
-{
- struct frame_info *frame = NULL;
-
- if (frame_addr == (CORE_ADDR) 0)
- return NULL;
-
- while (1)
- {
- frame = get_prev_frame (frame);
- if (frame == NULL)
- return NULL;
- if (get_frame_base_address (frame) == frame_addr)
- return frame;
- }
-}
-
struct varobj *
varobj_create (char *objname,
- char *expression, CORE_ADDR frame, enum varobj_type type)
+ char *expression, CORE_ADDR frame)
{
struct varobj *var;
- struct frame_info *fi;
- struct frame_info *old_fi = NULL;
+ struct frame_info *fi, *old_fi;
struct block *block;
struct cleanup *old_chain;
/* Fill out a varobj structure for the (root) variable being constructed. */
var = new_root_variable ();
- old_chain = make_cleanup_free_variable (var);
+ old_chain = make_cleanup ((make_cleanup_func) free_variable, var);
if (expression != NULL)
{
char *p;
enum varobj_languages lang;
- struct value *value = NULL;
- int expr_len;
/* Parse and evaluate the expression, filling in as much
of the variable's data as possible */
/* Allow creator to specify context of variable */
- if ((type == USE_CURRENT_FRAME) || (type == USE_SELECTED_FRAME))
- fi = deprecated_safe_get_selected_frame ();
+ if (frame == (CORE_ADDR) -1)
+ fi = selected_frame;
else
- /* FIXME: cagney/2002-11-23: This code should be doing a
- lookup using the frame ID and not just the frame's
- ``address''. This, of course, means an interface change.
- However, with out that interface change ISAs, such as the
- ia64 with its two stacks, won't work. Similar goes for the
- case where there is a frameless function. */
fi = find_frame_addr_in_frame_chain (frame);
- /* frame = -2 means always use selected frame */
- if (type == USE_SELECTED_FRAME)
- var->root->floating = 1;
-
block = NULL;
if (fi != NULL)
- block = get_frame_block (fi, 0);
+ block = get_frame_block (fi);
p = expression;
innermost_block = NULL;
- /* Wrap the call to parse expression, so we can
- return a sensible error. */
- if (!gdb_parse_exp_1 (&p, block, 0, &var->root->exp))
- {
- return NULL;
- }
+ /* Callee may longjump */
+ var->root->exp = parse_exp_1 (&p, block, 0);
/* Don't allow variables to be created for types. */
if (var->root->exp->elts[0].opcode == OP_TYPE)
{
do_cleanups (old_chain);
- fprintf_unfiltered (gdb_stderr, "Attempt to use a type name"
- " as an expression.\n");
+ fprintf_unfiltered (gdb_stderr,
+ "Attempt to use a type name as an expression.");
return NULL;
}
var->format = variable_default_display (var);
var->root->valid_block = innermost_block;
- expr_len = strlen (expression);
- var->name = savestring (expression, expr_len);
- /* For a root var, the name and the expr are the same. */
- var->path_expr = savestring (expression, expr_len);
+ var->name = savestring (expression, strlen (expression));
/* When the frame is different from the current frame,
we must select the appropriate frame before parsing
the expression, otherwise the value will not be current.
Since select_frame is so benign, just call it for all cases. */
- if (innermost_block && fi != NULL)
+ if (fi != NULL)
{
- var->root->frame = get_frame_id (fi);
- var->root->thread_id = pid_to_thread_id (inferior_ptid);
- old_fi = get_selected_frame (NULL);
- select_frame (fi);
+ var->root->frame = FRAME_FP (fi);
+ old_fi = selected_frame;
+ select_frame (fi, -1);
}
- /* We definitely need to catch errors here.
+ /* We definitively need to catch errors here.
If evaluate_expression succeeds we got the value we wanted.
But if it fails, we still go on with a call to evaluate_type() */
- if (!gdb_evaluate_expression (var->root->exp, &value))
+ if (gdb_evaluate_expression (var->root->exp, &var->value))
{
- /* Error getting the value. Try to at least get the
- right type. */
- struct value *type_only_value = evaluate_type (var->root->exp);
- var->type = value_type (type_only_value);
+ /* no error */
+ release_value (var->value);
+ if (VALUE_LAZY (var->value))
+ gdb_value_fetch_lazy (var->value);
}
- else
- var->type = value_type (value);
+ else
+ var->value = evaluate_type (var->root->exp);
- install_new_value (var, value, 1 /* Initial assignment */);
+ var->type = VALUE_TYPE (var->value);
/* Set language info */
lang = variable_language (var);
- var->root->lang = &languages[lang];
+ var->root->lang = languages[lang];
/* Set ourselves as our root */
var->root->rootvar = var;
/* Reset the selected frame */
if (fi != NULL)
- select_frame (old_fi);
+ select_frame (old_fi, -1);
}
- /* If the variable object name is null, that means this
- is a temporary variable, so don't install it. */
-
- if ((var != NULL) && (objname != NULL))
+ if (var != NULL)
{
var->obj_name = savestring (objname, strlen (objname));
@@ -574,13 +509,13 @@ char *
varobj_gen_name (void)
{
static int id = 0;
- char *obj_name;
+ char obj_name[31];
/* generate a name for this object */
id++;
- obj_name = xstrprintf ("var%d", id);
+ sprintf (obj_name, "var%d", id);
- return obj_name;
+ return xstrdup (obj_name);
}
/* Given an "objname", returns the pointer to the corresponding varobj
@@ -604,7 +539,7 @@ varobj_get_handle (char *objname)
cv = cv->next;
if (cv == NULL)
- error (_("Variable object not found"));
+ error ("Variable object not found");
return cv->var;
}
@@ -663,8 +598,7 @@ varobj_delete (struct varobj *var, char ***dellist, int only_children)
}
if (mycount || (*cp != NULL))
- warning (_("varobj_delete: assertion failed - mycount(=%d) <> 0"),
- mycount);
+ warning ("varobj_delete: assertion failed - mycount(=%d) <> 0", mycount);
}
return delcount;
@@ -690,13 +624,6 @@ varobj_set_display_format (struct varobj *var,
var->format = variable_default_display (var);
}
- if (varobj_value_is_changeable_p (var)
- && var->value && !value_lazy (var->value))
- {
- free (var->print_value);
- var->print_value = value_get_print_value (var->value, var->format);
- }
-
return var->format;
}
@@ -706,39 +633,6 @@ varobj_get_display_format (struct varobj *var)
return var->format;
}
-/* If the variable object is bound to a specific thread, that
- is its evaluation can always be done in context of a frame
- inside that thread, returns GDB id of the thread -- which
- is always positive. Otherwise, returns -1. */
-int
-varobj_get_thread_id (struct varobj *var)
-{
- if (var->root->valid_block && var->root->thread_id > 0)
- return var->root->thread_id;
- else
- return -1;
-}
-
-void
-varobj_set_frozen (struct varobj *var, int frozen)
-{
- /* When a variable is unfrozen, we don't fetch its value.
- The 'not_fetched' flag remains set, so next -var-update
- won't complain.
-
- We don't fetch the value, because for structures the client
- should do -var-update anyway. It would be bad to have different
- client-size logic for structure and other types. */
- var->frozen = frozen;
-}
-
-int
-varobj_get_frozen (struct varobj *var)
-{
- return var->frozen;
-}
-
-
int
varobj_get_num_children (struct varobj *var)
{
@@ -751,41 +645,43 @@ varobj_get_num_children (struct varobj *var)
/* Creates a list of the immediate children of a variable object;
the return code is the number of such children or -1 on error */
-VEC (varobj_p)*
-varobj_list_children (struct varobj *var)
+int
+varobj_list_children (struct varobj *var, struct varobj ***childlist)
{
struct varobj *child;
char *name;
int i;
- if (var->num_children == -1)
- var->num_children = number_of_children (var);
+ /* sanity check: have we been passed a pointer? */
+ if (childlist == NULL)
+ return -1;
+
+ *childlist = NULL;
- /* If that failed, give up. */
if (var->num_children == -1)
- return var->children;
+ var->num_children = number_of_children (var);
- /* If we're called when the list of children is not yet initialized,
- allocate enough elements in it. */
- while (VEC_length (varobj_p, var->children) < var->num_children)
- VEC_safe_push (varobj_p, var->children, NULL);
+ /* List of children */
+ *childlist = xmalloc ((var->num_children + 1) * sizeof (struct varobj *));
for (i = 0; i < var->num_children; i++)
{
- varobj_p existing = VEC_index (varobj_p, var->children, i);
+ /* Mark as the end in case we bail out */
+ *((*childlist) + i) = NULL;
- if (existing == NULL)
- {
- /* Either it's the first call to varobj_list_children for
- this variable object, and the child was never created,
- or it was explicitly deleted by the client. */
- name = name_of_child (var, i);
- existing = create_child (var, i, name);
- VEC_replace (varobj_p, var->children, i, existing);
- }
+ /* check if child exists, if not create */
+ name = name_of_child (var, i);
+ child = child_exists (var, name);
+ if (child == NULL)
+ child = create_child (var, i, name);
+
+ *((*childlist) + i) = child;
}
- return var->children;
+ /* End of list is marked by a NULL pointer */
+ *((*childlist) + i) = NULL;
+
+ return var->num_children;
}
/* Obtain the type of an object Variable as a string similar to the one gdb
@@ -794,56 +690,30 @@ varobj_list_children (struct varobj *var)
char *
varobj_get_type (struct varobj *var)
{
- struct value *val;
+ value_ptr val;
struct cleanup *old_chain;
struct ui_file *stb;
char *thetype;
long length;
/* For the "fake" variables, do not return a type. (It's type is
- NULL, too.)
- Do not return a type for invalid variables as well. */
- if (CPLUS_FAKE_CHILD (var) || !var->root->is_valid)
+ NULL, too.) */
+ if (CPLUS_FAKE_CHILD (var))
return NULL;
stb = mem_fileopen ();
old_chain = make_cleanup_ui_file_delete (stb);
- /* To print the type, we simply create a zero ``struct value *'' and
+ /* To print the type, we simply create a zero value_ptr and
cast it to our type. We then typeprint this variable. */
val = value_zero (var->type, not_lval);
- type_print (value_type (val), "", stb, -1);
+ type_print (VALUE_TYPE (val), "", stb, -1);
thetype = ui_file_xstrdup (stb, &length);
do_cleanups (old_chain);
return thetype;
}
-/* Obtain the type of an object variable. */
-
-struct type *
-varobj_get_gdb_type (struct varobj *var)
-{
- return var->type;
-}
-
-/* Return a pointer to the full rooted expression of varobj VAR.
- If it has not been computed yet, compute it. */
-char *
-varobj_get_path_expr (struct varobj *var)
-{
- if (var->path_expr != NULL)
- return var->path_expr;
- else
- {
- /* For root varobjs, we initialize path_expr
- when creating varobj, so here it should be
- child varobj. */
- gdb_assert (!is_root_p (var));
- return (*var->root->lang->path_expr_of_child) (var);
- }
-}
-
enum varobj_languages
varobj_get_language (struct varobj *var)
{
@@ -855,7 +725,7 @@ varobj_get_attributes (struct varobj *var)
{
int attributes = 0;
- if (varobj_editable_p (var))
+ if (variable_editable (var))
/* FIXME: define masks for attributes */
attributes |= 0x00000001; /* Editable */
@@ -863,16 +733,9 @@ varobj_get_attributes (struct varobj *var)
}
char *
-varobj_get_formatted_value (struct varobj *var,
- enum varobj_display_formats format)
-{
- return my_value_of_variable (var, format);
-}
-
-char *
varobj_get_value (struct varobj *var)
{
- return my_value_of_variable (var, var->format);
+ return my_value_of_variable (var);
}
/* Set the value of an object variable (if it is editable) to the
@@ -882,61 +745,69 @@ varobj_get_value (struct varobj *var)
int
varobj_set_value (struct varobj *var, char *expression)
{
- struct value *val;
+ value_ptr val;
int offset = 0;
- int error = 0;
/* The argument "expression" contains the variable's new value.
We need to first construct a legal expression for this -- ugh! */
/* Does this cover all the bases? */
struct expression *exp;
- struct value *value;
+ value_ptr value;
int saved_input_radix = input_radix;
- char *s = expression;
- int i;
- gdb_assert (varobj_editable_p (var));
-
- input_radix = 10; /* ALWAYS reset to decimal temporarily */
- exp = parse_exp_1 (&s, 0, 0);
- if (!gdb_evaluate_expression (exp, &value))
+ if (variable_editable (var) && !var->error)
{
- /* We cannot proceed without a valid expression. */
- xfree (exp);
- return 0;
+ char *s = expression;
+ int i;
+ value_ptr temp;
+
+ input_radix = 10; /* ALWAYS reset to decimal temporarily */
+ /* FIXME: Callee may longjump */
+ exp = parse_exp_1 (&s, 0, 0);
+ if (!gdb_evaluate_expression (exp, &value))
+ {
+ /* We cannot proceed without a valid expression. */
+ FREEIF (exp);
+ return 0;
+ }
+
+ /* If our parent is "public", "private", or "protected", we could
+ be asking to modify the value of a baseclass. If so, we need to
+ adjust our address by the offset of our baseclass in the subclass,
+ since VALUE_ADDRESS (var->value) points at the start of the subclass.
+ For some reason, value_cast doesn't take care of this properly. */
+ temp = var->value;
+ if (var->parent != NULL && CPLUS_FAKE_CHILD (var->parent))
+ {
+ struct varobj *super, *sub;
+ struct type *type;
+ super = var->parent->parent;
+ sub = super->parent;
+ if (sub != NULL)
+ {
+ /* Yes, it is a baseclass */
+ type = get_type_deref (sub);
+
+ if (super->index < TYPE_N_BASECLASSES (type))
+ {
+ temp = value_copy (var->value);
+ for (i = 0; i < super->index; i++)
+ offset += TYPE_LENGTH (TYPE_FIELD_TYPE (type, i));
+ }
+ }
+ }
+
+ VALUE_ADDRESS (temp) += offset;
+ val = value_assign (temp, value);
+ VALUE_ADDRESS (val) -= offset;
+ value_free (var->value);
+ release_value (val);
+ var->value = val;
+ input_radix = saved_input_radix;
+ return 1;
}
- /* All types that are editable must also be changeable. */
- gdb_assert (varobj_value_is_changeable_p (var));
-
- /* The value of a changeable variable object must not be lazy. */
- gdb_assert (!value_lazy (var->value));
-
- /* Need to coerce the input. We want to check if the
- value of the variable object will be different
- after assignment, and the first thing value_assign
- does is coerce the input.
- For example, if we are assigning an array to a pointer variable we
- should compare the pointer with the the array's address, not with the
- array's content. */
- value = coerce_array (value);
-
- /* The new value may be lazy. gdb_value_assign, or
- rather value_contents, will take care of this.
- If fetching of the new value will fail, gdb_value_assign
- with catch the exception. */
- if (!gdb_value_assign (var->value, value, &val))
- return 0;
-
- /* If the value has changed, record it, so that next -var-update can
- report this change. If a variable had a value of '1', we've set it
- to '333' and then set again to '1', when -var-update will report this
- variable as changed -- because the first assignment has set the
- 'updated' flag. There's no need to optimize that, because return value
- of -var-update should be considered an approximation. */
- var->updated = install_new_value (var, val, 0 /* Compare values. */);
- input_radix = saved_input_radix;
- return 1;
+ return 0;
}
/* Returns a malloc'ed list with all root variable objects */
@@ -963,267 +834,157 @@ varobj_list (struct varobj ***varlist)
*cv = NULL;
if (mycount || (croot != NULL))
- warning
- ("varobj_list: assertion failed - wrong tally of root vars (%d:%d)",
- rootcount, mycount);
+ warning ("varobj_list: assertion failed - wrong tally of root vars (%d:%d)",
+ rootcount, mycount);
return rootcount;
}
-/* Assign a new value to a variable object. If INITIAL is non-zero,
- this is the first assignement after the variable object was just
- created, or changed type. In that case, just assign the value
- and return 0.
- Otherwise, assign the value and if type_changeable returns non-zero,
- find if the new value is different from the current value.
- Return 1 if so, and 0 if the values are equal.
-
- The VALUE parameter should not be released -- the function will
- take care of releasing it when needed. */
-static int
-install_new_value (struct varobj *var, struct value *value, int initial)
-{
- int changeable;
- int need_to_fetch;
- int changed = 0;
- int intentionally_not_fetched = 0;
- char *print_value = NULL;
-
- /* We need to know the varobj's type to decide if the value should
- be fetched or not. C++ fake children (public/protected/private) don't have
- a type. */
- gdb_assert (var->type || CPLUS_FAKE_CHILD (var));
- changeable = varobj_value_is_changeable_p (var);
- need_to_fetch = changeable;
-
- /* We are not interested in the address of references, and given
- that in C++ a reference is not rebindable, it cannot
- meaningfully change. So, get hold of the real value. */
- if (value)
- {
- value = coerce_ref (value);
- release_value (value);
- }
-
- if (var->type && TYPE_CODE (var->type) == TYPE_CODE_UNION)
- /* For unions, we need to fetch the value implicitly because
- of implementation of union member fetch. When gdb
- creates a value for a field and the value of the enclosing
- structure is not lazy, it immediately copies the necessary
- bytes from the enclosing values. If the enclosing value is
- lazy, the call to value_fetch_lazy on the field will read
- the data from memory. For unions, that means we'll read the
- same memory more than once, which is not desirable. So
- fetch now. */
- need_to_fetch = 1;
-
- /* The new value might be lazy. If the type is changeable,
- that is we'll be comparing values of this type, fetch the
- value now. Otherwise, on the next update the old value
- will be lazy, which means we've lost that old value. */
- if (need_to_fetch && value && value_lazy (value))
- {
- struct varobj *parent = var->parent;
- int frozen = var->frozen;
- for (; !frozen && parent; parent = parent->parent)
- frozen |= parent->frozen;
-
- if (frozen && initial)
- {
- /* For variables that are frozen, or are children of frozen
- variables, we don't do fetch on initial assignment.
- For non-initial assignemnt we do the fetch, since it means we're
- explicitly asked to compare the new value with the old one. */
- intentionally_not_fetched = 1;
- }
- else if (!gdb_value_fetch_lazy (value))
- {
- /* Set the value to NULL, so that for the next -var-update,
- we don't try to compare the new value with this value,
- that we couldn't even read. */
- value = NULL;
- }
- }
-
- /* Below, we'll be comparing string rendering of old and new
- values. Don't get string rendering if the value is
- lazy -- if it is, the code above has decided that the value
- should not be fetched. */
- if (value && !value_lazy (value))
- print_value = value_get_print_value (value, var->format);
-
- /* If the type is changeable, compare the old and the new values.
- If this is the initial assignment, we don't have any old value
- to compare with. */
- if (!initial && changeable)
- {
- /* If the value of the varobj was changed by -var-set-value, then the
- value in the varobj and in the target is the same. However, that value
- is different from the value that the varobj had after the previous
- -var-update. So need to the varobj as changed. */
- if (var->updated)
- {
- changed = 1;
- }
- else
- {
- /* Try to compare the values. That requires that both
- values are non-lazy. */
- if (var->not_fetched && value_lazy (var->value))
- {
- /* This is a frozen varobj and the value was never read.
- Presumably, UI shows some "never read" indicator.
- Now that we've fetched the real value, we need to report
- this varobj as changed so that UI can show the real
- value. */
- changed = 1;
- }
- else if (var->value == NULL && value == NULL)
- /* Equal. */
- ;
- else if (var->value == NULL || value == NULL)
- {
- changed = 1;
- }
- else
- {
- gdb_assert (!value_lazy (var->value));
- gdb_assert (!value_lazy (value));
-
- gdb_assert (var->print_value != NULL && print_value != NULL);
- if (strcmp (var->print_value, print_value) != 0)
- changed = 1;
- }
- }
- }
-
- /* We must always keep the new value, since children depend on it. */
- if (var->value != NULL && var->value != value)
- value_free (var->value);
- var->value = value;
- if (var->print_value)
- xfree (var->print_value);
- var->print_value = print_value;
- if (value && value_lazy (value) && intentionally_not_fetched)
- var->not_fetched = 1;
- else
- var->not_fetched = 0;
- var->updated = 0;
-
- gdb_assert (!var->value || value_type (var->value));
-
- return changed;
-}
-
/* Update the values for a variable and its children. This is a
two-pronged attack. First, re-parse the value for the root's
expression to see if it's changed. Then go all the way
through its children, reconstructing them and noting if they've
changed.
- The EXPLICIT parameter specifies if this call is result
- of MI request to update this specific variable, or
- result of implicit -var-update *. For implicit request, we don't
- update frozen variables.
-
- NOTE: This function may delete the caller's varobj. If it
- returns TYPE_CHANGED, then it has done this and VARP will be modified
- to point to the new varobj. */
+ Only root variables can be updated... */
-VEC(varobj_update_result) *varobj_update (struct varobj **varp, int explicit)
+int
+varobj_update (struct varobj *var, struct varobj ***changelist)
{
int changed = 0;
- int type_changed = 0;
int i;
int vleft;
+ int error2;
struct varobj *v;
struct varobj **cv;
- struct varobj **templist = NULL;
- struct value *new;
- VEC (varobj_p) *stack = NULL;
- VEC (varobj_update_result) *result = NULL;
- struct frame_info *fi;
+ struct varobj **templist;
+ value_ptr new;
+ struct vstack *stack = NULL;
+ struct vstack *result = NULL;
+ struct frame_info *old_fi;
+
+ /* sanity check: have we been passed a pointer? */
+ if (changelist == NULL)
+ return -1;
- /* Frozen means frozen -- we don't check for any change in
- this varobj, including its going out of scope, or
- changing type. One use case for frozen varobjs is
- retaining previously evaluated expressions, and we don't
- want them to be reevaluated at all. */
- if (!explicit && (*varp)->frozen)
- return result;
+ /* Only root variables can be updated... */
+ if (var->root->rootvar != var)
+ /* Not a root var */
+ return -1;
- if (!(*varp)->root->is_valid)
- {
- varobj_update_result r = {*varp};
- r.status = VAROBJ_INVALID;
- VEC_safe_push (varobj_update_result, result, &r);
- return result;
- }
+ /* Save the selected stack frame, since we will need to change it
+ in order to evaluate expressions. */
+ old_fi = selected_frame;
+
+ /* Update the root variable. value_of_root can return NULL
+ if the variable is no longer around, i.e. we stepped out of
+ the frame in which a local existed. */
+ new = value_of_root (var);
+ if (new == NULL)
+ return -1;
+
+ /* Initialize a stack for temporary results */
+ vpush (&result, NULL);
- if ((*varp)->root->rootvar == *varp)
+ if (!my_value_equal (var->value, new, &error2))
{
- varobj_update_result r = {*varp};
- r.status = VAROBJ_IN_SCOPE;
-
- /* Update the root variable. value_of_root can return NULL
- if the variable is no longer around, i.e. we stepped out of
- the frame in which a local existed. We are letting the
- value_of_root variable dispose of the varobj if the type
- has changed. */
- new = value_of_root (varp, &type_changed);
- r.varobj = *varp;
-
- r.type_changed = type_changed;
- if (install_new_value ((*varp), new, type_changed))
- r.changed = 1;
-
- if (new == NULL)
- r.status = VAROBJ_NOT_IN_SCOPE;
-
- if (r.type_changed || r.changed)
- VEC_safe_push (varobj_update_result, result, &r);
-
- if (r.status == VAROBJ_NOT_IN_SCOPE)
- return result;
+ /* Note that it's changed There a couple of exceptions here,
+ though. We don't want some types to be reported as "changed". */
+ if (type_changeable (var))
+ {
+ vpush (&result, var);
+ changed++;
+ }
}
+ /* error2 replaces var->error since this new value
+ WILL replace the old one. */
+ var->error = error2;
+
+ /* We must always keep around the new value for this root
+ variable expression, or we lose the updated children! */
+ value_free (var->value);
+ var->value = new;
- VEC_safe_push (varobj_p, stack, *varp);
+ /* Initialize a stack */
+ vpush (&stack, NULL);
- /* Walk through the children, reconstructing them all. */
- while (!VEC_empty (varobj_p, stack))
+ /* Push the root's children */
+ if (var->children != NULL)
{
- v = VEC_pop (varobj_p, stack);
+ struct varobj_child *c;
+ for (c = var->children; c != NULL; c = c->next)
+ vpush (&stack, c->child);
+ }
- /* Push any children. Use reverse order so that the first
- child is popped from the work stack first, and so
- will be added to result first. This does not
- affect correctness, just "nicer". */
- for (i = VEC_length (varobj_p, v->children)-1; i >= 0; --i)
+ /* Walk through the children, reconstructing them all. */
+ v = vpop (&stack);
+ while (v != NULL)
+ {
+ /* Push any children */
+ if (v->children != NULL)
{
- varobj_p c = VEC_index (varobj_p, v->children, i);
- /* Child may be NULL if explicitly deleted by -var-delete. */
- if (c != NULL && !c->frozen)
- VEC_safe_push (varobj_p, stack, c);
+ struct varobj_child *c;
+ for (c = v->children; c != NULL; c = c->next)
+ vpush (&stack, c->child);
}
- /* Update this variable, unless it's a root, which is already
- updated. */
- if (v->root->rootvar != v)
- {
- new = value_of_child (v->parent, v->index);
- if (install_new_value (v, new, 0 /* type not changed */))
- {
- /* Note that it's changed */
- varobj_update_result r = {v};
- r.changed = 1;
- VEC_safe_push (varobj_update_result, result, &r);
- v->updated = 0;
- }
+ /* Update this variable */
+ new = value_of_child (v->parent, v->index);
+ if (type_changeable (v) && !my_value_equal (v->value, new, &error2))
+ {
+ /* Note that it's changed */
+ vpush (&result, v);
+ changed++;
}
+ /* error2 replaces v->error since this new value
+ WILL replace the old one. */
+ v->error = error2;
+
+ /* We must always keep new values, since children depend on it. */
+ if (v->value != NULL)
+ value_free (v->value);
+ v->value = new;
+
+ /* Get next child */
+ v = vpop (&stack);
}
- VEC_free (varobj_p, stack);
- return result;
+ /* Alloc (changed + 1) list entries */
+ /* FIXME: add a cleanup for the allocated list(s)
+ because one day the select_frame called below can longjump */
+ *changelist = xmalloc ((changed + 1) * sizeof (struct varobj *));
+ if (changed > 1)
+ {
+ templist = xmalloc ((changed + 1) * sizeof (struct varobj *));
+ cv = templist;
+ }
+ else
+ cv = *changelist;
+
+ /* Copy from result stack to list */
+ vleft = changed;
+ *cv = vpop (&result);
+ while ((*cv != NULL) && (vleft > 0))
+ {
+ vleft--;
+ cv++;
+ *cv = vpop (&result);
+ }
+ if (vleft)
+ warning ("varobj_update: assertion failed - vleft <> 0");
+
+ if (changed > 1)
+ {
+ /* Now we revert the order. */
+ for (i=0; i < changed; i++)
+ *(*changelist + i) = *(templist + changed -1 - i);
+ *(*changelist + changed) = NULL;
+ }
+
+ /* Restore selected frame */
+ select_frame (old_fi, -1);
+
+ return changed;
}
@@ -1234,8 +995,10 @@ VEC(varobj_update_result) *varobj_update (struct varobj **varp, int explicit)
*/
static int
-delete_variable (struct cpstack **resultp, struct varobj *var,
- int only_children_p)
+delete_variable (resultp, var, only_children_p)
+ struct cpstack **resultp;
+ struct varobj *var;
+ int only_children_p;
{
int delcount = 0;
@@ -1250,34 +1013,37 @@ delete_variable (struct cpstack **resultp, struct varobj *var,
and the parent is not removed we dump core. It must be always
initially called with remove_from_parent_p set */
static void
-delete_variable_1 (struct cpstack **resultp, int *delcountp,
- struct varobj *var, int only_children_p,
- int remove_from_parent_p)
+delete_variable_1 (resultp, delcountp, var,
+ only_children_p, remove_from_parent_p)
+ struct cpstack **resultp;
+ int *delcountp;
+ struct varobj *var;
+ int only_children_p;
+ int remove_from_parent_p;
{
- int i;
+ struct varobj_child *vc;
+ struct varobj_child *next;
/* Delete any children of this variable, too. */
- for (i = 0; i < VEC_length (varobj_p, var->children); ++i)
- {
- varobj_p child = VEC_index (varobj_p, var->children, i);
- if (!child)
- continue;
+ for (vc = var->children; vc != NULL; vc = next)
+ {
if (!remove_from_parent_p)
- child->parent = NULL;
- delete_variable_1 (resultp, delcountp, child, 0, only_children_p);
+ vc->child->parent = NULL;
+ delete_variable_1 (resultp, delcountp, vc->child, 0, only_children_p);
+ next = vc->next;
+ free (vc);
}
- VEC_free (varobj_p, var->children);
/* if we were called to delete only the children we are done here */
if (only_children_p)
return;
/* Otherwise, add it to the list of deleted ones and proceed to do so */
- /* If the name is null, this is a temporary variable, that has not
- yet been installed, don't report it, it belongs to the caller... */
- if (var->obj_name != NULL)
+ if (var->obj_name == NULL)
+ warning ("Assertion failed: NULL var->obj_name unexpectdly found");
+ else
{
- cppush (resultp, xstrdup (var->obj_name));
+ cppush (resultp, strdup (var->obj_name));
*delcountp = *delcountp + 1;
}
@@ -1286,13 +1052,13 @@ delete_variable_1 (struct cpstack **resultp, int *delcountp,
(as indicated by remove_from_parent_p) we don't bother doing an
expensive list search to find the element to remove when we are
discarding the list afterwards */
- if ((remove_from_parent_p) && (var->parent != NULL))
+ if ((remove_from_parent_p) &&
+ (var->parent != NULL))
{
- VEC_replace (varobj_p, var->parent->children, var->index, NULL);
+ remove_child_from_parent (var->parent, var);
}
- if (var->obj_name != NULL)
- uninstall_variable (var);
+ uninstall_variable (var);
/* Free memory associated with this variable */
free_variable (var);
@@ -1300,7 +1066,8 @@ delete_variable_1 (struct cpstack **resultp, int *delcountp,
/* Install the given variable VAR with the object name VAR->OBJ_NAME. */
static int
-install_variable (struct varobj *var)
+install_variable (var)
+ struct varobj *var;
{
struct vlist *cv;
struct vlist *newvl;
@@ -1318,7 +1085,7 @@ install_variable (struct varobj *var)
cv = cv->next;
if (cv != NULL)
- error (_("Duplicate variable object name"));
+ error ("Duplicate variable object name");
/* Add varobj to hash table */
newvl = xmalloc (sizeof (struct vlist));
@@ -1327,7 +1094,7 @@ install_variable (struct varobj *var)
*(varobj_table + index) = newvl;
/* If root, add varobj to root list */
- if (is_root_p (var))
+ if (var->root->rootvar == var)
{
/* Add to list of root variables */
if (rootlist == NULL)
@@ -1343,7 +1110,8 @@ install_variable (struct varobj *var)
/* Unistall the object VAR. */
static void
-uninstall_variable (struct varobj *var)
+uninstall_variable (var)
+ struct varobj *var;
{
struct vlist *cv;
struct vlist *prev;
@@ -1372,9 +1140,7 @@ uninstall_variable (struct varobj *var)
if (cv == NULL)
{
- warning
- ("Assertion failed: Could not find variable object \"%s\" to delete",
- var->obj_name);
+ warning ("Assertion failed: Could not find variable object \"%s\" to delete", var->obj_name);
return;
}
@@ -1383,10 +1149,10 @@ uninstall_variable (struct varobj *var)
else
prev->next = cv->next;
- xfree (cv);
+ free (cv);
/* If root, remove varobj from root list */
- if (is_root_p (var))
+ if (var->root->rootvar == var)
{
/* Remove from list of root variables */
if (rootlist == var->root)
@@ -1402,9 +1168,7 @@ uninstall_variable (struct varobj *var)
}
if (cr == NULL)
{
- warning
- ("Assertion failed: Could not find varobj \"%s\" in root list",
- var->obj_name);
+ warning ("Assertion failed: Could not find varobj \"%s\" in root list", var->obj_name);
return;
}
if (prer == NULL)
@@ -1417,40 +1181,102 @@ uninstall_variable (struct varobj *var)
}
+/* Does a child with the name NAME exist in VAR? If so, return its data.
+ If not, return NULL. */
+static struct varobj *
+child_exists (var, name)
+ struct varobj *var; /* Parent */
+ char *name; /* name of child */
+{
+ struct varobj_child *vc;
+
+ for (vc = var->children; vc != NULL; vc = vc->next)
+ {
+ if (STREQ (vc->child->name, name))
+ return vc->child;
+ }
+
+ return NULL;
+}
+
/* Create and install a child of the parent of the given name */
static struct varobj *
-create_child (struct varobj *parent, int index, char *name)
+create_child (parent, index, name)
+ struct varobj *parent;
+ int index;
+ char *name;
{
struct varobj *child;
char *childs_name;
- struct value *value;
child = new_variable ();
/* name is allocated by name_of_child */
child->name = name;
child->index = index;
- value = value_of_child (parent, index);
+ child->value = value_of_child (parent, index);
+ if (child->value == NULL || parent->error)
+ child->error = 1;
child->parent = parent;
child->root = parent->root;
- childs_name = xstrprintf ("%s.%s", parent->obj_name, name);
+ childs_name = (char *) xmalloc ((strlen (parent->obj_name) + strlen (name) + 2)
+ * sizeof (char));
+ sprintf (childs_name, "%s.%s", parent->obj_name, name);
child->obj_name = childs_name;
install_variable (child);
- /* Compute the type of the child. Must do this before
- calling install_new_value. */
- if (value != NULL)
- /* If the child had no evaluation errors, var->value
- will be non-NULL and contain a valid type. */
- child->type = value_type (value);
- else
- /* Otherwise, we must compute the type. */
- child->type = (*child->root->lang->type_of_child) (child->parent,
- child->index);
- install_new_value (child, value, 1);
+ /* Save a pointer to this child in the parent */
+ save_child_in_parent (parent, child);
+
+ /* Note the type of this child */
+ child->type = type_of_child (child);
return child;
}
+
+/* FIXME: This should be a generic add to list */
+/* Save CHILD in the PARENT's data. */
+static void
+save_child_in_parent (parent, child)
+ struct varobj *parent;
+ struct varobj *child;
+{
+ struct varobj_child *vc;
+
+ /* Insert the child at the top */
+ vc = parent->children;
+ parent->children =
+ (struct varobj_child *) xmalloc (sizeof (struct varobj_child));
+
+ parent->children->next = vc;
+ parent->children->child = child;
+}
+
+/* FIXME: This should be a generic remove from list */
+/* Remove the CHILD from the PARENT's list of children. */
+static void
+remove_child_from_parent (parent, child)
+ struct varobj *parent;
+ struct varobj *child;
+{
+ struct varobj_child *vc, *prev;
+
+ /* Find the child in the parent's list */
+ prev = NULL;
+ for (vc = parent->children; vc != NULL;)
+ {
+ if (vc->child == child)
+ break;
+ prev = vc;
+ vc = vc->next;
+ }
+
+ if (prev == NULL)
+ parent->children = vc->next;
+ else
+ prev->next = vc->next;
+
+}
/*
@@ -1465,20 +1291,16 @@ new_variable (void)
var = (struct varobj *) xmalloc (sizeof (struct varobj));
var->name = NULL;
- var->path_expr = NULL;
var->obj_name = NULL;
var->index = -1;
var->type = NULL;
var->value = NULL;
+ var->error = 0;
var->num_children = -1;
var->parent = NULL;
var->children = NULL;
var->format = 0;
var->root = NULL;
- var->updated = 0;
- var->print_value = NULL;
- var->frozen = 0;
- var->not_fetched = 0;
return var;
}
@@ -1492,105 +1314,72 @@ new_root_variable (void)
var->root->lang = NULL;
var->root->exp = NULL;
var->root->valid_block = NULL;
- var->root->frame = null_frame_id;
- var->root->floating = 0;
+ var->root->frame = (CORE_ADDR) -1;
var->root->rootvar = NULL;
- var->root->is_valid = 1;
return var;
}
/* Free any allocated memory associated with VAR. */
static void
-free_variable (struct varobj *var)
+free_variable (var)
+ struct varobj *var;
{
/* Free the expression if this is a root variable. */
- if (is_root_p (var))
+ if (var->root->rootvar == var)
{
- free_current_contents (&var->root->exp);
- xfree (var->root);
+ free_current_contents ((char **) &var->root->exp);
+ FREEIF (var->root);
}
- xfree (var->name);
- xfree (var->obj_name);
- xfree (var->print_value);
- xfree (var->path_expr);
- xfree (var);
-}
-
-static void
-do_free_variable_cleanup (void *var)
-{
- free_variable (var);
-}
-
-static struct cleanup *
-make_cleanup_free_variable (struct varobj *var)
-{
- return make_cleanup (do_free_variable_cleanup, var);
+ FREEIF (var->name);
+ FREEIF (var->obj_name);
+ FREEIF (var);
}
-/* This returns the type of the variable. It also skips past typedefs
- to return the real type of the variable.
-
- NOTE: TYPE_TARGET_TYPE should NOT be used anywhere in this file
- except within get_target_type and get_type. */
+/* This returns the type of the variable. This skips past typedefs
+ and returns the real type of the variable. It also dereferences
+ pointers and references. */
static struct type *
-get_type (struct varobj *var)
+get_type (var)
+ struct varobj *var;
{
struct type *type;
type = var->type;
- if (type != NULL)
- type = check_typedef (type);
+ while (type != NULL && TYPE_CODE (type) == TYPE_CODE_TYPEDEF)
+ type = TYPE_TARGET_TYPE (type);
return type;
}
-/* Return the type of the value that's stored in VAR,
- or that would have being stored there if the
- value were accessible.
-
- This differs from VAR->type in that VAR->type is always
- the true type of the expession in the source language.
- The return value of this function is the type we're
- actually storing in varobj, and using for displaying
- the values and for comparing previous and new values.
-
- For example, top-level references are always stripped. */
+/* This returns the type of the variable, dereferencing pointers, too. */
static struct type *
-get_value_type (struct varobj *var)
+get_type_deref (var)
+ struct varobj *var;
{
struct type *type;
- if (var->value)
- type = value_type (var->value);
- else
- type = var->type;
-
- type = check_typedef (type);
+ type = get_type (var);
- if (TYPE_CODE (type) == TYPE_CODE_REF)
+ if (type != NULL && (TYPE_CODE (type) == TYPE_CODE_PTR
+ || TYPE_CODE (type) == TYPE_CODE_REF))
type = get_target_type (type);
- type = check_typedef (type);
-
return type;
}
/* This returns the target type (or NULL) of TYPE, also skipping
- past typedefs, just like get_type ().
-
- NOTE: TYPE_TARGET_TYPE should NOT be used anywhere in this file
- except within get_target_type and get_type. */
+ past typedefs, just like get_type (). */
static struct type *
-get_target_type (struct type *type)
+get_target_type (type)
+ struct type *type;
{
if (type != NULL)
{
type = TYPE_TARGET_TYPE (type);
- if (type != NULL)
- type = check_typedef (type);
+ while (type != NULL && TYPE_CODE (type) == TYPE_CODE_TYPEDEF)
+ type = TYPE_TARGET_TYPE (type);
}
return type;
@@ -1599,14 +1388,109 @@ get_target_type (struct type *type)
/* What is the default display for this variable? We assume that
everything is "natural". Any exceptions? */
static enum varobj_display_formats
-variable_default_display (struct varobj *var)
+variable_default_display (var)
+ struct varobj *var;
{
return FORMAT_NATURAL;
}
+/* This function is similar to gdb's value_equal, except that this
+ one is "safe" -- it NEVER longjmps. It determines if the VAR's
+ value is the same as VAL2. */
+static int
+my_value_equal (val1, val2, error2)
+ value_ptr val1;
+ value_ptr val2;
+ int *error2;
+{
+ int r, err1, err2;
+
+ *error2 = 0;
+ /* Special case: NULL values. If both are null, say
+ they're equal. */
+ if (val1 == NULL && val2 == NULL)
+ return 1;
+ else if (val1 == NULL || val2 == NULL)
+ return 0;
+
+ /* This is bogus, but unfortunately necessary. We must know
+ exactly what caused an error -- reading val1 or val2 -- so
+ that we can really determine if we think that something has changed. */
+ err1 = 0;
+ err2 = 0;
+ /* We do need to catch errors here because the whole purpose
+ is to test if value_equal() has errored */
+ if (!gdb_value_equal (val1, val1, &r))
+ err1 = 1;
+
+ if (!gdb_value_equal (val2, val2, &r))
+ *error2 = err2 = 1;
+
+ if (err1 != err2)
+ return 0;
+
+ if (!gdb_value_equal (val1, val2, &r))
+ {
+ /* An error occurred, this could have happened if
+ either val1 or val2 errored. ERR1 and ERR2 tell
+ us which of these it is. If both errored, then
+ we assume nothing has changed. If one of them is
+ valid, though, then something has changed. */
+ if (err1 == err2)
+ {
+ /* both the old and new values caused errors, so
+ we say the value did not change */
+ /* This is indeterminate, though. Perhaps we should
+ be safe and say, yes, it changed anyway?? */
+ return 1;
+ }
+ else
+ {
+ return 0;
+ }
+ }
+
+ return r;
+}
+
+/* FIXME: The following should be generic for any pointer */
+static void
+vpush (pstack, var)
+ struct vstack **pstack;
+ struct varobj *var;
+{
+ struct vstack *s;
+
+ s = (struct vstack *) xmalloc (sizeof (struct vstack));
+ s->var = var;
+ s->next = *pstack;
+ *pstack = s;
+}
+
+/* FIXME: The following should be generic for any pointer */
+static struct varobj *
+vpop (pstack)
+ struct vstack **pstack;
+{
+ struct vstack *s;
+ struct varobj *v;
+
+ if ((*pstack)->var == NULL && (*pstack)->next == NULL)
+ return NULL;
+
+ s = *pstack;
+ v = s->var;
+ *pstack = (*pstack)->next;
+ free (s);
+
+ return v;
+}
+
/* FIXME: The following should be generic for any pointer */
static void
-cppush (struct cpstack **pstack, char *name)
+cppush (pstack, name)
+ struct cpstack **pstack;
+ char *name;
{
struct cpstack *s;
@@ -1618,7 +1502,8 @@ cppush (struct cpstack **pstack, char *name)
/* FIXME: The following should be generic for any pointer */
static char *
-cppop (struct cpstack **pstack)
+cppop (pstack)
+ struct cpstack **pstack;
{
struct cpstack *s;
char *v;
@@ -1629,7 +1514,7 @@ cppop (struct cpstack **pstack)
s = *pstack;
v = s->name;
*pstack = (*pstack)->next;
- xfree (s);
+ free (s);
return v;
}
@@ -1642,7 +1527,8 @@ cppop (struct cpstack **pstack)
/* Get the language of variable VAR. */
static enum varobj_languages
-variable_language (struct varobj *var)
+variable_language (var)
+ struct varobj *var;
{
enum varobj_languages lang;
@@ -1669,181 +1555,92 @@ variable_language (struct varobj *var)
is the number of children that the user will see in the variable
display. */
static int
-number_of_children (struct varobj *var)
+number_of_children (var)
+ struct varobj *var;
{
return (*var->root->lang->number_of_children) (var);;
}
/* What is the expression for the root varobj VAR? Returns a malloc'd string. */
static char *
-name_of_variable (struct varobj *var)
+name_of_variable (var)
+ struct varobj *var;
{
return (*var->root->lang->name_of_variable) (var);
}
/* What is the name of the INDEX'th child of VAR? Returns a malloc'd string. */
static char *
-name_of_child (struct varobj *var, int index)
+name_of_child (var, index)
+ struct varobj *var;
+ int index;
{
return (*var->root->lang->name_of_child) (var, index);
}
-/* What is the ``struct value *'' of the root variable VAR?
- For floating variable object, evaluation can get us a value
- of different type from what is stored in varobj already. In
- that case:
- - *type_changed will be set to 1
- - old varobj will be freed, and new one will be
- created, with the same name.
- - *var_handle will be set to the new varobj
- Otherwise, *type_changed will be set to 0. */
-static struct value *
-value_of_root (struct varobj **var_handle, int *type_changed)
+/* What is the value_ptr of the root variable VAR? */
+static value_ptr
+value_of_root (var)
+ struct varobj *var;
{
- struct varobj *var;
-
- if (var_handle == NULL)
- return NULL;
-
- var = *var_handle;
-
- /* This should really be an exception, since this should
- only get called with a root variable. */
-
- if (!is_root_p (var))
- return NULL;
-
- if (var->root->floating)
- {
- struct varobj *tmp_var;
- char *old_type, *new_type;
-
- tmp_var = varobj_create (NULL, var->name, (CORE_ADDR) 0,
- USE_SELECTED_FRAME);
- if (tmp_var == NULL)
- {
- return NULL;
- }
- old_type = varobj_get_type (var);
- new_type = varobj_get_type (tmp_var);
- if (strcmp (old_type, new_type) == 0)
- {
- /* The expression presently stored inside var->root->exp
- remembers the locations of local variables relatively to
- the frame where the expression was created (in DWARF location
- button, for example). Naturally, those locations are not
- correct in other frames, so update the expression. */
-
- struct expression *tmp_exp = var->root->exp;
- var->root->exp = tmp_var->root->exp;
- tmp_var->root->exp = tmp_exp;
-
- varobj_delete (tmp_var, NULL, 0);
- *type_changed = 0;
- }
- else
- {
- tmp_var->obj_name =
- savestring (var->obj_name, strlen (var->obj_name));
- varobj_delete (var, NULL, 0);
-
- install_variable (tmp_var);
- *var_handle = tmp_var;
- var = *var_handle;
- *type_changed = 1;
- }
- xfree (old_type);
- xfree (new_type);
- }
- else
- {
- *type_changed = 0;
- }
-
- return (*var->root->lang->value_of_root) (var_handle);
+ return (*var->root->lang->value_of_root) (var);
}
-/* What is the ``struct value *'' for the INDEX'th child of PARENT? */
-static struct value *
-value_of_child (struct varobj *parent, int index)
+/* What is the value_ptr for the INDEX'th child of PARENT? */
+static value_ptr
+value_of_child (parent, index)
+ struct varobj *parent;
+ int index;
{
- struct value *value;
+ value_ptr value;
value = (*parent->root->lang->value_of_child) (parent, index);
+ /* If we're being lazy, fetch the real value of the variable. */
+ if (value != NULL && VALUE_LAZY (value))
+ gdb_value_fetch_lazy (value);
+
return value;
}
-/* GDB already has a command called "value_of_variable". Sigh. */
-static char *
-my_value_of_variable (struct varobj *var, enum varobj_display_formats format)
+/* What is the type of VAR? */
+static struct type *
+type_of_child (var)
+ struct varobj *var;
{
- if (var->root->is_valid)
- return (*var->root->lang->value_of_variable) (var, format);
- else
- return NULL;
-}
-static char *
-value_get_print_value (struct value *value, enum varobj_display_formats format)
-{
- long dummy;
- struct ui_file *stb;
- struct cleanup *old_chain;
- char *thevalue;
+ /* If the child had no evaluation errors, var->value
+ will be non-NULL and contain a valid type. */
+ if (var->value != NULL)
+ return VALUE_TYPE (var->value);
- if (value == NULL)
- return NULL;
-
- stb = mem_fileopen ();
- old_chain = make_cleanup_ui_file_delete (stb);
-
- common_val_print (value, stb, format_code[(int) format], 1, 0, 0,
- current_language);
- thevalue = ui_file_xstrdup (stb, &dummy);
-
- do_cleanups (old_chain);
- return thevalue;
+ /* Otherwise, we must compute the type. */
+ return (*var->root->lang->type_of_child) (var->parent, var->index);
}
-int
-varobj_editable_p (struct varobj *var)
+/* Is this variable editable? Use the variable's type to make
+ this determination. */
+static int
+variable_editable (var)
+ struct varobj *var;
{
- struct type *type;
- struct value *value;
-
- if (!(var->root->is_valid && var->value && VALUE_LVAL (var->value)))
- return 0;
-
- type = get_value_type (var);
-
- switch (TYPE_CODE (type))
- {
- case TYPE_CODE_STRUCT:
- case TYPE_CODE_UNION:
- case TYPE_CODE_ARRAY:
- case TYPE_CODE_FUNC:
- case TYPE_CODE_METHOD:
- return 0;
- break;
-
- default:
- return 1;
- break;
- }
+ return (*var->root->lang->variable_editable) (var);
}
-/* Return non-zero if changes in value of VAR
- must be detected and reported by -var-update.
- Return zero is -var-update should never report
- changes of such values. This makes sense for structures
- (since the changes in children values will be reported separately),
- or for artifical objects (like 'public' pseudo-field in C++).
+/* GDB already has a command called "value_of_variable". Sigh. */
+static char *
+my_value_of_variable (var)
+ struct varobj *var;
+{
+ return (*var->root->lang->value_of_variable) (var);
+}
- Return value of 0 means that gdb need not call value_fetch_lazy
- for the value of this variable object. */
+/* Is VAR something that can change? Depending on language,
+ some variable's values never change. For example,
+ struct and unions never change values. */
static int
-varobj_value_is_changeable_p (struct varobj *var)
+type_changeable (var)
+ struct varobj *var;
{
int r;
struct type *type;
@@ -1851,112 +1648,43 @@ varobj_value_is_changeable_p (struct varobj *var)
if (CPLUS_FAKE_CHILD (var))
return 0;
- type = get_value_type (var);
+ type = get_type (var);
switch (TYPE_CODE (type))
{
- case TYPE_CODE_STRUCT:
- case TYPE_CODE_UNION:
- case TYPE_CODE_ARRAY:
- r = 0;
- break;
+ case TYPE_CODE_STRUCT:
+ case TYPE_CODE_UNION:
+ r = 0;
+ break;
- default:
- r = 1;
+ default:
+ r = 1;
}
return r;
}
-/* Return 1 if that varobj is floating, that is is always evaluated in the
- selected frame, and not bound to thread/frame. Such variable objects
- are created using '@' as frame specifier to -var-create. */
-int
-varobj_floating_p (struct varobj *var)
-{
- return var->root->floating;
-}
-
-/* Given the value and the type of a variable object,
- adjust the value and type to those necessary
- for getting children of the variable object.
- This includes dereferencing top-level references
- to all types and dereferencing pointers to
- structures.
-
- Both TYPE and *TYPE should be non-null. VALUE
- can be null if we want to only translate type.
- *VALUE can be null as well -- if the parent
- value is not known.
-
- If WAS_PTR is not NULL, set *WAS_PTR to 0 or 1
- depending on whether pointer was deferenced
- in this function. */
-static void
-adjust_value_for_child_access (struct value **value,
- struct type **type,
- int *was_ptr)
-{
- gdb_assert (type && *type);
-
- if (was_ptr)
- *was_ptr = 0;
-
- *type = check_typedef (*type);
-
- /* The type of value stored in varobj, that is passed
- to us, is already supposed to be
- reference-stripped. */
-
- gdb_assert (TYPE_CODE (*type) != TYPE_CODE_REF);
-
- /* Pointers to structures are treated just like
- structures when accessing children. Don't
- dererences pointers to other types. */
- if (TYPE_CODE (*type) == TYPE_CODE_PTR)
- {
- struct type *target_type = get_target_type (*type);
- if (TYPE_CODE (target_type) == TYPE_CODE_STRUCT
- || TYPE_CODE (target_type) == TYPE_CODE_UNION)
- {
- if (value && *value)
- {
- int success = gdb_value_ind (*value, value);
- if (!success)
- *value = NULL;
- }
- *type = target_type;
- if (was_ptr)
- *was_ptr = 1;
- }
- }
-
- /* The 'get_target_type' function calls check_typedef on
- result, so we can immediately check type code. No
- need to call check_typedef here. */
-}
-
/* C */
static int
-c_number_of_children (struct varobj *var)
+c_number_of_children (var)
+ struct varobj *var;
{
- struct type *type = get_value_type (var);
- int children = 0;
+ struct type *type;
struct type *target;
+ int children;
- adjust_value_for_child_access (NULL, &type, NULL);
+ type = get_type (var);
target = get_target_type (type);
+ children = 0;
switch (TYPE_CODE (type))
{
case TYPE_CODE_ARRAY:
if (TYPE_LENGTH (type) > 0 && TYPE_LENGTH (target) > 0
- && TYPE_ARRAY_UPPER_BOUND_TYPE (type) != BOUND_CANNOT_BE_DETERMINED)
+ && TYPE_ARRAY_UPPER_BOUND_TYPE (type) != BOUND_CANNOT_BE_DETERMINED)
children = TYPE_LENGTH (type) / TYPE_LENGTH (target);
else
- /* If we don't know how many elements there are, don't display
- any. */
- children = 0;
+ children = -1;
break;
case TYPE_CODE_STRUCT:
@@ -1965,19 +1693,29 @@ c_number_of_children (struct varobj *var)
break;
case TYPE_CODE_PTR:
- /* The type here is a pointer to non-struct. Typically, pointers
- have one child, except for function ptrs, which have no children,
- and except for void*, as we don't know what to show.
-
- We can show char* so we allow it to be dereferenced. If you decide
- to test for it, please mind that a little magic is necessary to
- properly identify it: char* has TYPE_CODE == TYPE_CODE_INT and
- TYPE_NAME == "char" */
- if (TYPE_CODE (target) == TYPE_CODE_FUNC
- || TYPE_CODE (target) == TYPE_CODE_VOID)
- children = 0;
- else
- children = 1;
+ /* This is where things get compilcated. All pointers have one child.
+ Except, of course, for struct and union ptr, which we automagically
+ dereference for the user and function ptrs, which have no children. */
+ switch (TYPE_CODE (target))
+ {
+ case TYPE_CODE_STRUCT:
+ case TYPE_CODE_UNION:
+ children = TYPE_NFIELDS (target);
+ break;
+
+ case TYPE_CODE_FUNC:
+ children = 0;
+ break;
+
+ default:
+ /* Don't dereference char* or void*. */
+ if (TYPE_NAME (target) != NULL
+ && (STREQ (TYPE_NAME (target), "char")
+ || STREQ (TYPE_NAME (target), "void")))
+ children = 0;
+ else
+ children = 1;
+ }
break;
default:
@@ -1989,280 +1727,256 @@ c_number_of_children (struct varobj *var)
}
static char *
-c_name_of_variable (struct varobj *parent)
+c_name_of_variable (parent)
+ struct varobj *parent;
{
return savestring (parent->name, strlen (parent->name));
}
-/* Return the value of element TYPE_INDEX of a structure
- value VALUE. VALUE's type should be a structure,
- or union, or a typedef to struct/union.
-
- Returns NULL if getting the value fails. Never throws. */
-static struct value *
-value_struct_element_index (struct value *value, int type_index)
+static char *
+c_name_of_child (parent, index)
+ struct varobj *parent;
+ int index;
{
- struct value *result = NULL;
- volatile struct gdb_exception e;
-
- struct type *type = value_type (value);
- type = check_typedef (type);
-
- gdb_assert (TYPE_CODE (type) == TYPE_CODE_STRUCT
- || TYPE_CODE (type) == TYPE_CODE_UNION);
+ struct type *type;
+ struct type *target;
+ char *name;
+ char *string;
- TRY_CATCH (e, RETURN_MASK_ERROR)
- {
- if (TYPE_FIELD_STATIC (type, type_index))
- result = value_static_field (type, type_index);
- else
- result = value_primitive_field (value, 0, type_index, type);
- }
- if (e.reason < 0)
- {
- return NULL;
- }
- else
- {
- return result;
- }
-}
+ type = get_type (parent);
+ target = get_target_type (type);
-/* Obtain the information about child INDEX of the variable
- object PARENT.
- If CNAME is not null, sets *CNAME to the name of the child relative
- to the parent.
- If CVALUE is not null, sets *CVALUE to the value of the child.
- If CTYPE is not null, sets *CTYPE to the type of the child.
-
- If any of CNAME, CVALUE, or CTYPE is not null, but the corresponding
- information cannot be determined, set *CNAME, *CVALUE, or *CTYPE
- to NULL. */
-static void
-c_describe_child (struct varobj *parent, int index,
- char **cname, struct value **cvalue, struct type **ctype,
- char **cfull_expression)
-{
- struct value *value = parent->value;
- struct type *type = get_value_type (parent);
- char *parent_expression = NULL;
- int was_ptr;
-
- if (cname)
- *cname = NULL;
- if (cvalue)
- *cvalue = NULL;
- if (ctype)
- *ctype = NULL;
- if (cfull_expression)
- {
- *cfull_expression = NULL;
- parent_expression = varobj_get_path_expr (parent);
- }
- adjust_value_for_child_access (&value, &type, &was_ptr);
-
switch (TYPE_CODE (type))
{
case TYPE_CODE_ARRAY:
- if (cname)
- *cname = xstrprintf ("%d", index
- + TYPE_LOW_BOUND (TYPE_INDEX_TYPE (type)));
-
- if (cvalue && value)
- {
- int real_index = index + TYPE_LOW_BOUND (TYPE_INDEX_TYPE (type));
- struct value *indval =
- value_from_longest (builtin_type_int, (LONGEST) real_index);
- gdb_value_subscript (value, indval, cvalue);
- }
-
- if (ctype)
- *ctype = get_target_type (type);
-
- if (cfull_expression)
- *cfull_expression = xstrprintf ("(%s)[%d]", parent_expression,
- index
- + TYPE_LOW_BOUND (TYPE_INDEX_TYPE (type)));
-
-
+ {
+ /* We never get here unless parent->num_children is greater than 0... */
+ int len = 1;
+ while ((int) pow ((double) 10, (double) len) < index)
+ len++;
+ name = (char *) xmalloc (1 + len * sizeof (char));
+ sprintf (name, "%d", index);
+ }
break;
case TYPE_CODE_STRUCT:
case TYPE_CODE_UNION:
- if (cname)
- {
- char *string = TYPE_FIELD_NAME (type, index);
- *cname = savestring (string, strlen (string));
- }
-
- if (cvalue && value)
- {
- /* For C, varobj index is the same as type index. */
- *cvalue = value_struct_element_index (value, index);
- }
-
- if (ctype)
- *ctype = TYPE_FIELD_TYPE (type, index);
-
- if (cfull_expression)
- {
- char *join = was_ptr ? "->" : ".";
- *cfull_expression = xstrprintf ("(%s)%s%s", parent_expression, join,
- TYPE_FIELD_NAME (type, index));
- }
-
+ string = TYPE_FIELD_NAME (type, index);
+ name = savestring (string, strlen (string));
break;
case TYPE_CODE_PTR:
- if (cname)
- *cname = xstrprintf ("*%s", parent->name);
-
- if (cvalue && value)
+ switch (TYPE_CODE (target))
{
- int success = gdb_value_ind (value, cvalue);
- if (!success)
- *cvalue = NULL;
+ case TYPE_CODE_STRUCT:
+ case TYPE_CODE_UNION:
+ string = TYPE_FIELD_NAME (target, index);
+ name = savestring (string, strlen (string));
+ break;
+
+ default:
+ name = (char *) xmalloc ((strlen (parent->name) + 2) * sizeof (char));
+ sprintf (name, "*%s", parent->name);
+ break;
}
-
- /* Don't use get_target_type because it calls
- check_typedef and here, we want to show the true
- declared type of the variable. */
- if (ctype)
- *ctype = TYPE_TARGET_TYPE (type);
-
- if (cfull_expression)
- *cfull_expression = xstrprintf ("*(%s)", parent_expression);
-
break;
default:
/* This should not happen */
- if (cname)
- *cname = xstrdup ("???");
- if (cfull_expression)
- *cfull_expression = xstrdup ("???");
- /* Don't set value and type, we don't know then. */
+ name = xstrdup ("???");
}
-}
-static char *
-c_name_of_child (struct varobj *parent, int index)
-{
- char *name;
- c_describe_child (parent, index, &name, NULL, NULL, NULL);
return name;
}
-static char *
-c_path_expr_of_child (struct varobj *child)
-{
- c_describe_child (child->parent, child->index, NULL, NULL, NULL,
- &child->path_expr);
- return child->path_expr;
-}
-
-/* If frame associated with VAR can be found, switch
- to it and return 1. Otherwise, return 0. */
-static int
-check_scope (struct varobj *var)
-{
- struct frame_info *fi;
- int scope;
-
- fi = frame_find_by_id (var->root->frame);
- scope = fi != NULL;
-
- if (fi)
- {
- CORE_ADDR pc = get_frame_pc (fi);
- if (pc < BLOCK_START (var->root->valid_block) ||
- pc >= BLOCK_END (var->root->valid_block))
- scope = 0;
- else
- select_frame (fi);
- }
- return scope;
-}
-
-static struct value *
-c_value_of_root (struct varobj **var_handle)
+static value_ptr
+c_value_of_root (var)
+ struct varobj *var;
{
- struct value *new_val = NULL;
- struct varobj *var = *var_handle;
+ value_ptr new_val;
struct frame_info *fi;
- int within_scope = 0;
- struct cleanup *back_to;
-
- /* Only root variables can be updated... */
- if (!is_root_p (var))
- /* Not a root var */
- return NULL;
-
- back_to = make_cleanup_restore_current_thread ();
+ int within_scope;
/* Determine whether the variable is still around. */
- if (var->root->valid_block == NULL || var->root->floating)
+ if (var->root->valid_block == NULL)
within_scope = 1;
- else if (var->root->thread_id == 0)
- {
- /* The program was single-threaded when the variable object was
- created. Technically, it's possible that the program became
- multi-threaded since then, but we don't support such
- scenario yet. */
- within_scope = check_scope (var);
- }
else
{
- ptid_t ptid = thread_id_to_pid (var->root->thread_id);
- if (in_thread_list (ptid))
- {
- switch_to_thread (ptid);
- within_scope = check_scope (var);
- }
+ reinit_frame_cache ();
+ fi = find_frame_addr_in_frame_chain (var->root->frame);
+ within_scope = fi != NULL;
+ /* FIXME: select_frame could fail */
+ if (within_scope)
+ select_frame (fi, -1);
}
if (within_scope)
{
- /* We need to catch errors here, because if evaluate
- expression fails we want to just return NULL. */
- gdb_evaluate_expression (var->root->exp, &new_val);
+ /* We need to catch errors here, because if evaluate expression fails
+ we just want to make val->error = 1 and go on */
+ if (gdb_evaluate_expression (var->root->exp, &new_val))
+ {
+ if (VALUE_LAZY (new_val))
+ {
+ /* We need to catch errors because if value_fetch_lazy fails we
+ still want to continue (after making val->error = 1) */
+ /* FIXME: Shouldn't be using VALUE_CONTENTS? The comment on
+ value_fetch_lazy() says it is only called from the macro... */
+ if (!gdb_value_fetch_lazy (new_val))
+ var->error = 1;
+ else
+ var->error = 0;
+ }
+ }
+ else
+ var->error = 1;
+
+ release_value (new_val);
return new_val;
}
- do_cleanups (back_to);
-
return NULL;
}
-static struct value *
-c_value_of_child (struct varobj *parent, int index)
+static value_ptr
+c_value_of_child (parent, index)
+ struct varobj *parent;
+ int index;
{
- struct value *value = NULL;
- c_describe_child (parent, index, NULL, &value, NULL, NULL);
+ value_ptr value, temp;
+ struct type *type, *target;
+ char *name;
+
+ type = get_type (parent);
+ target = get_target_type (type);
+ name = name_of_child (parent, index);
+ temp = parent->value;
+ value = NULL;
+
+ if (temp != NULL)
+ {
+ switch (TYPE_CODE (type))
+ {
+ case TYPE_CODE_ARRAY:
+ value = value_slice (temp, index, 1);
+ temp = value_coerce_array (value);
+ gdb_value_ind (temp, &value);
+ break;
+
+ case TYPE_CODE_STRUCT:
+ case TYPE_CODE_UNION:
+ value = value_struct_elt (&temp, NULL, name, NULL, "vstructure");
+ break;
+
+ case TYPE_CODE_PTR:
+ switch (TYPE_CODE (target))
+ {
+ case TYPE_CODE_STRUCT:
+ case TYPE_CODE_UNION:
+ value = value_struct_elt (&temp, NULL, name, NULL, "vstructure");
+ break;
+
+ default:
+ gdb_value_ind (temp, &value);
+ break;
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ if (value != NULL)
+ release_value (value);
return value;
}
static struct type *
-c_type_of_child (struct varobj *parent, int index)
+c_type_of_child (parent, index)
+ struct varobj *parent;
+ int index;
{
- struct type *type = NULL;
- c_describe_child (parent, index, NULL, NULL, &type, NULL);
+ struct type *type;
+ char *name = name_of_child (parent, index);
+
+ switch (TYPE_CODE (parent->type))
+ {
+ case TYPE_CODE_ARRAY:
+ type = TYPE_TARGET_TYPE (parent->type);
+ break;
+
+ case TYPE_CODE_STRUCT:
+ case TYPE_CODE_UNION:
+ type = lookup_struct_elt_type (parent->type, name, 0);
+ break;
+
+ case TYPE_CODE_PTR:
+ switch (TYPE_CODE (TYPE_TARGET_TYPE (parent->type)))
+ {
+ case TYPE_CODE_STRUCT:
+ case TYPE_CODE_UNION:
+ type = lookup_struct_elt_type (parent->type, name, 0);
+ break;
+
+ default:
+ type = TYPE_TARGET_TYPE (parent->type);
+ break;
+ }
+ break;
+
+ default:
+ /* This should not happen as only the above types have children */
+ warning ("Child of parent whose type does not allow children");
+ /* FIXME: Can we still go on? */
+ type = NULL;
+ break;
+ }
+
return type;
}
+static int
+c_variable_editable (var)
+ struct varobj *var;
+{
+ switch (TYPE_CODE (get_type (var)))
+ {
+ case TYPE_CODE_STRUCT:
+ case TYPE_CODE_UNION:
+ case TYPE_CODE_ARRAY:
+ case TYPE_CODE_FUNC:
+ case TYPE_CODE_MEMBER:
+ case TYPE_CODE_METHOD:
+ return 0;
+ break;
+
+ default:
+ return 1;
+ break;
+ }
+}
+
static char *
-c_value_of_variable (struct varobj *var, enum varobj_display_formats format)
+c_value_of_variable (var)
+ struct varobj *var;
{
- /* BOGUS: if val_print sees a struct/class, or a reference to one,
- it will print out its children instead of "{...}". So we need to
- catch that case explicitly. */
- struct type *type = get_type (var);
+ struct type *type;
+ value_ptr val;
- /* Strip top-level references. */
- while (TYPE_CODE (type) == TYPE_CODE_REF)
- type = check_typedef (TYPE_TARGET_TYPE (type));
+ if (var->value != NULL)
+ val = var->value;
+ else
+ {
+ /* This can happen if we attempt to get the value of a struct
+ member when the parent is an invalid pointer. */
+ return xstrdup ("???");
+ }
+ /* BOGUS: if val_print sees a struct/class, it will print out its
+ children instead of "{...}" */
+ type = get_type (var);
switch (TYPE_CODE (type))
{
case TYPE_CODE_STRUCT:
@@ -2272,40 +1986,29 @@ c_value_of_variable (struct varobj *var, enum varobj_display_formats format)
case TYPE_CODE_ARRAY:
{
- char *number;
- number = xstrprintf ("[%d]", var->num_children);
- return (number);
+ char number[18];
+ sprintf (number, "[%d]", var->num_children);
+ return xstrdup (number);
}
/* break; */
default:
{
- if (var->value == NULL)
- {
- /* This can happen if we attempt to get the value of a struct
- member when the parent is an invalid pointer. This is an
- error condition, so we should tell the caller. */
- return NULL;
- }
- else
- {
- if (var->not_fetched && value_lazy (var->value))
- /* Frozen variable and no value yet. We don't
- implicitly fetch the value. MI response will
- use empty string for the value, which is OK. */
- return NULL;
-
- gdb_assert (varobj_value_is_changeable_p (var));
- gdb_assert (!value_lazy (var->value));
-
- /* If the specified format is the current one,
- we can reuse print_value */
- if (format == var->format)
- return xstrdup (var->print_value);
- else
- return value_get_print_value (var->value, format);
- }
+ long dummy;
+ struct ui_file *stb = mem_fileopen ();
+ struct cleanup *old_chain = make_cleanup_ui_file_delete (stb);
+ char *thevalue;
+
+ if (VALUE_LAZY (val))
+ gdb_value_fetch_lazy (val);
+ val_print (VALUE_TYPE (val), VALUE_CONTENTS_RAW (val), 0,
+ VALUE_ADDRESS (val),
+ stb, format_code[(int) var->format], 1, 0, 0);
+ thevalue = ui_file_xstrdup (stb, &dummy);
+ do_cleanups (old_chain);
+ return thevalue;
}
+ /* break; */
}
}
@@ -2313,7 +2016,8 @@ c_value_of_variable (struct varobj *var, enum varobj_display_formats format)
/* C++ */
static int
-cplus_number_of_children (struct varobj *var)
+cplus_number_of_children (var)
+ struct varobj *var;
{
struct type *type;
int children, dont_know;
@@ -2323,11 +2027,10 @@ cplus_number_of_children (struct varobj *var)
if (!CPLUS_FAKE_CHILD (var))
{
- type = get_value_type (var);
- adjust_value_for_child_access (NULL, &type, NULL);
+ type = get_type_deref (var);
if (((TYPE_CODE (type)) == TYPE_CODE_STRUCT) ||
- ((TYPE_CODE (type)) == TYPE_CODE_UNION))
+ ((TYPE_CODE (type)) == TYPE_CODE_UNION))
{
int kids[3];
@@ -2350,13 +2053,12 @@ cplus_number_of_children (struct varobj *var)
{
int kids[3];
- type = get_value_type (var->parent);
- adjust_value_for_child_access (NULL, &type, NULL);
+ type = get_type_deref (var->parent);
cplus_class_num_children (type, kids);
- if (strcmp (var->name, "public") == 0)
+ if (STREQ (var->name, "public"))
children = kids[v_public];
- else if (strcmp (var->name, "private") == 0)
+ else if (STREQ (var->name, "private"))
children = kids[v_private];
else
children = kids[v_protected];
@@ -2373,7 +2075,9 @@ cplus_number_of_children (struct varobj *var)
That means we need to descend into all baseclasses and find out
how many are there, too. */
static void
-cplus_class_num_children (struct type *type, int children[3])
+cplus_class_num_children (type, children)
+ struct type *type;
+ int children[3];
{
int i;
@@ -2384,7 +2088,8 @@ cplus_class_num_children (struct type *type, int children[3])
for (i = TYPE_N_BASECLASSES (type); i < TYPE_NFIELDS (type); i++)
{
/* If we have a virtual table pointer, omit it. */
- if (TYPE_VPTR_BASETYPE (type) == type && TYPE_VPTR_FIELDNO (type) == i)
+ if (TYPE_VPTR_BASETYPE (type) == type
+ && TYPE_VPTR_FIELDNO (type) == i)
continue;
if (TYPE_FIELD_PROTECTED (type, i))
@@ -2397,239 +2102,209 @@ cplus_class_num_children (struct type *type, int children[3])
}
static char *
-cplus_name_of_variable (struct varobj *parent)
+cplus_name_of_variable (parent)
+ struct varobj *parent;
{
return c_name_of_variable (parent);
}
-enum accessibility { private_field, protected_field, public_field };
-
-/* Check if field INDEX of TYPE has the specified accessibility.
- Return 0 if so and 1 otherwise. */
-static int
-match_accessibility (struct type *type, int index, enum accessibility acc)
-{
- if (acc == private_field && TYPE_FIELD_PRIVATE (type, index))
- return 1;
- else if (acc == protected_field && TYPE_FIELD_PROTECTED (type, index))
- return 1;
- else if (acc == public_field && !TYPE_FIELD_PRIVATE (type, index)
- && !TYPE_FIELD_PROTECTED (type, index))
- return 1;
- else
- return 0;
-}
-
-static void
-cplus_describe_child (struct varobj *parent, int index,
- char **cname, struct value **cvalue, struct type **ctype,
- char **cfull_expression)
+static char *
+cplus_name_of_child (parent, index)
+ struct varobj *parent;
+ int index;
{
- char *name = NULL;
- struct value *value;
+ char *name;
struct type *type;
- int was_ptr;
- char *parent_expression = NULL;
-
- if (cname)
- *cname = NULL;
- if (cvalue)
- *cvalue = NULL;
- if (ctype)
- *ctype = NULL;
- if (cfull_expression)
- *cfull_expression = NULL;
+ int children[3];
if (CPLUS_FAKE_CHILD (parent))
{
- value = parent->parent->value;
- type = get_value_type (parent->parent);
- if (cfull_expression)
- parent_expression = varobj_get_path_expr (parent->parent);
+ /* Looking for children of public, private, or protected. */
+ type = get_type_deref (parent->parent);
}
else
- {
- value = parent->value;
- type = get_value_type (parent);
- if (cfull_expression)
- parent_expression = varobj_get_path_expr (parent);
- }
+ type = get_type_deref (parent);
- adjust_value_for_child_access (&value, &type, &was_ptr);
-
- if (TYPE_CODE (type) == TYPE_CODE_STRUCT
- || TYPE_CODE (type) == TYPE_CODE_UNION)
+ name = NULL;
+ switch (TYPE_CODE (type))
{
- char *join = was_ptr ? "->" : ".";
+ case TYPE_CODE_STRUCT:
+ case TYPE_CODE_UNION:
+ cplus_class_num_children (type, children);
+
if (CPLUS_FAKE_CHILD (parent))
{
- /* The fields of the class type are ordered as they
- appear in the class. We are given an index for a
- particular access control type ("public","protected",
- or "private"). We must skip over fields that don't
- have the access control we are looking for to properly
- find the indexed field. */
- int type_index = TYPE_N_BASECLASSES (type);
- enum accessibility acc = public_field;
- if (strcmp (parent->name, "private") == 0)
- acc = private_field;
- else if (strcmp (parent->name, "protected") == 0)
- acc = protected_field;
-
- while (index >= 0)
- {
- if (TYPE_VPTR_BASETYPE (type) == type
- && type_index == TYPE_VPTR_FIELDNO (type))
- ; /* ignore vptr */
- else if (match_accessibility (type, type_index, acc))
- --index;
- ++type_index;
- }
- --type_index;
-
- if (cname)
- *cname = xstrdup (TYPE_FIELD_NAME (type, type_index));
-
- if (cvalue && value)
- *cvalue = value_struct_element_index (value, type_index);
-
- if (ctype)
- *ctype = TYPE_FIELD_TYPE (type, type_index);
-
- if (cfull_expression)
- *cfull_expression = xstrprintf ("((%s)%s%s)", parent_expression,
- join,
- TYPE_FIELD_NAME (type, type_index));
+ /* FIXME: This assumes that type orders
+ inherited, public, private, protected */
+ int i = index + TYPE_N_BASECLASSES (type);
+ if (STREQ (parent->name, "private") || STREQ (parent->name, "protected"))
+ i += children[v_public];
+ if (STREQ (parent->name, "protected"))
+ i += children[v_private];
+
+ name = TYPE_FIELD_NAME (type, i);
}
else if (index < TYPE_N_BASECLASSES (type))
- {
- /* This is a baseclass. */
- if (cname)
- *cname = xstrdup (TYPE_FIELD_NAME (type, index));
-
- if (cvalue && value)
- {
- *cvalue = value_cast (TYPE_FIELD_TYPE (type, index), value);
- release_value (*cvalue);
- }
-
- if (ctype)
- {
- *ctype = TYPE_FIELD_TYPE (type, index);
- }
-
- if (cfull_expression)
- {
- char *ptr = was_ptr ? "*" : "";
- /* Cast the parent to the base' type. Note that in gdb,
- expression like
- (Base1)d
- will create an lvalue, for all appearences, so we don't
- need to use more fancy:
- *(Base1*)(&d)
- construct. */
- *cfull_expression = xstrprintf ("(%s(%s%s) %s)",
- ptr,
- TYPE_FIELD_NAME (type, index),
- ptr,
- parent_expression);
- }
- }
+ name = TYPE_FIELD_NAME (type, index);
else
{
- char *access = NULL;
- int children[3];
- cplus_class_num_children (type, children);
-
/* Everything beyond the baseclasses can
- only be "public", "private", or "protected"
-
- The special "fake" children are always output by varobj in
- this order. So if INDEX == 2, it MUST be "protected". */
+ only be "public", "private", or "protected" */
index -= TYPE_N_BASECLASSES (type);
switch (index)
{
case 0:
- if (children[v_public] > 0)
- access = "public";
- else if (children[v_private] > 0)
- access = "private";
- else
- access = "protected";
- break;
+ if (children[v_public] != 0)
+ {
+ name = "public";
+ break;
+ }
case 1:
- if (children[v_public] > 0)
+ if (children[v_private] != 0)
{
- if (children[v_private] > 0)
- access = "private";
- else
- access = "protected";
+ name = "private";
+ break;
}
- else if (children[v_private] > 0)
- access = "protected";
- break;
case 2:
- /* Must be protected */
- access = "protected";
- break;
+ if (children[v_protected] != 0)
+ {
+ name = "protected";
+ break;
+ }
default:
/* error! */
break;
}
-
- gdb_assert (access);
- if (cname)
- *cname = xstrdup (access);
-
- /* Value and type and full expression are null here. */
}
+ break;
+
+ default:
+ break;
}
+
+ if (name == NULL)
+ return c_name_of_child (parent, index);
else
{
- c_describe_child (parent, index, cname, cvalue, ctype, cfull_expression);
- }
-}
+ if (name != NULL)
+ name = savestring (name, strlen (name));
+ }
-static char *
-cplus_name_of_child (struct varobj *parent, int index)
-{
- char *name = NULL;
- cplus_describe_child (parent, index, &name, NULL, NULL, NULL);
return name;
}
-static char *
-cplus_path_expr_of_child (struct varobj *child)
+static value_ptr
+cplus_value_of_root (var)
+ struct varobj *var;
{
- cplus_describe_child (child->parent, child->index, NULL, NULL, NULL,
- &child->path_expr);
- return child->path_expr;
+ return c_value_of_root (var);
}
-static struct value *
-cplus_value_of_root (struct varobj **var_handle)
+static value_ptr
+cplus_value_of_child (parent, index)
+ struct varobj *parent;
+ int index;
{
- return c_value_of_root (var_handle);
-}
+ struct type *type;
+ value_ptr value;
+ char *name;
+
+ if (CPLUS_FAKE_CHILD (parent))
+ type = get_type_deref (parent->parent);
+ else
+ type = get_type_deref (parent);
+
+ value = NULL;
+ name = name_of_child (parent, index);
+
+ if (((TYPE_CODE (type)) == TYPE_CODE_STRUCT) ||
+ ((TYPE_CODE (type)) == TYPE_CODE_UNION))
+ {
+ if (CPLUS_FAKE_CHILD (parent))
+ {
+ value_ptr temp = parent->parent->value;
+ value = value_struct_elt (&temp, NULL, name,
+ NULL, "cplus_structure");
+ release_value (value);
+ }
+ else if (index >= TYPE_N_BASECLASSES (type))
+ {
+ /* public, private, or protected */
+ return NULL;
+ }
+ else
+ {
+ /* Baseclass */
+ if (parent->value != NULL)
+ {
+ value_ptr temp;
+
+ if (TYPE_CODE (VALUE_TYPE (parent->value)) == TYPE_CODE_PTR
+ || TYPE_CODE (VALUE_TYPE (parent->value)) == TYPE_CODE_REF)
+ gdb_value_ind (parent->value, &temp);
+ else
+ temp = parent->value;
+
+ value = value_cast (TYPE_FIELD_TYPE (type, index), temp);
+ release_value (value);
+ }
+ }
+ }
+
+ if (value == NULL)
+ return c_value_of_child (parent, index);
-static struct value *
-cplus_value_of_child (struct varobj *parent, int index)
-{
- struct value *value = NULL;
- cplus_describe_child (parent, index, NULL, &value, NULL, NULL);
return value;
}
static struct type *
-cplus_type_of_child (struct varobj *parent, int index)
+cplus_type_of_child (parent, index)
+ struct varobj *parent;
+ int index;
{
- struct type *type = NULL;
- cplus_describe_child (parent, index, NULL, NULL, &type, NULL);
+ struct type *type, *t;
+
+ t = get_type_deref (parent);
+ type = NULL;
+ switch (TYPE_CODE (t))
+ {
+ case TYPE_CODE_STRUCT:
+ case TYPE_CODE_UNION:
+ if (index >= TYPE_N_BASECLASSES (t))
+ {
+ /* special */
+ return NULL;
+ }
+ else
+ {
+ /* Baseclass */
+ type = TYPE_FIELD_TYPE (t, index);
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ if (type == NULL)
+ return c_type_of_child (parent, index);
+
return type;
}
+static int
+cplus_variable_editable (var)
+ struct varobj *var;
+{
+ if (CPLUS_FAKE_CHILD (var))
+ return 0;
+
+ return c_variable_editable (var);
+}
+
static char *
-cplus_value_of_variable (struct varobj *var, enum varobj_display_formats format)
+cplus_value_of_variable (var)
+ struct varobj *var;
{
/* If we have one of our special types, don't print out
@@ -2637,19 +2312,21 @@ cplus_value_of_variable (struct varobj *var, enum varobj_display_formats format)
if (CPLUS_FAKE_CHILD (var))
return xstrdup ("");
- return c_value_of_variable (var, format);
+ return c_value_of_variable (var);
}
/* Java */
static int
-java_number_of_children (struct varobj *var)
+java_number_of_children (var)
+ struct varobj *var;
{
return cplus_number_of_children (var);
}
static char *
-java_name_of_variable (struct varobj *parent)
+java_name_of_variable (parent)
+ struct varobj *parent;
{
char *p, *name;
@@ -2669,7 +2346,9 @@ java_name_of_variable (struct varobj *parent)
}
static char *
-java_name_of_child (struct varobj *parent, int index)
+java_name_of_child (parent, index)
+ struct varobj *parent;
+ int index;
{
char *name, *p;
@@ -2687,34 +2366,41 @@ java_name_of_child (struct varobj *parent, int index)
return name;
}
-static char *
-java_path_expr_of_child (struct varobj *child)
-{
- return NULL;
-}
-
-static struct value *
-java_value_of_root (struct varobj **var_handle)
+static value_ptr
+java_value_of_root (var)
+ struct varobj *var;
{
- return cplus_value_of_root (var_handle);
+ return cplus_value_of_root (var);
}
-static struct value *
-java_value_of_child (struct varobj *parent, int index)
+static value_ptr
+java_value_of_child (parent, index)
+ struct varobj *parent;
+ int index;
{
return cplus_value_of_child (parent, index);
}
static struct type *
-java_type_of_child (struct varobj *parent, int index)
+java_type_of_child (parent, index)
+ struct varobj *parent;
+ int index;
{
return cplus_type_of_child (parent, index);
}
+static int
+java_variable_editable (var)
+ struct varobj *var;
+{
+ return cplus_variable_editable (var);
+}
+
static char *
-java_value_of_variable (struct varobj *var, enum varobj_display_formats format)
+java_value_of_variable (var)
+ struct varobj *var;
{
- return cplus_value_of_variable (var, format);
+ return cplus_value_of_variable (var);
}
extern void _initialize_varobj (void);
@@ -2726,58 +2412,10 @@ _initialize_varobj (void)
varobj_table = xmalloc (sizeof_table);
memset (varobj_table, 0, sizeof_table);
- add_setshow_zinteger_cmd ("debugvarobj", class_maintenance,
- &varobjdebug, _("\
-Set varobj debugging."), _("\
-Show varobj debugging."), _("\
-When non-zero, varobj debugging is enabled."),
- NULL,
- show_varobjdebug,
- &setlist, &showlist);
-}
-
-/* Invalidate the varobjs that are tied to locals and re-create the ones that
- are defined on globals.
- Invalidated varobjs will be always printed in_scope="invalid". */
-void
-varobj_invalidate (void)
-{
- struct varobj **all_rootvarobj;
- struct varobj **varp;
-
- if (varobj_list (&all_rootvarobj) > 0)
- {
- varp = all_rootvarobj;
- while (*varp != NULL)
- {
- /* Floating varobjs are reparsed on each stop, so we don't care if
- the presently parsed expression refers to something that's gone. */
- if ((*varp)->root->floating)
- continue;
-
- /* global var must be re-evaluated. */
- if ((*varp)->root->valid_block == NULL)
- {
- struct varobj *tmp_var;
-
- /* Try to create a varobj with same expression. If we succeed replace
- the old varobj, otherwise invalidate it. */
- tmp_var = varobj_create (NULL, (*varp)->name, (CORE_ADDR) 0, USE_CURRENT_FRAME);
- if (tmp_var != NULL)
- {
- tmp_var->obj_name = xstrdup ((*varp)->obj_name);
- varobj_delete (*varp, NULL, 0);
- install_variable (tmp_var);
- }
- else
- (*varp)->root->is_valid = 0;
- }
- else /* locals must be invalidated. */
- (*varp)->root->is_valid = 0;
-
- varp++;
- }
- xfree (all_rootvarobj);
- }
- return;
+ add_show_from_set (
+ add_set_cmd ("debugvarobj", class_maintenance, var_zinteger,
+ (char *) &varobjdebug,
+ "Set varobj debugging.\n\
+When non-zero, varobj debugging is enabled.", &setlist),
+ &showlist);
}
diff --git a/gdb/varobj.h b/gdb/varobj.h
index 9ecef0f21cc..28c5fac4d16 100644
--- a/gdb/varobj.h
+++ b/gdb/varobj.h
@@ -1,10 +1,9 @@
/* GDB variable objects API.
- Copyright (C) 1999, 2000, 2001, 2005, 2007, 2008
- Free Software Foundation, Inc.
+ Copyright 1999 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
+ the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@@ -13,14 +12,15 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
#ifndef VAROBJ_H
#define VAROBJ_H 1
#include "symtab.h"
#include "gdbtypes.h"
-#include "vec.h"
/* Enumeration for the format types */
enum varobj_display_formats
@@ -32,23 +32,6 @@ enum varobj_display_formats
FORMAT_OCTAL /* Octal display */
};
-enum varobj_type
- {
- USE_SPECIFIED_FRAME, /* Use the frame passed to varobj_create */
- USE_CURRENT_FRAME, /* Use the current frame */
- USE_SELECTED_FRAME /* Always reevaluate in selected frame */
- };
-
-/* Enumerator describing if a variable object is in scope. */
-enum varobj_scope_status
- {
- VAROBJ_IN_SCOPE = 0, /* Varobj is scope, value available. */
- VAROBJ_NOT_IN_SCOPE = 1, /* Varobj is not in scope, value not available,
- but varobj can become in scope later. */
- VAROBJ_INVALID = 2, /* Varobj no longer has any value, and never
- will. */
- };
-
/* String representations of gdb's format codes (defined in varobj.c) */
extern char *varobj_format_string[];
@@ -64,24 +47,10 @@ extern char *varobj_language_string[];
/* Struct thar describes a variable object instance */
struct varobj;
-typedef struct varobj *varobj_p;
-DEF_VEC_P (varobj_p);
-
-typedef struct varobj_update_result_t
-{
- struct varobj *varobj;
- int type_changed;
- int changed;
- enum varobj_scope_status status;
-} varobj_update_result;
-
-DEF_VEC_O (varobj_update_result);
-
/* API functions */
extern struct varobj *varobj_create (char *objname,
- char *expression, CORE_ADDR frame,
- enum varobj_type type);
+ char *expression, CORE_ADDR frame);
extern char *varobj_gen_name (void);
@@ -101,44 +70,23 @@ extern enum varobj_display_formats varobj_set_display_format (
extern enum varobj_display_formats varobj_get_display_format (
struct varobj *var);
-extern int varobj_get_thread_id (struct varobj *var);
-
-extern void varobj_set_frozen (struct varobj *var, int frozen);
-
-extern int varobj_get_frozen (struct varobj *var);
-
extern int varobj_get_num_children (struct varobj *var);
-/* Return the list of children of VAR. The returned vector
- should not be modified in any way. */
-extern VEC (varobj_p)* varobj_list_children (struct varobj *var);
+extern int varobj_list_children (struct varobj *var,
+ struct varobj ***childlist);
extern char *varobj_get_type (struct varobj *var);
-extern struct type *varobj_get_gdb_type (struct varobj *var);
-
-extern char *varobj_get_path_expr (struct varobj *var);
-
extern enum varobj_languages varobj_get_language (struct varobj *var);
extern int varobj_get_attributes (struct varobj *var);
-extern char *varobj_get_formatted_value (struct varobj *var,
- enum varobj_display_formats format);
-
extern char *varobj_get_value (struct varobj *var);
extern int varobj_set_value (struct varobj *var, char *expression);
extern int varobj_list (struct varobj ***rootlist);
-extern VEC(varobj_update_result) *varobj_update (struct varobj **varp,
- int explicit);
-
-extern void varobj_invalidate (void);
-
-extern int varobj_editable_p (struct varobj *var);
-
-extern int varobj_floating_p (struct varobj *var);
+extern int varobj_update (struct varobj *var, struct varobj ***changelist);
#endif /* VAROBJ_H */
diff --git a/gdb/wrapper.c b/gdb/wrapper.c
index 1cbfdbc88f6..be7d4e27391 100644
--- a/gdb/wrapper.c
+++ b/gdb/wrapper.c
@@ -1,10 +1,9 @@
-/* Longjump free calls to GDB internal routines.
-
- Copyright (C) 1999, 2000, 2005, 2007, 2008 Free Software Foundation, Inc.
+/* Longjump free calls to gdb internal routines.
+ Copyright 1999 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
+ the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@@ -13,150 +12,154 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
#include "defs.h"
#include "value.h"
-#include "exceptions.h"
+#include "frame.h"
#include "wrapper.h"
-#include "ui-out.h"
-int
-gdb_parse_exp_1 (char **stringptr, struct block *block, int comma,
- struct expression **expression)
-{
- volatile struct gdb_exception except;
+/* Use this struct used to pass arguments to wrapper routines. We assume
+ (arbitrarily) that no gdb function takes more than ten arguments. */
+struct gdb_wrapper_arguments
+ {
- TRY_CATCH (except, RETURN_MASK_ERROR)
- {
- *expression = parse_exp_1 (stringptr, block, comma);
- }
+ /* Pointer to some result from the gdb function call, if any */
+ char *result;
- if (except.reason < 0)
- return 0;
- return 1;
-}
+ /* The list of arguments. */
+ char *args[10];
+ };
+
+int gdb_evaluate_expression PARAMS ((struct expression *, value_ptr *));
+int wrap_evaluate_expression PARAMS ((char *));
+
+int gdb_value_fetch_lazy PARAMS ((value_ptr));
+int wrap_value_fetch_lazy PARAMS ((char *));
+
+int gdb_value_equal PARAMS ((value_ptr, value_ptr, int *));
+int wrap_value_equal PARAMS ((char *));
+
+int gdb_value_ind PARAMS ((value_ptr val, value_ptr * rval));
+int wrap_value_ind PARAMS ((char *opaque_arg));
int
-gdb_evaluate_expression (struct expression *exp, struct value **value)
+gdb_evaluate_expression (exp, value)
+ struct expression *exp;
+ value_ptr *value;
{
- volatile struct gdb_exception except;
+ struct gdb_wrapper_arguments args;
+ args.args[0] = (char *) exp;
- TRY_CATCH (except, RETURN_MASK_ERROR)
+ if (!catch_errors ((catch_errors_ftype *) wrap_evaluate_expression, &args,
+ "", RETURN_MASK_ERROR))
{
- *value = evaluate_expression(exp);
+ /* An error occurred */
+ return 0;
}
- if (except.reason < 0)
- return 0;
+ *value = (value_ptr) args.result;
return 1;
}
int
-gdb_value_fetch_lazy (struct value *val)
+wrap_evaluate_expression (a)
+ char *a;
{
- volatile struct gdb_exception except;
+ struct gdb_wrapper_arguments *args = (struct gdb_wrapper_arguments *) a;
- TRY_CATCH (except, RETURN_MASK_ERROR)
- {
- value_fetch_lazy (val);
- }
-
- if (except.reason < 0)
- return 0;
+ (args)->result =
+ (char *) evaluate_expression ((struct expression *) (args)->args[0]);
return 1;
}
int
-gdb_value_equal (struct value *val1, struct value *val2, int *result)
+gdb_value_fetch_lazy (value)
+ value_ptr value;
{
- volatile struct gdb_exception except;
-
- TRY_CATCH (except, RETURN_MASK_ERROR)
- {
- *result = value_equal (val1, val2);
- }
+ struct gdb_wrapper_arguments args;
- if (except.reason < 0)
- return 0;
- return 1;
+ args.args[0] = (char *) value;
+ return catch_errors ((catch_errors_ftype *) wrap_value_fetch_lazy, &args,
+ "", RETURN_MASK_ERROR);
}
int
-gdb_value_assign (struct value *val1, struct value *val2,
- struct value **result)
+wrap_value_fetch_lazy (a)
+ char *a;
{
- volatile struct gdb_exception except;
-
- TRY_CATCH (except, RETURN_MASK_ERROR)
- {
- *result = value_assign (val1, val2);
- }
+ struct gdb_wrapper_arguments *args = (struct gdb_wrapper_arguments *) a;
- if (except.reason < 0)
- return 0;
+ value_fetch_lazy ((value_ptr) (args)->args[0]);
return 1;
}
int
-gdb_value_subscript (struct value *val1, struct value *val2,
- struct value **result)
+gdb_value_equal (val1, val2, result)
+ value_ptr val1;
+ value_ptr val2;
+ int *result;
{
- volatile struct gdb_exception except;
+ struct gdb_wrapper_arguments args;
- TRY_CATCH (except, RETURN_MASK_ERROR)
+ args.args[0] = (char *) val1;
+ args.args[1] = (char *) val2;
+
+ if (!catch_errors ((catch_errors_ftype *) wrap_value_equal, &args,
+ "", RETURN_MASK_ERROR))
{
- *result = value_subscript (val1, val2);
+ /* An error occurred */
+ return 0;
}
- if (except.reason < 0)
- return 0;
+ *result = (int) args.result;
return 1;
}
int
-gdb_value_ind (struct value *val, struct value **result)
+wrap_value_equal (a)
+ char *a;
{
- volatile struct gdb_exception except;
+ struct gdb_wrapper_arguments *args = (struct gdb_wrapper_arguments *) a;
+ value_ptr val1, val2;
- TRY_CATCH (except, RETURN_MASK_ERROR)
- {
- *result = value_ind (val);
- }
+ val1 = (value_ptr) (args)->args[0];
+ val2 = (value_ptr) (args)->args[1];
- if (except.reason < 0)
- return 0;
+ (args)->result = (char *) value_equal (val1, val2);
return 1;
}
int
-gdb_parse_and_eval_type (char *p, int length, struct type **type)
+gdb_value_ind (val, rval)
+ value_ptr val;
+ value_ptr *rval;
{
- volatile struct gdb_exception except;
+ struct gdb_wrapper_arguments args;
+
+ args.args[0] = (char *) val;
- TRY_CATCH (except, RETURN_MASK_ERROR)
+ if (!catch_errors ((catch_errors_ftype *) wrap_value_ind, &args,
+ "", RETURN_MASK_ERROR))
{
- *type = parse_and_eval_type (p, length);
+ /* An error occurred */
+ return 0;
}
- if (except.reason < 0)
- return 0;
+ *rval = (value_ptr) args.result;
return 1;
}
-enum gdb_rc
-gdb_value_struct_elt (struct ui_out *uiout, struct value **result,
- struct value **argp, struct value **args, char *name,
- int *static_memfuncp, char *err)
+int
+wrap_value_ind (opaque_arg)
+ char *opaque_arg;
{
- volatile struct gdb_exception except;
+ struct gdb_wrapper_arguments *args = (struct gdb_wrapper_arguments *) opaque_arg;
+ value_ptr val;
- TRY_CATCH (except, RETURN_MASK_ERROR)
- {
- *result = value_struct_elt (argp, args, name, static_memfuncp, err);
- }
-
- if (except.reason < 0)
- return GDB_RC_FAIL;
- return GDB_RC_OK;
+ val = (value_ptr) (args)->args[0];
+ (args)->result = (char *) value_ind (val);
+ return 1;
}
diff --git a/gdb/wrapper.h b/gdb/wrapper.h
index 670918f0b1f..f4303b2264b 100644
--- a/gdb/wrapper.h
+++ b/gdb/wrapper.h
@@ -1,10 +1,9 @@
-/* Longjump free calls to GDB internal routines.
-
- Copyright (C) 1999, 2000, 2005, 2007, 2008 Free Software Foundation, Inc.
+/* Longjump free calls to gdb internal routines.
+ Copyright 1999 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
+ the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@@ -13,39 +12,26 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
#ifndef WRAPPER_H
#define WRAPPER_H 1
-#include "gdb.h"
-
-struct value;
-struct expression;
-struct block;
-
-extern int gdb_parse_exp_1 (char **, struct block *,
- int, struct expression **);
-
-extern int gdb_evaluate_expression (struct expression *, struct value **);
-
-extern int gdb_value_fetch_lazy (struct value *);
-
-extern int gdb_value_equal (struct value *, struct value *, int *);
-
-extern int gdb_value_assign (struct value *, struct value *, struct value **);
+/* Use this struct used to pass arguments to wrapper routines. */
+struct gdb_wrapper_arguments;
-extern int gdb_value_subscript (struct value *, struct value *,
- struct value **);
+extern int gdb_evaluate_expression PARAMS ((struct expression *, value_ptr *));
+extern int wrap_evaluate_expression PARAMS ((char *));
-extern enum gdb_rc gdb_value_struct_elt (struct ui_out *uiout,
- struct value **result_ptr,
- struct value **argp,
- struct value **args, char *name,
- int *static_memfuncp, char *err);
+extern int gdb_value_fetch_lazy PARAMS ((value_ptr));
+extern int wrap_value_fetch_lazy PARAMS ((char *));
-extern int gdb_value_ind (struct value *val, struct value ** rval);
+extern int gdb_value_equal PARAMS ((value_ptr, value_ptr, int *));
+extern int wrap_value_equal PARAMS ((char *));
-extern int gdb_parse_and_eval_type (char *, int, struct type **);
+extern int gdb_value_ind PARAMS ((value_ptr val, value_ptr * rval));
+extern int wrap_value_ind PARAMS ((char *opaque_arg));
-#endif /* wrapper.h */
+#endif /* WRAPPER_H */