Commit Graph

101 Commits

Author SHA1 Message Date
Doug Evans 3f7b2faa4b Add -s option to source command.
* NEWS: Document new option.
	* cli/cli-cmds.c (find_and_open_script): Add function comment.
	Delete from_tty and cleanupp args.  Split filep arg into file and
	full_pathp.  New arg search_path.
	(source_script_from_stream): New function.
	(source_script_with_search): New function.
	(source_script): Rewrite.
	(source_command): Parse "-s" option.
	(init_cli_cmds): Add "-s" docs to source command help, and reformat.
	* python/python.c (source_python_script): Make file arg a const char *.
	Don't call fclose, leave for caller.
	* python/python.h (source_python_script): Update.

	testsuite/
	* gdb.base/source-test.gdb: New file.
	* gdb.base/source.exp: Add tests for "source -s".

	doc/
	* gdb.texinfo (Command Files): Add docs for new "source -s" option.
2010-04-15 17:45:57 +00:00
Stan Shebs 33da3f1cb5 2010-04-08 Stan Shebs <stan@codesourcery.com>
Pedro Alves  <pedro@codesourcery.com>

	* tracepoint.h (struct trace_status): New fields disconnected_tracing
	and circular_buffer.
	(disconnect_tracing): Rename from disconnect_or_stop_tracing.
	* tracepoint.c (trace_status_command): Display target's status for
	disconnected tracing and circular buffer.
	(disconnect_tracing): Rename from disconnect_or_stop_tracing, add
	query for non-disconnected-tracing case, remove the stop_tracing
	call.
	(tfile_open): Clear disconnected and circular buffer status.
	(trace_save): Save disconnected and circular buffer status.
	(parse_trace_status): Parse disconnected and circular buffer status,
	also recognize disconnected as a stop reason.
	* remote.c (remote_set_disconnected_tracing): Only set
	QTDisconnected if the remote end supports disconnected tracing.
	Warn otherwise, if trying to enable disconnected tracing.
	* infcmd.c (detach_command): Update disconnect_tracing call.
	* cli/cli-cmds.c (quit_command): Ditto.

	* gdb.texinfo (Tracepoint Packets): Describe disconn and circular
	trace status fields.
2010-04-09 03:00:58 +00:00
Doug Evans 96e398662d * cli/cli-cmds.c (source_command): Run cleanups.
testsuite/
	* gdb.base/source-test.gdb: New file.
	* gdb.base/source.exp: Test source -v.
2010-04-07 03:42:55 +00:00
Tom Tromey f870a310ee gdb
2010-03-05  Corinna Vinschen  <vinschen@redhat.com>
	    Tom Tromey  <tromey@redhat.com>

	* utils.c (host_char_to_target): Add 'gdbarch' argument.
	(parse_escape): Likewise.
	* python/py-utils.c (unicode_to_target_string): Update.
	(unicode_to_target_python_string): Update.
	(target_string_to_unicode): Update.
	* printcmd.c (printf_command): Update.
	* p-exp.y (yylex): Update.
	* objc-exp.y (yylex): Update.
	* mi/mi-parse.c: Include charset.h.
	(mi_parse_escape): New function.
	(mi_parse_argv): Use it.
	* jv-exp.y (yylex): Update.
	* i386-cygwin-tdep.c (i386_cygwin_auto_wide_charset): New
	function.
	(i386_cygwin_init_abi): Call set_gdbarch_auto_wide_charset.
	* gdbarch.sh (auto_charset, auto_wide_charset): New.
	* gdbarch.c: Rebuild.
	* gdbarch.h: Rebuild.
	* defs.h (parse_escape): Update.
	* cli/cli-setshow.c: Include arch-utils.h.
	(do_setshow_command): Update.
	* cli/cli-cmds.c (echo_command): Update.
	* charset.h (target_charset, target_wide_charset): Update.
	* charset.c: Include arch-utils.h.
	(target_charset_name): Default to "auto".
	(target_wide_charset_name): Likewise.
	(show_target_charset_name): Handle "auto".
	(show_target_wide_charset_name): Likewise.
	(be_le_arch): New global.
	(set_be_le_names): Add 'gdbarch' argument.
	(validate): Likewise.  Don't call set_be_le_names.
	(set_charset_sfunc, set_host_charset_sfunc)
	(set_target_charset_sfunc, set_target_wide_charset_sfunc):
	Update.
	(target_charset): Add 'gdbarch' argument.
	(target_wide_charset): Likewise.  Remove 'byte_order' argument.
	(auto_target_charset_name): New global.
	(default_auto_charset, default_auto_wide_charset): New functions.
	(_initialize_charset): Set auto_target_charset_name.  Allow "auto"
	for target charsets.  Copy result of nl_langinfo.  Use GetACP if
	USE_WIN32API.
	* c-lang.c (charset_for_string_type): Add 'gdbarch' argument,
	remove 'byte_order' argument.  Update.
	(classify_type): Likewise.
	(c_emit_char): Update.
	(c_printchar): Update.
	(c_printstr): Update.
	(c_get_string): Update.
	(evaluate_subexp_c): Update.
	* arch-utils.h (default_auto_charset, default_auto_wide_charset):
	Declare.
	* python/python.c (gdbpy_target_charset): New function.
	(gdbpy_target_wide_charset): Likewise.
	(GdbMethods): Update.
	* NEWS: Update.
gdb/doc
	* gdb.texinfo (Basic Python): Document target_charset and
	target_wide_charset.
gdb/testsuite
	* gdb.python/py-prettyprint.py (pp_nullstr.to_string): Use
	gdb.target_charset.
	(pp_ns.to_string): Likewise.
2010-03-05 20:18:19 +00:00
Joel Brobecker 973817a313 Allow "source" to load python scripts.
* exceptions.h (enum errors): Add UNSUPPORTED_ERROR.
        * python/python.c (source_python_script): New function.
        * python/python.h (source_python_script): Add declaration.
        * cli/cli-cmds.c: #include exceptions.h and python/python.h.
        (script_ext_off, script_ext_soft, script_ext_strict)
        (script_ext_enums, script_ext_mode): New static constants.
        (show_script_ext_mode, find_and_open_script): New functions.
        (source_script): Enhance to handle Python scripts.
        (init_cli_cmds): Add set/show script-extension commands.
2010-01-18 06:25:22 +00:00
Stan Shebs d5551862df Support disconnected tracing.
* infcmd.c (detach_command): Ask whether to stop tracing.
	* cli/cli-cmds.c (quit_command): Ditto.
	* breakpoint.h (struct breakpoint): New field number_on_target.
	* breakpoint.c (create_tracepoint_from_upload): New function.
	(get_tracepoint_by_number_on_target): New function.
	* remote.c (struct remote): New field disconnected_tracing.
	(remote_disconnected_tracing_feature): New function.
	(remote_protocol_features): Add DisconnectedTracing.
	(struct uploaded_tp): New struct.
	(uploaded_tps): New global.
	(get_uploaded_tp): New function.
	(find_matching_tracepoint): New function.
	(remote_get_tracing_state): New function.
	(remote_start_remote): Call it.
	* tracepoint.c (disconnected_tracing): New global.
	(trace_start_command): Initialize number_on_target.
	(stop_tracing): New function, split out from...
	(trace_stop_command): Call stop_tracing.
	(get_trace_status): New function, split out from...
	(trace_status_command): Call get_trace_status, add info on
	disconnection behavior.
	(disconnect_or_stop_tracing): New function.
	(finish_tfind_command): Translate from number on target.
	(trace_find_tracepoint_command): Translate to number on target.
	(send_disconnected_tracing_value): New function.
	(set_disconnected_tracing): New function.
	(_initialize_tracepoint): Add disconnected-tracing variable.
	* NEWS: Mention disconnected tracing.

	* gdb.texinfo (Starting and Stopping Trace Experiments): Document
	disconnected tracing.
	(Tracepoint Packets): Document new protocol.
2010-01-06 20:31:28 +00:00
Joel Brobecker 4c38e0a4fc Update copyright year in most headers.
Automatic update by copyright.sh.
2010-01-01 07:32:07 +00:00
Paul Pluzhnikov 21a0512e53 gdb/ChangeLog:
2009-11-23  Paul Pluzhnikov  <ppluzhnikov@google.com>

	* cli/cli-cmds.c (disassemble_command): Split on comma.
	(init_cli_cmds): Update help.
	* NEWS: Mention incompatible change to 'disassemble'.

gdb/testsuite/ChangeLog:

2009-11-23  Paul Pluzhnikov  <ppluzhnikov@google.com>

	* gdb.asm/asm-source.exp: Adjust.
	* gdb.base/help.exp: Adjust.

gdb/doc/ChangeLog:

2009-11-23  Paul Pluzhnikov  <ppluzhnikov@google.com>

	* gdb.texinfo (Machine Code): Adjust.
2009-11-23 18:44:11 +00:00
Paul Pluzhnikov 9c4191458a 2009-10-22 Paul Pluzhnikov <ppluzhnikov@google.com>
* disasm.h (DISASSEMBLY_OMIT_FNAME) New define.
	(gdb_disassembly): Correct parameter name.
	* disasm.c (dump_insns): Adjust.
	(gdb_disassembly): Fix indentation.
	* cli/cli-cmds.c (disassemble_command): Adjust.

doc/ChangeLog:

2009-10-22  Paul Pluzhnikov  <ppluzhnikov@google.com>

	* gdb.texinfo (Machine Code): Mention function name in disasssembly
	and adjust example.

testsuite/ChangeLog:

2009-10-22  Paul Pluzhnikov  <ppluzhnikov@google.com>

	* gdb.asm/asm-source.exp: Adjust.
2009-10-23 00:49:33 +00:00
Hui Zhu e6158f167b 2009-07-11 Hui Zhu <teawater@gmail.com>
* cli/cli-cmds.c (disassemble_command): Add a new modifier /r
	to "disassemble" command to print the raw instructions in hex as
	well as in symbolic form.
	(init_cli_cmds): Ditto.
	(print_disassembly): Change "mixed" to "flags" to translate
	the behavior of disassemble.
	(disassemble_current_function): Ditto.
	* mi/mi-cmd-disas.c (mi_cmd_disassemble): Ditto.
	* stack.c (gdb_disassembly_stub): Ditto.
	* disasm.c (do_mixed_source_and_assembly): Ditto.
	(do_mixed_source_and_assembly): Ditto.
	(do_assembly_only): Ditto.
	(gdb_disassembly): Ditto.
	(dump_insns): print the raw instructions in hex as well as in
	symbolic form if DISASSEMBLY_RAW_INSN and flags is true.
	* disasm.h (DISASSEMBLY_SOURCE): Include source code with the
	assembly if it and flags is true.
	(DISASSEMBLY_RAW_INSN): Include the raw instructions in hex with
	the assembly if it and flags is true.
	(gdb_disassembly): Update extern.
	* NEWS: Document disassemble/r support.
2009-07-11 14:04:23 +00:00
Pierre Muller a177aad3d7 * cli/cli-cmds.c (init_cli_cmds): Add "inf" alias for "info" command. 2009-07-09 07:23:33 +00:00
Pedro Alves 2277426b30 gdb/
2009-07-02  Pedro Alves  <pedro@codesourcery.com>

	* linux-nat.c (linux_child_follow_fork): If we're staying attached
	to the child process, enable event reporting on it.  Don't handle
	checkpoints here.  Instead, add the child fork to the lwp thread
	and inferior lists without clobbering the previous inferior.  Let
	the thread_db layer learn about a new child process, even if
	following the parent.
	(linux_nat_switch_fork): Delete lwps of the current inferior only,
	instead of clearing the whole list.  Use thread_change_ptid to
	give the core the illusion the new checkpoint is still the same
	inferior.  Clear the register cache.
	(linux_handle_extended_wait): Handle checkpoints here.
	(linux_multi_process): Turn on.
	* linux-fork.c (struct fork_info) <pc>: Remove field.
	(init_fork_list): Do not delete the checkpoint from the inferior
	list (it is not there).
	(fork_load_infrun_state): Don't switch inferior_ptid here.  Pass
	the new checkpoint's ptid to linux_nat_switch_fork.
	(fork_save_infrun_state): Make static.  Don't stop the pc field of
	fork_info, it's gone.
	(linux_fork_mourn_inferior): Don't delete the checkpoint from the
	inferior list, it's not there.
	(linux_fork_detach): Ditto.
	(delete_fork_command): Replace mention of fork/checkpoint by
	checkpoint only.
	(detach_fork_command): Likewise.  Don't delete the checkpoint from
	the inferior list.
	(info_forks_command): Adjust.
	(restore_detach_fork): Delete.
	(checkpointing_pid): New.
	(linux_fork_checkpointing_p): New.
	(save_detach_fork): Delete.
	(checkpoint_command): Delete temp_detach_fork.  Don't remove
	breakpoints, that's a nop.  Store the pid of the process we're
	checkpointing, and use make_cleanup_restore_integer to restore it.
	Don't reinsert breakpoints here.
	(process_command, fork_command): Delete.
	(restart_command): Update comments to only mention checkpoints,
	not forks.
	(_initialize_linux_fork): Delete "fork", "process", "info forks"
	commands.
	* linux-fork.h (fork_save_infrun_state, fork_list): Delete
	declarations.
	(linux_fork_checkpointing_p): Declare.
	* cli/cli-cmds.c (killlist): New.
	* cli/cli-cmds.h (killlist): Declare.
	* gdbcmd.h (killlist): Declare.
	* inferior.c: Include "gdbthread.h".
	(detach_inferior_command, kill_inferior_command)
	(inferior_command): New.
	(info_inferiors_command): Allow specifying a specific inferior id.
	(_initialize_inferiors): Register "inferior", "kill inferior" and
	"detach inferior" commands.
	* infcmd.c (_initialize_infcmd): Make "kill" a prefix command.
	* gdbthread.h (any_thread_of_process): Declare.
	* thread.c (any_thread_of_process): New.

	* NEWS: Mention multi-inferior debugging.  Mention 'info
	inferiors', 'inferior', 'detach inferior' and 'kill inferior' as
	new commands.
	(Removed commands): New section, mentioning that 'info forks',
	'fork', 'process', 'delete fork' and 'detach fork' are now gone.

gdb/testsuite/
2009-07-02  Pedro Alves  <pedro@codesourcery.com>

	* gdb.base/multi-forks.exp: Only run detach-on-fork tests on
	linux.  Adjust to use "inferior", "info inferiors", "detach
	inferior" and "kill inferior" instead of "restart", "info fork",
	"detach fork" and "delete fork".
	* gdb.base/ending-run.exp: Spell out "info".
	* gdb.base/help.exp: Adjust to use test_prefix_command_help for
	the "kill" command.

gdb/doc/
2009-07-02  Pedro Alves  <pedro@codesourcery.com>

	* gdb.texinfo (Debugging multiple inferiors): Document the
	"inferior", "detach inferior" and "kill inferior" commands.
	(Debugging Programs with Multiple Processes): Adjust to mention
	generic "inferior" commands.  Delete mention of "detach fork" and
	"delete fork".  Cross reference to "Debugging multiple inferiors"
	section.
2009-07-02 21:57:28 +00:00
Ulrich Weigand 5af949e350 * defs.h (strlen_paddr, paddr, paddr_nz): Remove.
(paddress): Add GDBARCH parameter.
	* utils.c (strlen_paddr, paddr, paddr_nz): Remove.
	(paddress): Add GDBARCH parameter, use it instead of current_gdbarch.
	* ui-out.h (ui_out_field_core_addr): Add GDBARCH parameter.
	* ui-out.c (ui_out_field_core_addr): Add GDBARCH parameter,
	use it instead of current_gdbarch.

	Update calls to ui_out_field_core_addr to pass architecture:
	* ada-lang.c (print_one_exception): Update.
	* breakpoint.c (print_one_breakpoint_location,
	print_one_exception_catchpoint): Update.
	* disasm.c (dump_insns): Update.
	* darwin-nat-info.c (darwin_debug_regions_recurse): Update.
	* mi/mi-main.c (mi_cmd_data_read_memory): Update.
	* mi/mi-symbol-cmds.c: Include "objfiles.h".
	(mi_cmd_symbol_list_lines): Update.
	* stack.c (print_frame_info, print_frame): Update.

	Update callers of paddress to pass architecture:
	* ada-tasks.c (info_task): Update.
	* ada-valprint.c (ada_val_print_1): Update.
	* annotate.c (annotate_source, annotate_frame_begin): Update.
	* breakpoint.c (insert_bp_location, describe_other_breakpoints,
	mention): Update.
	* cli/cli-cmds.c (edit_command, list_command, print_disassembly):
	Update.
	* corefile.c (memory_error): Update.
	* c-valprint.c (print_function_pointer_address, c_val_print): Update.
	* disasm.c (dis_asm_print_address): Update.
	* exec.c (print_section_info): Update.
	* f-valprint.c (f_val_print): Update.
	* infcmd.c: Include "arch-utils.h".
	(jump_command, program_info): Update.
	* linux-fork.c: Include "arch-utils.h".
	(info_forks_command): Update.
	* m2-valprint.c (print_function_pointer_address,
	print_unpacked_pointer, print_variable_at_address,
	m2_val_print): Update.
	* m32r-rom.c (m32r_load_section, m32r_load, m32r_upload_command):
	Update.
	* printcmd.c (print_address, print_address_demangle, address_info):
	Update.
	* p-valprint.c (pascal_val_print): Update.
	* source.c: Include "arch-utils.h".
	(line_info): Update.
	* stack.c (frame_info, print_block_frame_labels): Update.
	* symfile.c (add_symbol_file_command, list_overlays_command): Update.
	* symmisc.c (dump_msymbols, dump_psymtab, dump_symtab_1,
	print_symbol, print_partial_symbols, maintenance_info_psymtabs,
	maintenance_check_symtabs): Update.
	* symtab.c (find_pc_sect_symtab): Update.
	* target.c (deprecated_debug_xfer_memory): Update.
	* tracepoint.c (scope_info): Update.
	* tui/tui-stack.c (tui_make_status_line): Update.
	* valprint.c (val_print_string): Update.

	Update callers of paddr_nz to use paddress instead (keeping
	user-visible output identical):
	* alpha-tdep.c (alpha_heuristic_proc_start): Update.
	* amd64-tdep.c (fixup_riprel, amd64_displaced_step_copy_insn,
	amd64_displaced_step_fixup): Update.
	* arch-utils.c (simple_displaced_step_copy_insn): Update.
	* auxv.c (fprint_target_auxv): Update.
	* breakpoint.c (insert_single_step_breakpoint): Update.
	* buildsym.c (finish_block): Update.
	* cli/cli-dump.c (restore_section_callback): Update.
	* fbsd-nat.c (fbsd_find_memory_regions): Update.
	* frame.c (frame_unwind_register_value): Update.
	* gcore.c (gcore_create_callback): Update.
	* hppa-tdep.c (hppa_frame_cache, hppa_skip_trampoline_code): Update.
	* i386-tdep.c (i386_displaced_step_fixup, i386_record_modrm,
	i386_record_lea_modrm_addr, i386_record_lea_modrm,
	i386_process_record): Update.
	* ia64-tdep.c (ia64_frame_this_id, ia64_sigtramp_frame_this_id,
	ia64_libunwind_frame_this_id, ia64_libunwind_sigtramp_frame_this_id,
	ia64_dummy_id, ia64_access_reg, ia64_access_rse_reg): Update.
	* infrun.c (displaced_step_prepare, displaced_step_fixup,
	handle_inferior_event, insert_step_resume_breakpoint_at_sal,
	insert_longjmp_resume_breakpoint): Update.
	* linux-nat.c (linux_nat_find_memory_regions): Update.
	* linux-record.c (record_linux_system_call): Update.
	* mips-tdep.c (heuristic_proc_start, mips_eabi_push_dummy_call,
	mips_n32n64_push_dummy_call, mips_o32_push_dummy_call,
	mips_o64_push_dummy_call): Update.
	* monitor.c (monitor_error, monitor_remove_breakpoint): Update.
	* record.c (record_arch_list_add_mem, record_wait,
	record_xfer_partial): Update.
	* remote-mips.c (mips_fetch_word, mips_check_lsi_error,
	mips_common_breakpoint): Update.
	* remote-sim.c (gdbsim_xfer_inferior_memory): Update.
	* rs6000-tdep.c (ppc_displaced_step_fixup): Update.
	* solib-som.c (som_current_sos): Update.
	* symfile.c (load_progress, generic_load): Update.
	* symfile-mem.c (add_vsyscall_page): Update.
	* valops.c (value_fetch_lazy): Update.
	* windows-tdep.c (windows_xfer_shared_library): Update.

	Update callers of paddr_nz to use paddress instead (changing
	user-visible output to make it more correct):
	* dwarf2loc.c (locexpr_describe_location): Update.
	* ia64-tdep.c (ia64_memory_insert_breakpoint,
	ia64_memory_remove_breakpoint): Update.
	* jv-valprint.c (java_value_print): Update.
	* m32c-tdep.c (m32c_m16c_address_to_pointer): Update.
	* monitor.c (monitor_read_memory): Update.

	Update callers of paddr to use paddress instead (changing
	user-visible output to make it more correct):
	* arm-tdep.c (arm_push_dummy_call): Update.
	* breakpoint.c (insert_bp_location, create_thread_event_breakpoint,
	create_breakpoint): Update.
	* darwin-nat-info.c (darwin_debug_regions): Update.
	* dcache.c (dcache_info): Update.
	* dsrec.c (load_srec, make_srec): Update.
	* dwarf2-frame.c (dwarf2_restore_rule, execute_cfa_program,
	dwarf2_frame_cache): Update.
	* gcore.c (gcore_copy_callback): Update.
	* gnu-nat.c (gnu_xfer_memory): Update.
	* mips-linux-nat.c (mips_show_dr): Update.
	* monitor.c (monitor_write_memory, monitor_insert_breakpoint,
	monitor_remove_breakpoint): Update.
	* remote.c (compare_sections_command): Update.
	* remote-m32r-sdi.c (m32r_xfer_memory, m32r_insert_breakpoint,
	m32r_remove_breakpoint, m32r_insert_watchpoint,
	m32r_remove_watchpoint): Update.
	* sol-thread.c (info_cb): Update.
	* symfile.c (load_progress): Update.

	Update callers of paddress or paddr_nz to use hex_string instead
	(changes output of internal/error/debug messages only):
	* dwarf2read.c (dump_die_shallow): Update.
	* frame.c (fprint_field, fprint_frame, frame_pc_unwind,
	get_frame_func, create_new_frame): Update.
	* hppa-tdep.c (find_unwind_entry, unwind_command): Update.
	* ia64-tdep.c (get_kernel_table, ia64_find_proc_info_x,
	ia64_get_dyn_info_list): Update.
	* maint.c (maintenance_translate_address): Update.
	* mi/mi-cmd-var.c (mi_cmd_var_create): Update.
	* target.c (target_flash_erase): Update.

	Update callers of paddr/paddr_nz to use phex/phex_nz instead,
	using an appropriate address size.  Remove use of strlen_paddr.
	* exec.c (exec_files_info): Update.
	* i386-nat.c (i386_show_dr): Update.
	* remote.c (remote_flash_erase): Update.
	* m32r-rom.c (m32r_load_section): Update.
	* monitor.c (monitor_vsprintf, monitor_store_register): Update.
	* remote.c (remote_check_symbols, remote_search_memory): Update.
	* remote-mips.c (mips_request, mips_common_breakpoint): Update.
	* scm-valprint.c (scm_ipruk, scm_scmval_print): Update.
	* sh64-tdep.c (sh64_show_media_regs, sh64_show_compact_regs): Update.
	* sh-tdep.c (sh_generic_show_regs, sh3_show_regs, sh2e_show_regs,
	sh2a_show_regs, sh2a_nofpu_show_regs, sh3e_show_regs,
	sh3_dsp_show_regs, sh4_show_regs, sh4_nofpu_show_regs,
	sh_dsp_show_regs): Update.
	* xcoffsolib.c (sharedlibrary_command): Update.


	* maint.c (maint_print_section_info): Add ADDR_SIZE parameter.
	Use hex_string_custom instead of paddr.
	(print_bfd_section_info): Pass address size.
	(print_objfile_section_info): Likewise.

	* annotate.h (annotate_source): Add GDBARCH parameter.
	(annotate_frame_begin): Likewise.
	* annotate.c (annotate_source): Add GDBARCH parameter.
	(annotate_frame_begin): Likewise.
	* source.c (identify_source_line): Update call to annotate_source.
	* stack.c (print_frame_info, print_frame): Update call to
	annotate_frame_begin.

	* breakpoint.c (describe_other_breakpoints): Add GDBARCH parameter.
	(create_breakpoint, create_ada_exception_breakpoint): Update call.

	* stack.c (print_block_frame_labels): Add GDBARCH parameter.
	(print_frame_label_vars): Update call.

	* symmisc.c (print_partial_symbols): Add GDBARCH parameter.
	(dump_psymtab): Update call to print_partial_symbols.
	(struct print_symbol_args): Add GDBARCH member.
	(dump_symtab_1): Set print_symbol_args architecture member.
	(print_symbol): Use it.

	* windows-tdep.h (windows_xfer_shared_library): Add GDBARCH
	parameter.
	* windows-tdep.c (windows_xfer_shared_library): Likewise.
	* i386-cygwin-tdep.c (struct cpms_data): Add GDBARCH member.
	(core_process_module_section): Pass architecture from cpms_data to
	windows_xfer_shared_library.
	(windows_core_xfer_shared_libraries): Initialize cmps_data
	architecture member.
	* windows-nat.c (windows_xfer_shared_libraries): Pass architecture
	to windows_xfer_shared_library.

	* defs.h (print_address): Add GDBARCH parameter.
	* printcmd.c (print_address): Add GDBARCH parameter.
	(print_scalar_formatted, do_examine): Update call.
	* findcmd.c (find_command): Update call.
	* tracepoint.c: Include "arch-utils.h".
	(trace_find_line_command): Update call.
	* tui/tui-disasm.c (tui_disassemble): Update call.

	* value.h (print_address_demangle): Add GDBARCH parameter.
	* printcmd.c (print_address_demangle): Add GDBARCH parameter.
	* c-valprint.c (print_function_pointer_address, c_val_print):
	Update call.
	* f-valprint.c (f_val_print): Update call.
	* gnu-v3-abi.c (gnuv3_print_method_ptr): Update call.
	* jv-valprint.c (java_val_print): Update call.
	* m2-valprint.c (print_function_pointer_address, m2_val_print):
	Update call.
	* p-valprint.c (pascal_val_print): Update call.

	* disasm.c (gdb_disassemble_info): Install architecture into
	di.application_data field.

testsuite/ChangeLog:

	* gdb.threads/tls-shared.exp: Update to locexpr_describe_location
	change to prefix TLS offset in hex with 0x.

doc/ChangeLog:

	* gdbint.texinfo (Item Output Functions): Update signature
	for ui_out_field_core_addr.
2009-07-02 17:21:10 +00:00
Ulrich Weigand 13274fc342 * disasm.h (gdb_disassembly): Add GDBARCH parameter.
(gdb_print_insn): Likewise.
	* disasm.c (dump_insns): Add GDBARCH parameter.  Use it instead
	of current_gdbarch.
	(do_mixed_source_and_assembly): Add GDBARCH parameter.  Pass to
	dump_insns.
	(do_assembly_only): Likewise.
	(gdb_disassembly): Add GDBARCH parameter.  Use it instead of
	current_gdbarch.  Pass to subroutines.
	(gdb_print_insn): Add GDBARCH parameter.  Use it instead of
	current_gdbarch.

	* stack.c (struct gdb_disassembly_stub_args): Add GDBARCH member.
	(gdb_disassembly_stub): Pass architecture to gdb_disassembly.
	(do_gdb_disassembly): Add GDBARCH argument.  Store into args.
	(print_frame_info): Pass architecture to do_gdb_disassembly.

	* printcmd.c (print_formatted): Pass architecture to gdb_print_insn.

	* mi/mi-cmd-disas.c: Include "arch-utils.h"
	(mi_cmd_disassemble): Pass architecture to gdb_disassembly.

	* cli/cli-cmds.c: Include "arch-utils.h".
	(print_disassembly): Add GDBARCH parameter.  Pass to gdb_disassembly
	and tui_show_assembly.
	(disassemble_current_function): Pass architecture to
	tui_get_low_disassembly_address and print_disassembly.
	(disassemble_command): Pass architecture to
	tui_get_low_disassembly_address and print_disassembly.

	* tui/tui.c (tui_show_assembly): Add GDBARCH parameter.  Pass to
	tui_update_source_windows_with_addr.

	* tui/tui-data.h (struct tui_locator_element): Add GDBARCH member.
	(struct tui_source_info): Likewise.
	* tui/tui-data.c (tui_clear_win_detail): Clear source_info.gdbarch.

	* tui/tui-disasm.c (tui_disassemble): Add GDBARCH parameter.
	Pass to gdb_print_insn.
	(tui_find_disassembly_address): Add GDBARCH parameter.  Pass to
	tui_disassemble.
	(tui_set_disassem_content): Add GDBARCH parameter.  Install into
	source_info.gdbarch.  Pass to tui_disassemble.
	(tui_show_disassem): Add GDBARCH parameter.  Pass to
	tui_update_source_window.
	(tui_show_disassem_and_update_source): Add GDBARCH parameter.  Pass to
	tui_show_disassem and tui_update_source_window.

	(tui_get_begin_asm_address): Return locator architecture in addition
	to locator PC value.

	(tui_get_low_disassembly_address): Add GDBARCH parameter.   Pass to
	tui_get_low_disassembly_address.

	(tui_vertical_disassem_scroll): Pass architecture to subroutines.

	* tui/tui-disasm.h (tui_set_disassem_content): Add GDBARCH parameter.
	(tui_show_disassem): Likewise.
	(tui_show_disassem_and_update_source): Likewise.
	(tui_get_begin_asm_address): Return architecture and PC value.

	* tui/tui.h (tui_get_low_disassembly_address): Add GDBARCH parameter.
	(tui_show_assembly): Add GDBARCH parameter.

	* tui/tui-layout.c (extract_display_start_addr): Return current window
	architecture in addition to current PC value.

	(tui_set_layout): Update calls to tui_get_low_disassembly_address and
	extract_display_start_addr.  Pass architecture to
	tui_update_source_windows_with_addr.

	* tui/tui-source.c: Include "objfiles.h".
	(tui_set_source_content): Initialize window architecture.
	(tui_show_symtab_source): Add GDBARCH parameter.  Pass to
	tui_update_source_window_as_is

	* tui/tui-source.h (tui_show_symtab_source): Add GDBARCH parameter.

	* tui/tui-stack.c (tui_set_locator_info): Add GDBARCH parameter.
	Install locator architecture.
	(tui_set_locator_filename): Update call.
	(tui_show_frame_info): Pass architecture to tui_set_locator_info
	and subroutines.

	* tui/tui-win.c (make_visible_with_new_height): Pass architecture
	to tui_update_source_window.

	* tui/tui-winsource.c: Include "objfiles.h".
	(tui_display_main): Update call to tui_get_begin_asm_address.
	Pass architecture to tui_update_source_windows_with_addr.
	(tui_update_source_window): Add GDBARCH parameter.  Pass to
	tui_update_source_window_as_is.
	(tui_update_source_window_as_is): Add GDBARCH parameter.
	Pass to tui_set_disassem_content.
	(tui_update_source_windows_with_addr): Add GDBARCH parameter.
	Pass to subroutines.
	(tui_update_source_windows_with_line): Pass objfile architecture
	to subroutines.
	(tui_horizontal_source_scroll): Pass architecture to
	tui_update_source_window_as_is.

	* tui/tui-winsource.h (tui_update_source_window): Add GDBARCH
	parameter.
	(tui_update_source_window_as_is): Likewise.
	(tui_update_source_windows_with_addr): Likewise.
2009-07-02 17:17:42 +00:00
Jan Kratochvil fbdebf4657 gdb/
Remove the PROT parameter from openp.
	* source.c (openp): Remove the parameter PROT.  Assertion check MODE.
	defs.h (openp): Update the prototype.
	Update all the openp callers.
2009-05-19 13:51:37 +00:00
Pedro Alves d729566a19 * infrun.c (normal_stop): Use has_stack_frames instead of
target_has_stack.
	* mi/mi-main.c (mi_execute_command): Avoid calling inferior_thread
	when there is no thread selected.
	(mi_cmd_execute): Don't special case commands that can run without
	a valid selected thread.
	* top.c (execute_command): Don't special case commands that can
	run without a valid selected thread.  Use has_stack_frames.
	* infcmd.c (ensure_valid_thread): New.
	(continue_1, step_1, jump_command, signal_command): Use it.
	(detach_command): Error out if there's no selected thread/inferior.
	* thread.c (print_thread_info): Allow having no thread selected.
	(switch_to_thread): Don't read the PC if there is no current thread.
	(do_restore_current_thread_cleanup): Don't record the current
	frame if there is no current thread.
	(make_cleanup_restore_current_thread): Don't read frame info if
	there is no selected thread.
	(_initialize_thread): Don't mark commands as
	"no_selected_thread_ok".
	* frame.c (get_current_frame): Error out if there is no valid
	selected thread.
	(has_stack_frames): Return false if there is no valid
	selected thread.
	* cli/cli-cmds.c (init_cli_cmds): Don't mark commands as
	"no_selected_thread_ok".
	* cli/cli-decode.c (set_cmd_no_selected_thread_ok)
	(get_cmd_no_selected_thread_ok): Delete.
	* cli/cli-decode.h (CMD_NO_SELECTED_THREAD_OK): Delete.
	(set_cmd_no_selected_thread_ok, get_cmd_no_selected_thread_ok):
	Delete declaration.
	* stack.c (get_selected_block): Use has_stack_frames.
2009-03-25 21:42:35 +00:00
Hui Zhu 55518360d8 * disasm.c (gdb_disassembly): Remove unused argument
"line_num".
	* disasm.h (gdb_disassembly): Ditto.
	* cli/cli-cmds.c (print_disassembly): Ditto.
	* mi/mi-cmd-disas.c (mi_cmd_disassemble): Ditto.
2009-03-10 08:53:53 +00:00
Daniel Jacobowitz adb483feb8 * NEWS: Document "define" for prefixed commands.
* cli/cli-cmds.c (show_user): Update calls to show_user_1.  Call
	show_user_1 for prefix commands.
	* cli/cli-decode.c (help_cmd_list): Recurse for "help user-defined".
	* cli/cli-script.c (validate_comname): Rewrite to handle prefix
	commands.  Return the containing command list.
	(define_command, document_command): Update to handle prefix commands.
	(show_user_1): Add prefix and name arguments.  Handle prefix
	commands.
	* cli/cli-script.h (show_user_1): Update prototype.

	doc/
	* gdb.texinfo (Define, Hooks): Document prefix command support.

	testsuite/
	* gdb.base/define.exp: Test defining and hooking prefix commands.
	* gdb.python/python.exp: Update test for "show user" output.
2009-01-14 20:40:09 +00:00
Doug Evans 0380c18b13 * cli/cli-cmds.c (set_debug): Fix cut-n-paste error. 2009-01-07 20:38:16 +00:00
Jim Blandy bf1d7d9ce0 Check return values of functions declared with warn_unused_result
attribute in GLIBC 2.8.
* cli/cli-cmds.c (pwd_command): Check return value from getcwd.
* inflow.c (check_syscall): New function.
(new_tty): Use check_syscall to check return values from open and dup.
* linux-nat.c (linux_nat_info_proc_cmd): Check return value from fgets.
* main.c (captured_main): Call cwd after setting up gdb_stderr;
check for errors from getcwd.
* mi/mi-cmd-env.c (mi_cmd_env_pwd): Check return value from getcwd.
* ui-file.c (stdio_file_write): Ignore return value from fwrite.
(stdio_file_fputs): Same.
* utils.c (internal_vproblem): abort if last-ditch error message
write fails.
2009-01-06 18:31:59 +00:00
Joel Brobecker 0fb0cc7590 Updated copyright notices for most files. 2009-01-03 05:58:08 +00:00
Tom Tromey b03a6ea40e * cli/cli-cmds.c (source_script): Clean up full_pathname. Run
cleanups on early return.
2008-11-10 20:38:24 +00:00
Tom Tromey d5529a849e * cli/cli-cmds.c (edit_command): Remove unused variables. Delete
dead code.  Fix indentation.
2008-07-30 01:08:35 +00:00
Vladimir Prus d72314c67b Kill cmd_async_ok.
* cli/cli-decode.h (CMD_ASYNC_OK, set_cmd_async_ok)
        (get_cmd_async_ok): Remove.
        * cli/cli-decode.c (set_cmd_async_ok, get_cmd_async_ok): Remove.
        * cli/cli-cmds.c (init_cli_cmds): Don't use set_cmd_async_ok.
        * infcmd.c (_initialize_infcmd): Likewise.
        * thread.c (_initialize_thread): Likewise.
2008-07-26 10:23:56 +00:00
Pedro Alves 4f8d22e3b4 Exited threads.
* thread.c (enum thread_state): New.
	(thread_state main_thread_running): Delete, in favor of...
	(thread_state main_thread_state): ... this.  Update throughout.
	(clear_thread_inferior_resources): New, split from free_thread.
	(free_thread): Call clear_thread_inferior_resources.
	(init_thread_list): Set main thread to stopped state.
	(add_thread_silent): Take care of PTID reuses.
	(delete_thread): If deleting inferior_ptid or a thread with
	refcount > 0, mark it as exited, but still keep it in the list.
	Only notify of thread exits, if we haven't done so yet.
	(iterate_over_threads): Make it safe to delete threads while
	iterating over them.
	(do_captured_list_thread_ids): Don't account for exited threads.
	(thread_alive): Check for the THREAD_EXITED state, and don't set
	ptid to -1 on exited threads.
	(set_running): Update to account for extra possible states.
	(is_thread_state): New.
	(is_stopped, is_exited): New.
	(is_running): Implement in terms of is_thread_state.
	(any_running): Update.
	(print_thread_info): Update.  Account for exited threads.  Don't
	warn about missed frame restoring here, its done in the cleanup.
	(switch_to_thread): Don't read from a thread that has gone.
	(restore_current_thread): In non-stop mode, do a full context
	switch.
	(restore_selected_frame): Add a frame_level argument.  Rewrite.
	(struct current_thread_cleanup): Add selected_frame_level and
	was_stopped members.
	(do_restore_current_thread_cleanup): Check if thread was stopped
	and still is, and if the target has registers, stack and memory
	before restoring the selected frame.  Don't delete the cleanup
	argument here.
	(restore_current_thread_cleanup_dtor): New.
	(make_cleanup_restore_current_thread): Remove all arguments.
	Rewrite.
	(thread_apply_all_command): Update.  Prune threads.
	(thread_apply_command): Update.
	(thread_command): Account for currently selected exited thread.
	(do_captured_thread_select): Check for a running thread.  Prune
	threads.
	(_initialize_thread): Make "info threads", "thread", "thread
	apply", and "thread apply all" appliable without a selected thread.
	* gdbthread.h (struct thread_info): Replace running_ by state_.
	Add refcount.
	(is_exited, is_stopped): Declare.
	(make_cleanup_restore_current_thread): Remove all arguments.
	* infrun.c: Include "event-top.h".
	(fetch_inferior_event): In non-stop mode, restore selected thread
	and frame after handling the event and running breakpoint
	commands.  Display GDB prompt if needed.
	(normal_stop): In non-stop mode, don't print thread switching
	notice.
	* cli/cli-decode.c (set_cmd_no_selected_thread_ok)
	(get_cmd_no_selected_thread_ok): New.
	* cli/cli-decode.h (CMD_NO_SELECTED_THREAD_OK): New.
	(set_cmd_no_selected_thread_ok, get_cmd_no_selected_thread_ok):
	Declare.
	* cli/cli-cmds.c: Set "pwd", "help", "info", "show" as
	no-selected-thread ok.
	* top.c (execute_command): Check for non no-selected-thread-ok
	commands.
	* linux-nat.c (struct saved_ptids, threads_to_delete)
	(record_dead_thread, prune_lwps): Delete.
	(exit_lwp): Unconditionally delete thread.
	(linux_nat_resume): Remove prune_lwps call.
	* infcmd.c (proceed_thread_callback): Check if !is_stopped instead
	of is_running.  Adjust to make_cleanup_restore_current_thread
	interface change.
	* mi/mi-main.c (mi_cmd_execute): Only allow a few commands if the
	selected thread has exited.
	* inf-loop.c (inferior_event_handler): Don't display the prompt
	here.
	* varobj.c (c_value_of_root): Update.
	* defs.h (make_cleanup_dtor): Declare.
	* utils.c (make_cleanup_dtor): New.

	* Makefile.in (infrun.o): Depend on $(event_top_h).
2008-07-11 11:07:39 +00:00
Markus Deuling 50ee753532 * annotate.c (annotate_source, annotate_frame_begin): Replace
deprecated_print_address_numeric with paddress.
	* cli/cli-cmds.c (list_command, edit_command): Likewise.
	* tui/tui-stack.c (tui_make_status_line): Likewise.

	* defs.h (deprecated_print_address_numeric): Remove.
	* printcmd.c (deprecated_print_address_numeric): Remove.
	* maint.c (maint_print_section_info): Fix comment.
2008-05-23 04:31:40 +00:00
Doug Evans d14508fea9 * NEWS: Mention new /m modifier for disassemble command.
* cli/cli-cmds.c (print_disassembly): New function.
	(disassemble_current_function): New function
	(disassemble_command): Recognize /m modifier, print mixed
	source+assembly.
	(init_cli_cmds): Update disassemble help text.

	* gdb.texinfo (disassemble): Document /m modifier.
2008-05-05 21:14:37 +00:00
Tom Tromey 700b53b17a * cli/cli-decode.h (CMD_ASYNC_OK): New define.
(set_cmd_async_ok, get_cmd_async_ok): Declare.
	* cli/cli-decode.c (set_cmd_async_ok): New function.
	(get_cmd_async_ok): New function.
	* cli/cli-cmds.c (init_cli_cmds): Mark "pwd", "help", "info", and
	"show" as async-ok.
	* top.c (execute_command): Use get_cmd_async_ok.
	* infcmd.c: Include cli/cli-decode.h.
	(_initialize_infcmd): Mark "interrupt" as async-ok.
	* Makefile.in (infcmd.o): Depend on cli_decode_h.
2008-04-17 00:25:01 +00:00
Daniel Jacobowitz 9b254dd1ce Updated copyright notices for most files. 2008-01-01 22:53:26 +00:00
Joel Brobecker a9762ec78a Switch the license of all .c files to GPLv3.
Switch the license of all .h files to GPLv3.
        Switch the license of all .cc files to GPLv3.
2007-08-23 18:08:50 +00:00
Ulrich Weigand cbf3b44a9f 2007-06-18 Markus Deuling <deuling@de.ibm.com>
* gdbarch.sh (DEPRECATED_FUNCTION_START_OFFSET): Replace by
	gdbarch_deprecated_function_start_offset.
	* symtab.c (find_function_start_sal)skip_prologue_using_sal): Likewise.
	* linespec.c (minsym_found): Likewise.
	* infrun.c (handle_inferior_event): Likewise.
	* infcall.c (find_function_addr): Likewise.
	* cli/cli-cmds.c (disassemble_command): Likewise.
	* gdbarch.c, gdbarch.h: Regenerate.
2007-06-18 18:23:08 +00:00
Daniel Jacobowitz 206415a3ea * frame.c (deprecated_selected_frame): Rename to...
(selected_frame): ...this.  Make static.
	(get_selected_frame, select_frame): Update.
	* frame.h (deprected_select_frame): Delete.
	(deprecated_safe_get_selected_frame): Update comments.

	* breakpoint.c, cli/cli-cmds.c, f-valprint.c, infcmd.c, inflow.c,
	infrun.c, stack.c, tui/tui-disasm.c, tui/tui-source.c,
	tui/tui-winsource.c, valops.c, varobj.c, findvar.c, macroscope.c,
	parse.c, regcache.h, sh64-tdep.c, tui/tui-hooks.c, tui/tui-win.c,
	tui/tui.c: Replace references to deprecated_selected_frame.
2007-02-27 19:46:04 +00:00
Daniel Jacobowitz 8944021f76 Reported by timeless@gmail.com:
* gdb/target.c (target_flash_erase): Do not return void value.
	(target_flash_done): Likewise.
	* gdb/cli/cli-cmds.c (source_command): Likewise.

	Reported by timeless@gmail.com:
	* wrapper.c (sim_target_parse_arg_array): Do not return void value.
2007-02-08 16:31:57 +00:00
Daniel Jacobowitz 6aba47ca06 Copyright updates for 2007. 2007-01-09 17:59:20 +00:00
Andreas Schwab f73adfeb8b * gdbcmd.h (detachlist): Declare.
* infcmd.c (_initialize_infcmd): Define "detach" as prefix
	command.
	* linux-fork.c (_initialize_linux_fork): Rename
	"detach-checkpoint" to "detach checkpoint" and "detach-fork" to
	"detach fork".
	* cli/cli-cmds.c (detachlist): Define.
	(init_cmd_lists): Initialize it.
	* cli/cli-cmds.h (detachlist): Declare.

doc/:
	* gdb.texinfo (Processes): Rename "detach-fork" to "detach fork".

testsuite/:
	* gdb.base/multi-forks.exp: Use "detach fork" instead of
	"detach-fork".
2006-10-27 22:23:21 +00:00
Andrew Stubbs 16026cd75d 2006-07-21 Andrew Stubbs <andrew.stubbs@st.com>
* cli/cli-cmds.c (source_verbose, trace_commands): New variables.
	(source_script): New function.
	(source_verbose_cleanup): New function.
	(source_command): Move old contents to source_script.
	Make function static. Parse -v option and call source_script.
	(init_cli_cmds): Update source command help.
	Add 'set trace-commands' command.
	* cli/cli-script.c (command_next_depth): New static variable.
	(suppress_next_print_command_trace): New static variable.
	(reset_command_nest_depth): New function.
	(print_command_trace): New function.
	(execute_control_command): Split the continue_control and break_control
	cases, add calls to print_command_trace and count the nest depth.
	(while_command): Set suppress_next_print_command_trace.
	(if_command): Likewise.
	* top.c (execute_command): Call print_command_trace.
	* cli/cli-cmds.h (source_verbose, trace_commands): New extern variables.
	(source_command): Change to source_script.
	* main.c (captued_main): Use source_script instead of source_command.
	* top.h (source_command): Change to source_script.
	* event-top.c (display_gdb_prompt): Call reset_command_nest_depth.
	* cli/cli-script.h (print_command_trace): Export.
	(reset_command_nest_depth): Likewise.

docs/
	* gdb.texinfo (Optional warnings and messages): Add
	'set/show trace-commands'.
	(Command files): Add '-v' to source command.

testsuite/
	* gdb.base/default.exp: Update source command error message.
	* gdb.base/help.exp: Update 'help source' message.
2006-07-21 14:46:56 +00:00
Daniel Jacobowitz 245c7f487f 2006-05-15 Peter O'Gorman <gdb-patches@mlists.thewrittenword.com>
* source.c (get_current_source_symtab_and_line)
	(set_current_source_symtab_and_line): Use { 0 }.
	* cli/cli-cmds.c (list_command): Likewise.
2006-05-15 15:50:14 +00:00
Andrew Stubbs 4b505b1269 2006-01-23 Andrew Stubbs <andrew.stubbs@st.com>
* cli/cli-cmds.c: Include fcntl.h.
	(source_command): Use the GDB search path to find script files.

doc/
	* gdb.texinfo (Choosing files): Mention that -directory is used
	for script files.
	(Specifying source directories): Likewise.
	(Command files): Explain how script files are found.
2006-01-23 16:28:37 +00:00
Eli Zaretskii 10f9c2135e * cli/cli-utils.h:
* cli/cli-utils.c:
	* cli/cli-setshow.h:
	* cli/cli-setshow.c:
	* cli/cli-script.h:
	* cli/cli-script.c:
	* cli/cli-logging.c:
	* cli/cli-interp.c:
	* cli/cli-dump.h:
	* cli/cli-dump.c:
	* cli/cli-decode.h:
	* cli/cli-decode.c:
	* cli/cli-cmds.h:
	* cli/cli-cmds.c: Add (c) after Copyright.  Update FSF address.
2005-12-17 22:40:17 +00:00
Mark Kettenis 1754f103e6 * bsd-kvm.c (bsd_kvm_open): Properly cast sentinel in concat call.
* coffread.c (patch_type, process_coff_symbol): Likewise.
* corelow.c (core_open): Likewise.
* dwarf2read.c (dwarf_decode_lines, dwarf2_start_subfile):
* language.c (set_lang_str, set_type_str, set_range_str)
(set_case_str): Likewise.
* source.c (add_path, openp): Likewise.
* stabsread.c: Likewise.
* top.c (init_history): Likewise.
* utils.c (xfullpath): Likewise.
* value.c (lookup_internalvar): Likewise.
* cli/cli-cmds.c (cd_command): Likewise.
* cli/cli-dump.c (add_dump_command): Likewise.
2005-07-04 13:29:13 +00:00
Andrew Cagney c68a6671d7 2005-05-27 Andrew Cagney <cagney@gnu.org>
* jv-lang.c (get_java_utf8_name): Add cast.
	(evaluate_subexp_java): Use gdb_byte for buffers.
	* jv-valprint.c (java_value_print, java_value_print): Use gdb_byte
	for buffers.
	* scm-lang.c (scm_get_field, scm_unpack)
	(scm_evaluate_string): Use gdb_byte for buffers.
	(scm_lookup_name): Add cast.
	* scm-valprint.c (scm_scmval_print, scm_scmval_print): Use
	gdb_byte for buffers.
	* tui/tui.h (tui_get_command_dimension): Make parameters unsigned.
	* tui/tui.c (tui_get_command_dimension): Make parameters unsigned.
	* value.h (check_field): Change "name" to a string.
	* valops.c (check_field): Change "name" to a string.
	* scm-lang.h (scm_parse): Use gdb_byte for buffers.
	* source.c (get_current_source_symtab_and_line)
	(set_current_source_symtab_and_line): Initialize all fields of sal
	structures.
	* cli/cli-cmds.c (list_command): Use gdb_byte for buffers.
2005-05-27 04:39:33 +00:00
Eli Zaretskii eaae39195e * Makefile.in (go32-nat.o): Add $(top_h) to prerequisites.
* go32-nat.c: Include top.h.  Update copyright years.
	(init_go32_ops): Override the default value of gdbinit[] with
	"gdb.ini".

	* cli/cli-cmds.c (init_cli_cmds): Use gdbinit[] instead of a
	compile-time literal string GDBINIT_FILENAME.

	* top.c (PATH_MAX): Define if not defined.
	(gdbinit): Declare with a constant size PATH_MAX.

	* config/i386/go32.mh (XM_FILE): Remove.

	* config/i386/xm-go32.h: Remove file.
2005-05-12 21:23:17 +00:00
Eli Zaretskii a955ca7173 * cli/cli-cmds.c (edit_command): If symtab->fullname is not yet
set, use symtab_to_fullname, instead of trying to do its job.  Use
	xstrprintf instead of malloc and sprintf.
2005-04-28 20:32:42 +00:00
Mark Mitchell 9b265ec209 * utils.c (internal_vproblem): Guard call to fork with
HAVE_WORKING_FORK.
	* cli/cli-cmds.c (shell_escape): Guard call to vfork with
	HAVE_WORKING_VFORK and HAVE_WORKING_FORK.

	* remote-fileo.c (remote_fileio_mode_to_host): Accomodate lack of
	S_IRGRP and related macros.
	(remote_fileio_mode_to_target): Likewise.
2005-03-16 15:58:41 +00:00
Andrew Cagney 920d2a4419 2005-02-24 Andrew Cagney <cagney@gnu.org>
Add show_VARIABLE functions, update add_setshow call.
	* varobj.c (_initialize_varobj, show_varobjdebug): Add and update.
	* valprint.c (_initialize_valprint, show_print_max)
	(show_stop_print_at_null, show_repeat_count_threshold)
	(show_prettyprint_structs, show_unionprint)
	(show_prettyprint_arrays, show_addressprint, show_input_radix)
	(show_output_radix): Ditto.
	* valops.c (_initialize_valops, show_overload_resolution): Ditto.
	* utils.c (initialize_utils, show_chars_per_line)
	(show_lines_per_page, show_demangle, show_pagination_enabled)
	(show_sevenbit_strings, show_asm_demangle): Ditto
	* tui/tui-win.c (_initialize_tui_win, show_tui_border_kind)
	(show_tui_border_mode, show_tui_active_border_mode): Ditto.
	* top.c (init_main, show_new_async_prompt)
	(show_async_command_editing_p, show_write_history_p)
	(show_history_size, show_history_filename, show_caution)
	(show_annotation_level, init_main): Ditto.
	* target.c (initialize_targets, show_targetdebug)
	(show_trust_readonly): Ditto.
	* symfile.c (_initialize_symfile, show_symbol_reloading)
	(show_ext_args, show_download_write_size)
	(show_debug_file_directory): Ditto.
	* source.c (_initialize_source, show_lines_to_list): Ditto.
	* solib.c (_initialize_solib, show_auto_solib_add)
	(show_solib_search_path): Ditto.
	* p-valprint.c (_initialize_pascal_valprint)
	(show_pascal_static_field_print): Ditto.
	* printcmd.c (_initialize_printcmd, show_max_symbolic_offset)
	(show_print_symbol_filename): Add and update.
	* parse.c (_initialize_parse, show_expressiondebug): Dito.
	* observer.c (_initialize_observer, show_observer_debug): Dito.
	* maint.c (_initialize_maint_cmds, show_watchdog)
	(show_maintenance_profile_p): Dito.
	* linux-nat.c (_initialize_linux_nat, show_debug_linux_nat): Dito.
	* infrun.c (_initialize_infrun, show_debug_infrun)
	(show_stop_on_solib_events, show_follow_fork_mode_string)
	(show_scheduler_mode, show_step_stop_if_no_debug): Ditto.
	* infcall.c (_initialize_infcall, show_coerce_float_to_double_p)
	(show_unwind_on_signal_p): Ditto.
	* gdbtypes.c (build_gdbtypes, show_opaque_type_resolution)
	(_initialize_gdbtypes, show_overload_debug): Ditto.
	* gdb-events.c, gdb-events.sh (_initialize_gdb_events)
	(show_gdb_events_debug): Ditto.
	* gdbarch.c, gdbarch.sh (show_gdbarch_debug)
	(_initialize_gdbarch): Ditto.
	* frame.c (_initialize_frame, show_backtrace_past_main)
	(show_backtrace_past_entry, show_backtrace_limit)
	(show_frame_debug): Ditto.
	* exec.c (_initialize_exec, show_write_files): Ditto.
	* dwarf2read.c (_initialize_dwarf2_read)
	(show_dwarf2_max_cache_age): Ditto.
	* demangle.c (_initialize_demangler)
	(show_demangling_style_names): Ditto.
	* dcache.c (_initialize_dcache, show_dcache_enabled_p): Ditto.
	* cp-valprint.c (show_static_field_print)
	(_initialize_cp_valprint, show_vtblprint, show_objectprint): Ditto.
	* corefile.c (_initialize_core, show_gnutarget_string): Ditto.
	* cli/cli-logging.c (_initialize_cli_logging)
	(show_logging_overwrite, show_logging_redirect)
	(show_logging_filename): Ditto.
	* cli/cli-cmds.c (show_info_verbose, show_history_expansion_p)
	(init_cli_cmds, show_baud_rate, show_remote_debug)
	(show_remote_timeout, show_max_user_call_depth): Ditto.
	* charset.c (show_host_charset_name, show_target_charset_name)
	(initialize_charset): Ditto.
	* breakpoint.c (show_can_use_hw_watchpoints)
	(show_pending_break_support, _initialize_breakpoint): Ditto.
2005-02-24 13:51:36 +00:00
Andrew Cagney c0d88b1be7 2005-02-18 Andrew Cagney <cagney@gnu.org>
* cli/cli-decode.c (add_setshow_integer_cmd): New function.
	* command.h (add_setshow_integer_cmd): Declare.
	* cli/cli-cmds.c: Update.
2005-02-18 20:57:16 +00:00
Andrew Cagney 85c078043b 2005-02-18 Andrew Cagney <cagney@gnu.org>
Use add_setshow_zinteger_cmd through out.  Re-sync gdbarch.sh
	and gdbarch.c.
	* breakpoint.c, frame.c, gdb-events.sh, gdbarch.sh: Update.
	* gdbtypes.c, infrun.c, linux-nat.c, maint.c, monitor.c: Update.
	* pa64solib.c, parse.c, remote-mips.c, ser-go32.c: Update.
	* serial.c, solib-frv.c, somsolib.c, target.c, top.c: Update.
	* varobj.c, cli/cli-cmds.c: Update.
	* gdbarch.c, gdb-events.c: Regenerate.
2005-02-18 18:58:56 +00:00
Andrew Cagney 5bf193a2ee 2005-02-18 Andrew Cagney <cagney@gnu.org>
Use add_setshow_boolean_command through out.  Delete #ifdef 0'ed
	code adding set/show boolean commands.
	* cp-valprint.c, dcache.c, exec.c, gdbtypes.c, infrun.c: Update.
	* monitor.c, p-valprint.c, pa64solib.c, printcmd.c: Update.
	* proc-api.c, remote-mips.c, remote.c, solib.c: Update.
	* somsolib.c, symfile.c, top.c, utils.c, valops.c: Update.
	* valprint.c, win32-nat.c, wince.c, xcoffsolib.c: Update.
	* cli/cli-cmds.c: Update.
2005-02-18 15:25:32 +00:00
Andrew Cagney 1bedd21517 2005-02-15 Andrew Cagney <cagney@gnu.org>
Mark up add_com, add_info and add_prefix_cmd.
	* breakpoint.c, cp-support.c, dcache.c, dwarf2read.c: Update.
	* exec.c, f-valprint.c, frame.c, gcore.c, gnu-nat.c: Update.
	* go32-nat.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update.
	* kod.c, language.c, linux-nat.c, m32r-rom.c, macrocmd.c: Update.
	* maint.c, memattr.c, mips-tdep.c, nto-procfs.c, objc-lang.c: Update.
	* ocd.c, pa64solib.c, printcmd.c, procfs.c, regcache.c: Update.
	* remote-e7000.c, remote-m32r-sdi.c, remote-mips.c: Update.
	* remote-sds.c, remote-sim.c, remote-st.c, remote-utils.c: Update.
	* remote.c, rs6000-tdep.c, ser-go32.c, serial.c: Update.
	* sh-tdep.c, solib.c, somsolib.c, source.c, stack.c: Update.
	* symfile.c, symtab.c, target.c, thread.c, top.c: Update.
	* tracepoint.c, typeprint.c, utils.c, valprint.c: Update.
	* win32-nat.c, xcoffsolib.c, cli/cli-cmds.c, cli/cli-dump.c: Update.
	* cli/cli-logging.c, tui/tui-layout.c, tui/tui-regs.c: Update.
	* tui/tui-stack.c, tui/tui-win.c: Update.
2005-02-15 15:49:28 +00:00
Andrew Cagney 1a966eabdf 2005-02-14 Andrew Cagney <cagney@gnu.org>
Mark up add_cmd.
	* arch-utils.c, avr-tdep.c, breakpoint.c, corefile.c: Update.
	* cp-abi.c, cp-namespace.c, cp-support.c, dummy-frame.c: Update.
	* exec.c, gnu-nat.c, go32-nat.c, hppa-tdep.c, infcmd.c: Update.
	* infrun.c, interps.c, macrocmd.c, maint.c, memattr.c: Update.
	* mips-tdep.c, ocd.c, osabi.c, printcmd.c, regcache.c: Update.
	* reggroups.c, remote-fileio.c, remote-rdi.c, remote.c: Update.
	* sol-thread.c, source.c, stack.c, symfile-mem.c: Update.
	* symfile.c, thread.c, tracepoint.c, valprint.c, value.c: Update.
	* win32-nat.c, cli/cli-cmds.c, cli/cli-dump.c: Update.
	* cli/cli-logging.c, tui/tui-regs.c: Update.
2005-02-14 18:10:11 +00:00