Commit Graph

157 Commits

Author SHA1 Message Date
Tom Tromey 9ac86b52da Remove make_cleanup_regcache_xfree
This removes make_cleanup_regcache_xfree in favor of using
std::unique_ptr as the return type of frame_save_as_regcache.

gdb/ChangeLog
2017-09-25  Tom Tromey  <tom@tromey.com>

	* spu-tdep.c (spu2ppu_sniffer): Update.
	* regcache.h (make_cleanup_regcache_xfree): Don't declare.
	* regcache.c (do_regcache_xfree, make_cleanup_regcache_xfree):
	Remove.
	* ppc-linux-tdep.c (ppu2spu_sniffer): Update.
	* mi/mi-main.c (mi_cmd_data_list_changed_registers): Update.
	* frame.h (frame_save_as_regcache): Return std::unique_ptr.
	* frame.c (frame_save_as_regcache): Return std::unique_ptr.
	(frame_pop): Update.
2017-09-25 19:54:07 -06:00
Tom Tromey c0e383c638 Remove regcache_xfree
This removes regcache_xfree in favor of plain "delete".

gdb/ChangeLog
2017-09-25  Tom Tromey  <tom@tromey.com>

	* spu-tdep.c (spu2ppu_dealloc_cache): Use delete.
	* regcache.h (regcache_xfree): Don't declare.
	* regcache.c (regcache_xfree): Remove.
	(do_regcache_xfree): Use delete.
	* ppc-linux-tdep.c (ppu2spu_dealloc_cache): Use delete.
	* linux-fork.c (free_fork): Use delete.
	(fork_save_infrun_state): Likewise.
	* jit.c (jit_dealloc_cache): Use delete.
	* infrun.c (discard_infcall_suspend_state): Use delete.
2017-09-25 19:54:06 -06:00
Tom Tromey 791199cc75 Remove regcache_xmalloc
This patch removes regcache_xmalloc in favor of plain "new".

gdb/ChangeLog
2017-09-25  Tom Tromey  <tom@tromey.com>

	* regcache.h (regcache_xmalloc): Don't declare.
	(regcache_raw_set_cached_value): Update comment.
	* regcache.c (regcache_xmalloc): Remove.
	* ppc-linux-tdep.c (ppu2spu_sniffer): Use new.
	* jit.c (jit_frame_sniffer): Use new.
	* frame.c (frame_save_as_regcache): Use new.
2017-09-25 19:54:05 -06:00
Yao Qi d654162044 Use DISABLE_COPY_AND_ASSIGN
We have many classes that copy cotr and assignment operator are deleted,
so this patch replaces these existing mechanical code with macro
DISABLE_COPY_AND_ASSIGN.

gdb:

2017-09-19  Yao Qi  <yao.qi@linaro.org>

	* annotate.h (struct annotate_arg_emitter): Use
	DISABLE_COPY_AND_ASSIGN.
	* common/refcounted-object.h (refcounted_object): Likewise.
	* completer.h (struct completion_result): Likewise.
	* dwarf2read.c (struct dwarf2_per_objfile): Likewise.
	* filename-seen-cache.h (filename_seen_cache): Likewise.
	* gdbcore.h (thread_section_name): Likewise.
	* gdb_regex.h (compiled_regex): Likewise.
	* gdbthread.h (scoped_restore_current_thread): Likewise.
	* inferior.h (scoped_restore_current_inferior): Likewise.
	* jit.c (jit_reader): Likewise.
	* linespec.h (struct linespec_result): Likewise.
	* mi/mi-parse.h (struct mi_parse): Likewise.
	* nat/fork-inferior.c (execv_argv): Likewise.
	* progspace.h (scoped_restore_current_program_space): Likewise.
	* python/python-internal.h (class gdbpy_enter): Likewise.
	* regcache.h (regcache): Likewise.
	* target-descriptions.c (struct tdesc_reg): Likewise.
	(struct tdesc_type): Likewise.
	(struct tdesc_feature): Likewise.
	* ui-out.h (ui_out_emit_type): Likewise.
2017-09-19 10:10:03 +01:00
Yao Qi cfb7e58b48 Simplify regcache_cpy and remove regcache::cpy_no_passthrough
Nowadays, regcache_cpy is used where src is read-only and dst is not
read-only, so the regcache_cpy can be simplified to handle this case only.
As a result, regcache::cpy_no_passthrough, which is about two read-only
regcache copy, is no longer used, remove it as well.

gdb:

2017-07-18  Yao Qi  <yao.qi@linaro.org>

	* regcache.c (regcache_cpy): Simplify it.
	(regcache::cpy_no_passthrough): Remove it.
	* regcache.h (cpy_no_passthrough): Remove it.
	(regcache_dup, regcache_cpy): Update comments.
2017-07-18 12:46:14 +01:00
Alan Hayward 4fa847d78e Remove MAX_REGISTER_SIZE from py-unwind.c
gdb/
	* remote.c (cached_reg): Move from here...
	* regcache.h (cached_reg): ...to here.
	* python/py-unwind.c (struct reg_info): Remove.
	(cached_frame_info): Use cached_reg_t.
	(pyuw_prev_register): Likewise.
	(pyuw_sniffer): Use cached_reg_t and allocate registers.
	(pyuw_dealloc_cache): Free all registers.
2017-06-22 14:10:34 +01:00
Yao Qi 6f98355cda extract/store integer function template
This patch converts functions extract_{unsigned,signed}_integer
to a function template extract_integer, which has two instantiations.  It
also does the similar changes to store__{unsigned,signed}_integer,
regcache::raw_read_{unsigned,signed}, regcache::raw_write_{unsigned,signed},
regcache::cooked_read_{unsigned,signed},
regcache::cooked_write_{unsigned,signed}.

This patch was posted here
https://sourceware.org/ml/gdb-patches/2017-05/msg00492.html but the
problem was fixed in a different way.  However, I think the patch is still
useful to shorten the code.

gdb:

2017-06-16  Alan Hayward  <alan.hayward@arm.com>
	    Pedro Alves  <palves@redhat.com>
	    Yao Qi  <yao.qi@linaro.org>

	* defs.h (RequireLongest): New.
	(extract_integer): Declare function template.
	(extract_signed_integer): Remove the declaration, but define it
	static inline.
	(extract_unsigned_integer): Likewise.
	(store_integer): Declare function template.
	(store_signed_integer): Remove the declaration, but define it
	static inline.
	(store_unsigned_integer): Likewise.
	* findvar.c (extract_integer): New function template.
	(extract_signed_integer): Remove.
	(extract_unsigned_integer): Remove.
	(extract_integer<LONGEST>, extract_integer<ULONGEST>): Explicit
	instantiations.
	(store_integer): New function template.
	(store_signed_integer): Remove.
	(store_unsigned_integer): Remove.
	(store_integer): Explicit instantiations.
	* regcache.c (regcache_raw_read_signed): Update.
	(regcache::raw_read): New function.
	(regcache::raw_read_signed): Remove.
	(regcache::raw_read_unsigned): Remove.
	(regcache_raw_read_unsigned): Update.
	(regcache_raw_write_unsigned): Update.
	(regcache::raw_write_signed): Remove.
	(regcache::raw_write): New function.
	(regcache_cooked_read_signed): Update.
	(regcache::raw_write_unsigned): Remove.
	(regcache::cooked_read_signed): Remove.
	(regcache_cooked_read_unsigned): Update.
	(regcache::cooked_read_unsigned): Remove.
	(regcache_cooked_write_signed): Update.
	(regcache_cooked_write_unsigned): Update.
	* regcache.h (regcache) <raw_read_signed>: Remove.
	<raw_write_signed, raw_read_unsigned, raw_write_unsigned>: Remove.
	<raw_read, raw_write>: New.
	<cooked_read_signed, cooked_write_signed>: Remove.
	<cooked_write_unsigned, cooked_read_unsigned>: Remove.
	<cooked_read, cooked_write>: New.
	* sh64-tdep.c (sh64_pseudo_register_read): Update.
	(sh64_pseudo_register_write): Update.
2017-06-16 15:38:42 +01:00
Alan Hayward b057297ab6 Add regcache raw_supply_integer and raw_collect_integer.
Use these to replace instances of MAX_REGISTER_SIZE.

	* defs.h (copy_integer_to_size): New declaration.
	* findvar.c (copy_integer_to_size): New function.
	(do_cint_test): New selftest function.
	(copy_integer_to_size_test): Likewise.
	(_initialize_findvar): Likewise.
	* mips-fbsd-tdep.c (mips_fbsd_supply_reg): Use raw_supply_integer.
	(mips_fbsd_collect_reg): Use raw_collect_integer.
	* mips-linux-tdep.c (supply_32bit_reg): Use raw_supply_integer.
	(mips64_fill_gregset): Use raw_collect_integer
	(mips64_fill_fpregset): Use raw_supply_integer.
	* regcache.c (regcache::raw_supply_integer): New function.
	(regcache::raw_collect_integer): Likewise.
	* regcache.h: (regcache::raw_supply_integer): New declaration.
	(regcache::raw_collect_integer): Likewise.
2017-05-26 17:07:52 +01:00
Yao Qi b77b02a5ca Add unit test to gdbarch methods register_to_value and value_to_register
This patch adds one unit test for gdbarch methods register_to_value and
value_to_register.  The test pass different combinations of {regnu, type}
to gdbarch_register_to_value and gdbarch_value_to_register.  In order
to do the test, add a new function create_new_frame to create a fake
frame.  It can be improved after we converted frame_info to class.

In order to isolate regcache (from target_ops operations on writing
registers, like target_store_registers), the sub-class of regcache in the
test override raw_write.  Also, in order to get the right regcache from
get_thread_arch_aspace_regcache, the sub-class of regcache inserts itself
to current_regcache.

Suppose I incorrectly modified the size of buffer as below,

@@ -1228,7 +1228,7 @@ ia64_register_to_value (struct frame_info *frame, int regnum,
                        int *optimizedp, int *unavailablep)
 {
   struct gdbarch *gdbarch = get_frame_arch (frame);
-  gdb_byte in[MAX_REGISTER_SIZE];
+  gdb_byte in[1];

   /* Convert to TYPE.  */
   if (!get_frame_register_bytes (frame, regnum, 0,

build GDB with "-fsanitize=address" and run unittest.exp, asan can detect
such error

==2302==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7fff98193870 at pc 0xbd55ea bp 0x7fff981935a0 sp 0x7fff98193598
WRITE of size 16 at 0x7fff98193870 thread T0
    #0 0xbd55e9 in frame_register_unwind(frame_info*, int, int*, int*, lval_type*, unsigned long*, int*, unsigned char*) /home/yao/SourceCode/gnu/gdb/git/gdb/frame.c:1119
    #1 0xbd58c8 in frame_register(frame_info*, int, int*, int*, lval_type*, unsigned long*, int*, unsigned char*) /home/yao/SourceCode/gnu/gdb/git/gdb/frame.c:1147
    #2 0xbd6e25 in get_frame_register_bytes(frame_info*, int, unsigned long, int, unsigned char*, int*, int*) /home/yao/SourceCode/gnu/gdb/git/gdb/frame.c:1427
    #3 0x70080a in ia64_register_to_value /home/yao/SourceCode/gnu/gdb/git/gdb/ia64-tdep.c:1236
    #4 0xbf570e in gdbarch_register_to_value(gdbarch*, frame_info*, int, type*, unsigned char*, int*, int*) /home/yao/SourceCode/gnu/gdb/git/gdb/gdbarch.c:2619
    #5 0xc05975 in register_to_value_test /home/yao/SourceCode/gnu/gdb/git/gdb/gdbarch-selftests.c:131

Or, even if GDB is not built with asan, GDB just crashes.

*** stack smashing detected ***: ./gdb terminated
Aborted (core dumped)

gdb:

2017-05-24  Yao Qi  <yao.qi@linaro.org>

	* Makefile.in (SFILES): Add gdbarch-selftests.c.
	(COMMON_OBS): Add gdbarch-selftests.o.
	* frame.c [GDB_SELF_TESTS] (create_new_frame): New function.
	* frame.h [GDB_SELF_TESTS] (create_new_frame): Declare.
	* gdbarch-selftests.c: New file.
	* regcache.h (regcache) <~regcache>: Mark it virtual if
	GDB_SELF_TEST.
	<raw_write>: Likewise.
2017-05-24 22:15:23 +01:00
Yao Qi e521e87e85 Move current_regcache to regcache::current_regcache
This patches moves global variable current_regcache to a class regcache
static variable (protected) so that the unit test I add in the following
patch can access it (by means of extending class regcache in unit test).

gdb:

2017-05-24  Yao Qi  <yao.qi@linaro.org>

	* regcache.c (current_regcache): Change it to
	regcache::current_regcache.
	(regcache_observer_target_changed): Update.
	(regcache_thread_ptid_changed): Make it a regcache static
	method.
	(regcache_thread_ptid_changed): Update.
	(class regcache_access): New.
	(current_regcache_test): Update.
	(_initialize_regcache): Update.
	* regcache.h: Include forward_list.
	(regcache): Declare regcache_thread_ptid_changed and declare
	registers_changed_ptid as friend.
2017-05-24 22:15:23 +01:00
Alan Hayward f81fdd350e Remove MAX_REGISTER_SIZE from frv-linux-tdep.c
gdb/
	* frv-linux-tdep.c (frv_linux_supply_gregset): Use raw_supply_zeroed.
	* regcache.c (regcache::raw_supply_zeroed): New function.
	* regcache.h (regcache::raw_supply_zeroed): New declaration.
2017-05-03 14:51:40 +01:00
Yao Qi deb1fa3eda Use tag dispatch regcache ctor in regcache_dup
This patch adds a tag dispatch ctor to create read-only regcache from
a write-through regcache, also this patch deletes copy ctor and
assignment operator.

gdb:

2017-04-28  Yao Qi  <yao.qi@linaro.org>
	    Pedro Alves  <palves@redhat.com>

	* regcache.c (regcache::regcache): New tag dispatch ctor.
	(do_cooked_read): Moved above.
	(regcache_dup): Use the tag dispatch ctor..
	* regcache.h (regcache): Declare ctor, delete copy ctor and
	assignment operator, remove friend regcache_dup.
2017-04-28 22:48:42 +01:00
Yao Qi b421c83cb8 Simplify regcache_dup
regcache_dup, in fact, is to create a readonly regcache from a
non-readonly regcache.  This patch adds an assert that src is not
readonly.

gdb:

2017-04-28  Yao Qi  <yao.qi@linaro.org>

	* regcache.c (regcache_dup): Assert !src->m_readonly_p and
	call method save instead of regcache_cpy.
	* regcache.h (struct regcache): Make regcache_dup a friend.
2017-04-28 22:48:42 +01:00
Yao Qi ef79d9a3c6 Class-fy regcache
This patch moves regcache declaration to regcache.h, and converts
regcache apis to member functions, for example, regcache_invalidate
is changed to regcache::invalidate.

This patch also add "m_" prefix to these private fields.

gdb:

2017-04-28  Yao Qi  <yao.qi@linaro.org>

	* regcache.c (struct regcache): Move to regcache.h
	(regcache::arch): New method.
	(regcache_get_ptid): Update.
	(get_regcache_arch): Call arch method.
	(get_regcache_aspace): Call method aspace.
	(register_buffer): Change it to method.
	(regcache_save): Change it to regcache::save.
	(regcache_restore): Likewise.
	(regcache_cpy_no_passthrough): Remove the declaration.
	(regcache_cpy): Call methods restore and cpy_no_passthrough.
	(regcache_cpy_no_passthrough): Change it to method
	cpy_no_passthrough.
	(regcache_register_status): Change it to method
	get_register_status.
	(regcache_invalidate): Change it to method invalidate.
	(regcache_thread_ptid_changed): Use methods ptid and set_ptid.
	(regcache_raw_update): Change it to method raw_update.
	(regcache_raw_read): Likewise.
	(regcache_raw_read_signed): Likewise.
	(regcache_raw_read_unsigned): Likewise.
	(regcache_raw_write_signed): Likewise.
	(regcache_raw_write_unsigned): Likewise.
	(regcache_cooked_read): Likewise.
	(regcache_cooked_read_value): Likewise.
	(regcache_cooked_read_signed): Likewise.
	(regcache_cooked_read_unsigned): Likewise.
	(regcache_cooked_write_signed): Likewise.
	(regcache_cooked_write_unsigned): Likewise.
	(regcache_raw_set_cached_value): Likewise.
	(regcache_raw_write): Likewise.
	(regcache_cooked_write): Likewise.
	(regcache_xfer_part): Likewise.
	(regcache_raw_read_part): Likewise.
	(regcache_raw_write_part): Likewise.
	(regcache_cooked_read_part): Likewise.
	(regcache_cooked_write_part): Likewise.
	(regcache_raw_supply): Likewise.
	(regcache_raw_collect): Likewise.
	(regcache_transfer_regset): Likewise.
	(regcache_supply_regset): Likewise.
	(regcache_collect_regset): Likewise.
	(regcache_debug_print_register): Likewise.
	(enum regcache_dump_what): Move it to regcache.h.
	(regcache_dump): Change it to method dump.
	* regcache.h (enum regcache_dump_what): New.
	(class regcache): New.
	* target.c (target_fetch_registers): Call method
	debug_print_register.
	(target_store_registers): Likewise.
2017-04-28 22:48:42 +01:00
Alan Hayward ed771251e1 Remove MAX_REGISTER_SIZE from target.c
gdb/
	* regcache.c (regcache_debug_print_register): New function.
	* regcache.h (regcache_debug_print_register): New declaration.
	* target.c (debug_print_register): Remove.
	(target_fetch_registers): Call regcache_debug_print_register.
	(target_store_registers): Likewise.
2017-03-24 16:53:05 +00:00
Simon Marchi ddaaf0fb86 Introduce regcache_get_ptid
This patch introduces the regcache_get_ptid function, which can be used
to retrieve the ptid a regcache is connected to.  It is used in
subsequent patches.

gdb/ChangeLog:

	* regcache.h (regcache_get_ptid): New function.
	* regcache.c (regcache_get_ptid): New function.
2017-03-13 18:51:38 -04:00
Alan Hayward 8e3681243c Remove MAX_REGISTER_SIZE from remote.c
gdb/
	* regcache.c (regcache_raw_update): New function.
	(regcache_raw_read): Move code to regcache_raw_update.
	* regcache.h (regcache_raw_update): New declaration.
	* remote.c (remote_prepare_to_store): Call regcache_raw_update.
2017-02-27 09:58:35 +00:00
Joel Brobecker 61baf725ec update copyright year range in GDB files
This applies the second part of GDB's End of Year Procedure, which
updates the copyright year range in all of GDB's files.

gdb/ChangeLog:

        Update copyright year range in all GDB files.
2017-01-01 10:52:34 +04:00
Yao Qi 9fd15b2e80 New regcache_raw_get_signed
This patch adds a new regcache api regcache_raw_get_signed.

gdb:

2016-11-22  Yao Qi  <yao.qi@linaro.org>

	* regcache.c (regcache_raw_get_signed): New function.
	* regcache.h (regcache_raw_get_signed): Declare.
2016-11-22 14:05:04 +00:00
Pedro Alves 20aa2c606e Extend JIT-reader test and fix GDB problems that exposes
The jit-reader.exp test isn't really exercising the jit-reader's
unwinder API at all.  This commit address that, and then fixes GDB
problems exposed.

- The custom JIT reader provided for the jit-reader.exp testcase
  always rejects the jitted function's frame...

  This is because the custom JIT reader in the testcase never ever
  sets state->code_begin/end, so the bounds check in
  gdb.base/jitreader.c:unwind_frame:

   if (this_ip >= state->code_end || this_ip < state->code_begin)
     return GDB_FAIL;

  tends to fail, unless you're "lucky" (because it references
  uninitialized data).

  The result is that GDB is always actually using a built-in unwinder
  for the jitted function.

- The provided unwinder doesn't do anything that GDB's built-in
  unwinder can't do.

  IOW, we can't really tell whether the JIT reader's unwinder is
  working or not.

  I fixed that by making the jitted function mangle its own stack
  pointer with a xor, and then teaching the jit unwinder to demangle
  it back (another xor).  So now "backtrace" with GDB's built-in
  unwinder fails while with the jit unwinder, it succeeds.

- GDB crashes after unloading the JIT reader, and flushing frames...

  I made the testcase use the "flushregs" command after unloading the
  JIT reader, to force the JIT frames to be flushed.  However, that
  crashes GDB...

  When reinit_frame_cache tears down a frame's cache, it calls its
  unwinder's dealloc_cache method, which for JIT frames ends up in
  jit.c:jit_dealloc_cache.  This function calls each of the frame's
  gdb_reg_value's "free" pointer:

   for (i = 0; i < gdbarch_num_regs (frame_arch); i++)
     if (priv_data->registers[i] && priv_data->registers[i]->free)
       priv_data->registers[i]->free (priv_data->registers[i]);

  and the problem is these gdb_reg_value instances have been returned
  by the JIT reader that has been already unloaded, and their "free"
  function pointers likely point to functions in the DSO that has
  already been unloaded...

  A fix for that could be to call reinit_frame_cache in
  jit_reader_unload_command _before_ unloading the jit reader DSO so
  that the jit reader is given a chance to clean up the gdb_reg_values
  before it is unloaded.  However, the fix for the point below makes
  this unnecessary, because it stops jit.c from keeping around
  gdb_reg_values in the first place.

- However, it still makes sense to clear the frame cache when loading
  or unloading a JIT unwinder.

  This makes testing a JIT unwinder a bit simpler.

- Not only the frame cache actually -- gdb is not unloading the
  jit-registered objfiles when the JIT reader is unloaded, and not
  loading the already-registered descriptors when a JIT reader is
  loaded.

  The new test exercises unloading the jit reader, loading it back
  again, and then making sure the JIT reader's unwinder works again.
  Without the unload/re-load of already-read descriptors, the newly
  loaded JIT would have no idea where the new function is, because
  it's stored at symbol read time.

- I added a couple "info frame" calls to the test, and that
  crashes GDB...

  The problem is that jit_frame_prev_register assumes it'll only be
  called for raw registers, so when it gets a pseudo register number,
  the "priv->registers[reg]" access is really an out-of-bounds access.

  To fix that, I made jit_frame_prev_register use
  gdbarch_pseudo_register_read_value for reading the pseudo-registers.
  However, that works with a regcache and we don't have one.  To fix
  that, I made the JIT unwinder store a regcache in its cache instead
  of an array of gdb_reg_value pointers.

gdb/ChangeLog:
2016-07-01  Pedro Alves  <palves@redhat.com>
	    Tom Tromey  <tom@tromey.com>

	* jit.c (jit_reader_load_command): Call reinit_frame_cache and
	jit_inferior_created_hook.
	(jit_reader_unload_command): Call reinit_frame_cache and
	jit_inferior_exit_hook.
	* jit.c (struct jit_unwind_private) <registers>: Delete field.
	<regcache>: New field.
	(jit_unwind_reg_set_impl): Set the register's value in the
	regcache.  Free the passed-in gdb_reg_value.
	(jit_dealloc_cache): Adjust to free the regcache.
	(jit_frame_sniffer): Allocate a regcache instead of an array of
	gdb_reg_value pointers.
	(jit_frame_this_id): Adjust.
	(jit_frame_prev_register): Read raw registers off of the regcache
	instead of from the gdb_reg_value pointer array.  Use
	gdbarch_pseudo_register_read_value to read pseudo registers.
	* regcache.c (regcache_raw_set_cached_value): New function,
	factored out from ...
	(regcache_raw_write): ... here.
	* regcache.h (regcache_raw_set_cached_value): Declare.

gdb/testsuite/ChangeLog:
2016-07-01  Pedro Alves  <palves@redhat.com>

	* gdb.base/jit-reader.exp (info_registers_current_frame): New
	procedure.
	(jit_reader_test): Test the jit reader's unwinder.
	* gdb.base/jithost.c (jit_function_00_code): New global.
	(main): Use memcpy to fill in the mmapped code, instead of poking
	bytes manually here.
	* gdb.base/jitreader.c (enum register_mapping) <AMD64_RBP>: New
	value.
	(read_debug_info): Save the function's range.
	(read_sp): New function.
	(unwind_frame): Use it.  Also unwind RBP.
	(get_frame_id): Use read_sp.
	(gdb_init_reader): Use calloc instead of malloc.
	* lib/gdb.exp (get_hexadecimal_valueof): Add optional 'test'
	parameter.  Use gdb_test_multiple.
2016-07-01 11:56:39 +01:00
Joel Brobecker 618f726fcb GDB copyright headers update after running GDB's copyright.py script.
gdb/ChangeLog:

        Update year range in copyright notice of all files.
2016-01-01 08:43:22 +04:00
Antoine Tremblay 68ce205943 Share regcache function regcache_raw_read_unsigned
This patch is in preparation for software single step support on ARM in
GDBServer. It adds a new shared function regcache_raw_read_unsigned and
regcache_raw_get_unsigned so that GDB and GDBServer can use the same call
to fetch a raw register into an integer.

No regressions, tested on ubuntu 14.04 ARMv7 and x86.
With gdbserver-{native,extended} / { -marm -mthumb }

gdb/ChangeLog:

	* Makefile.in (SFILES): Append common/common-regcache.c.
	(COMMON_OBS): Append common/common-regcache.o.
	(common-regcache.o): New rule.
	* common/common-regcache.h (register_status) New enum.
	(regcache_raw_read_unsigned): New declaration.
	* common/common-regcache.c: New file.
	* regcache.h (enum register_status): Move to common-regcache.h.
	(regcache_raw_read_unsigned): Likewise.
	(regcache_raw_get_unsigned): Likewise.

gdb/gdbserver/ChangeLog:

	* Makefile.in (SFILES): Append common/common-regcache.c.
	(OBS): Append common-regcache.o.
	(common-regcache.o): New rule.
	* regcache.c (init_register_cache): Initialize cache to
	REG_UNAVAILABLE.
	(regcache_raw_read_unsigned): New function.
	* regcache.h (REG_UNAVAILABLE, REG_VALID): Replaced by shared
	register_status enum.
2015-12-18 11:39:21 -05:00
Antoine Tremblay d0e59a6888 Refactor arm_software_single_step to use regcache
This patch is in preparation for software single step support on ARM in
GDBServer. It refactors arm_*_software_single_step and sub-functions to
use regcache instead of frame to access registers so that the code can be
shared more easily between GDB and GDBServer.

Note also that since the intention is at some point to get rid of frame
completely in that function, memory reads have also been replaced by
read_memory_unsigned_integer rather than get_frame_memory_unsigned.

No regressions, tested on ubuntu 14.04 ARMv7 and x86.
With gdbserver-{native,extended} / { -marm -mthumb }

gdb/ChangeLog:

	* arm-linux-tdep.c (arm_linux_sigreturn_next_pc_offset): New function.
	(arm_linux_sigreturn_next_pc): Likewise.
	(arm_linux_syscall_next_pc): Use regcache instead of frame.
	(arm_linux_software_single_step): Likewise.
	* arm-tdep.c (arm_is_thumb): New function.
	(shifted_reg_va): Use regcache instead of frame.
	(thumb_get_next_pc_raw): Likewise.
	(arm_get_next_pc_raw): Likewise.
	(arm_get_next_pc): Likewise.
	(thumb_deal_with_atomic_sequence_raw): Likewise.
	(arm_deal_with_atomic_sequence_raw): Likewise.
	(arm_deal_with_atomic_sequence): Likewise.
	(arm_software_single_step): Likewise.
	* arm-tdep.h (struct gdbarch_tdep): Use regcache for syscall_next_pc.
	(arm_get_next_pc): Use regcache.
	(arm_deal_with_atomic_sequence): Likewise.
	(arm_is_thumb): New declaration.
	* regcache.c (regcache_raw_get_unsigned): New function.
	* regcache.h (regcache_raw_get_unsigned): New function declaration.
2015-12-18 11:39:02 -05:00
Jan Kratochvil bd49952bd7 Make regcache_cpy_no_passthrough static
regcache_cpy_no_passthrough is no longer used for a standalone call.

gdb/ChangeLog
2015-05-13  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* regcache.c (regcache_cpy_no_passthrough): New declaration.
	(regcache_cpy_no_passthrough): Make it static, add function comment.
	* regcache.h (regcache_dup, regcache_cpy): Reduce/update their comment.
	(regcache_cpy_no_passthrough): Remove declaration.
2015-05-13 20:50:11 +02:00
Joel Brobecker 32d0add0a6 Update year range in copyright notice of all files owned by the GDB project.
gdb/ChangeLog:

        Update year range in copyright notice of all files.
2015-01-01 13:32:14 +04:00
Gary Benson 361c8ade9c Introduce common-regcache.h
This introduces common-regcache.h.  This contains two functions that
allow nat/linux-btrace.c to be simplified.  A better long term
solution would be unify the regcache code, but this is sufficient for
now.

gdb/ChangeLog:

	* common/common-regcache.h: New file.
	* Makefile.in (HFILES_NO_SRCDIR): Add common/common-regcache.h.
	* regcache.h: Include common-regcache.h.
	(regcache_read_pc): Don't declare.
	* regcache.c (get_thread_regcache_for_ptid): New function.
	* nat/linux-btrace.c: Don't include regcache.h.
	Include common-regcache.h.
	(perf_event_read_bts): Use get_thread_regcache_for_ptid.

gdb/gdbserver/ChangeLog:

	* regcache.h: Include common-regcache.h.
	(regcache_read_pc): Don't declare.
	* regcache.c (get_thread_regcache_for_ptid): New function.
2014-09-12 10:11:42 +01:00
Thomas Schwinge a01cbb490b Make gdb/regcache.h self-contained.
gdb/
	* regcache.h (struct regset): Declare.

Commit 0b3092721e added uses of struct regset to
gdb/regcache.h, but that struct is not declared in this file, and, as it
happens, also nowhere else in the #include chain on x86 GNU/Hurd.  This results
in warnings/errors such as:

    gcc-4.8 [...] ../../W._C._Handy/gdb/gdb.c
    In file included from ./nm.h:25:0,
                     from ../../W._C._Handy/gdb/defs.h:454,
                     from ../../W._C._Handy/gdb/gdb.c:19:
    ../../W._C._Handy/gdb/regcache.h:190:9: warning: 'struct regset' declared inside parameter list [enabled by default]
             size_t size);
             ^
    ../../W._C._Handy/gdb/regcache.h:190:9: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]
    ../../W._C._Handy/gdb/regcache.h:193:10: warning: 'struct regset' declared inside parameter list [enabled by default]
              int regnum, void *buf, size_t size);
              ^
2014-09-11 22:39:01 +02:00
Andreas Arnez 0b3092721e regcache: Add functions suitable for regset_supply/collect.
These functions are intended to suit all targets that don't require too
special logic in their regset supply/collect methods.  Having such
generic functions helps reducing target-specific complexity.
2014-08-07 17:31:48 +02:00
Joel Brobecker ecd75fc8ee Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
Joel Brobecker 28e7fd6234 Update years in copyright notice for the GDB files.
Two modifications:
  1. The addition of 2013 to the copyright year range for every file;
  2. The use of a single year range, instead of potentially multiple
     year ranges, as approved by the FSF.
2013-01-01 06:33:28 +00:00
Joel Brobecker 0b30217134 Copyright year update in most files of the GDB Project.
gdb/ChangeLog:

        Copyright year update in most files of the GDB Project.
2012-01-04 08:17:56 +00:00
David S. Miller 349d138559 Fix regcache_restore() handling of unavailable regs.
* regcache.c (regcache_restore): Do not write unavailable regs, mark
	static.
	* regcache.h (regcache_restore): Remove declaration.
2011-10-11 18:35:26 +00:00
Yao Qi e2d966398c gdb/
* infrun.c (displaced_step_fixup): Move some code ...
	(displaced_step_restore): ... here.  New function.
	(handle_inferior_event): Cleanup displaced stepping state for both
	child and parent when get forked or vforked event.
	* regcache.c (get_thread_arch_aspace_regcache): New function.
	get_thread_arch_regcache (): Call it.
2011-09-17 13:29:32 +00:00
Tom Tromey 3543a589b2 gdb
* amd64-tdep.c (amd64_pseudo_register_read_value): Rename
	from amd64_pseudo_register_read.  Change arguments.  Call
	mark_value_bytes_unavailable when needed.
	(amd64_init_abi): Use set_gdbarch_pseudo_register_read_value, not
	set_gdbarch_pseudo_register_read.
	* sentinel-frame.c (sentinel_frame_prev_register): Use
	regcache_cooked_read_value.
	* regcache.h (regcache_cooked_read_value): Declare.
	* regcache.c (regcache_cooked_read_value): New function.
	(regcache_cooked_read): Call
	gdbarch_pseudo_register_read_value if available.
	* i386-tdep.h (i386_pseudo_register_read_value): Declare.
	(i386_pseudo_register_read): Remove.
	* i386-tdep.c (i386_pseudo_register_read_into_value): Rename from
	i386_pseudo_register_read.  Change arguments.  Call
	mark_value_bytes_unavailable when needed.
	(i386_pseudo_register_read_value): New function.
	(i386_gdbarch_init): Call set_gdbarch_pseudo_register_read_value,
	not set_gdbarch_pseudo_register_read.
	* gdbarch.sh (pseudo_register_read_value): New method.
	* gdbarch.c, gdbarch.h: Rebuild.
	* findvar.c (value_from_register): Call get_frame_register_value.
gdb/testsuite
	* gdb.dwarf2/typeddwarf.c: XFAIL 'z' on x86-64.
	* gdb.dwarf2/typeddwarf.exp (xfail-gdb-test): Add arch_pattern
	argument.
	* gdb.dwarf2/typeddwarf-amd64.S: New file.
2011-07-22 15:31:52 +00:00
Pedro Alves 05d1431c1e gdb/
* regcache.h (regcache_raw_read, regcache_raw_read_signed)
	(regcache_raw_read_unsigned, regcache_raw_read_signed)
	(regcache_raw_read_unsigned, regcache_raw_read_part)
	(regcache_cooked_read, regcache_cooked_read_signed)
	(regcache_cooked_read_unsigned, regcache_cooked_read_part)
	(regcache_cooked_read_ftype): Change return to enum
	register_status.
	* regcache.c: Include exceptions.h
	(regcache_save): Adjust to handle REG_UNAVAILABLE registers.
	(do_cooked_read): Change return to enum register_status.  Always
	forward to regcache_cooked_read.
	(regcache_raw_read): Change return to enum register_status.  If
	the register is not REG_VALID, memset the buffer.  Return the
	register's status.
	(regcache_raw_read_signed): Handle non-REG_VALID registers and
	return the register's status.
	(regcache_raw_read_unsigned): Ditto.
	(regcache_cooked_read): Change return to enum register_status.
	Assert that with read-only regcaches, the register's status must
	be known.  If the regcache is read-only, and the register is not
	REG_VALID, memset the buffer.  Return the register's status.
	(regcache_cooked_read_signed): Change return to enum
	register_status.  Handle non-REG_VALID registers and return the
	register's status.
	(regcache_cooked_read_unsigned): Change return to enum
	register_status.  Handle non-REG_VALID registers and return the
	register's status.
	(regcache_xfer_part, regcache_raw_read_part)
	(regcache_cooked_read_part): Change return to enum
	register_status.  Return the register's status.
	(regcache_read_pc): Throw NOT_AVAILABLE_ERROR if the register is
	unavailable.
	(regcache_dump): Handle unavailable cooked registers.
	* frame.c (do_frame_register_read): Adjust interface to match
	regcache_cooked_read_ftype.
	* gdbarch.sh (pseudo_register_read): Change return to enum
	register_status.
	* gdbarch.h, gdbarch.c: Regenerate.

	* i386-tdep.h (i386_pseudo_register_read): Change return to enum
	register_status.
	* i386-tdep.c (i386_pseudo_register_read): Change return to enum
	register_status.  If reading a raw register indicates the raw
	register is not valid, return the raw register's status,
	otherwise, return REG_VALID.
	* amd64-tdep.c (amd64_pseudo_register_read): Change return to enum
	register_status.  Handle non-REG_VALID raw registers and return
	the register's status.
	* arm-tdep.c (arm_neon_quad_read)
	(arm_pseudo_read): Change return to enum register_status.  Handle
	non-REG_VALID raw registers and return the register's status.
	* avr-tdep.c (avr_pseudo_register_read): Ditto.
	* frv-tdep.c (frv_pseudo_register_read): Ditto.
	* h8300-tdep.c (h8300_pseudo_register_read): Ditto.
	* hppa-tdep.c (hppa_pseudo_register_read): Ditto.
	* m32c-tdep.c (m32c_move_reg_t): Change return to enum
	register_status.
	(m32c_raw_read, m32c_raw_write, m32c_banked_read)
	(m32c_banked_write, m32c_sb_read, m32c_sb_write, m32c_part_read)
	(m32c_part_write, m32c_cat_read, m32c_cat_write)
	(m32c_r3r2r1r0_read, m32c_r3r2r1r0_write)
	(m32c_pseudo_register_read): Change return to enum
	register_status.  Adjust.
	* m68hc11-tdep.c (m68hc11_pseudo_register_read): Change return to
	enum register_status.  Return the register's status.
	* mep-tdep.c (mep_pseudo_cr32_read): Change return to enum
	register_status.  Return the register's status.
	(mep_pseudo_cr64_read, mep_pseudo_register_read): Ditto.
	* mips-tdep.c (mips_pseudo_register_read): Ditto.
	* mt-tdep.c (mt_pseudo_register_read): Ditto.
	* rs6000-tdep.c (move_ev_register_func): New typedef.
	(e500_move_ev_register): Use it.  Change return to enum
	register_status.  Return the register's status.
	(do_regcache_raw_read): New function.
	(do_regcache_raw_write): New function.
	(e500_pseudo_register_read): Change return to enum
	register_status.  Return the register's status.  Use
	do_regcache_raw_read.
	(e500_pseudo_register_write): Adjust.  Use do_regcache_raw_write.
	(dfp_pseudo_register_read): Change return to enum register_status.
	Return the register's status.
	(vsx_pseudo_register_read): Ditto.
	(efpr_pseudo_register_read): Ditto.
	(rs6000_pseudo_register_read): Ditto.
	* s390-tdep.c (s390_pseudo_register_read): Change return to enum
	register_status.  Return the register's status.
	* sh64-tdep.c (pseudo_register_read_portions): New function.
	(sh64_pseudo_register_read): Change return to enum
	register_status.  Use pseudo_register_read_portions.  Return the
	register's status.
	* ia64-tdep.c (ia64_pseudo_register_read): Change return to enum
	register_status.  Return the register's status.
	* sh-tdep.c (pseudo_register_read_portions): New function.
	(sh_pseudo_register_read): Change return to enum register_status.
	Use pseudo_register_read_portions.  Return the register's status.
	* sparc-tdep.c (sparc32_pseudo_register_read): Change return to
	enum register_status.  Return the register's status.
	* sparc64-tdep.c (sparc64_pseudo_register_read): Ditto.
	* spu-tdep.c (spu_pseudo_register_read_spu)
	(spu_pseudo_register_read): Ditto.
	* xtensa-tdep.c (xtensa_register_read_masked)
	(xtensa_pseudo_register_read): Ditto.
	* bfin-tdep.c (bfin_pseudo_register_read): Ditto.
2011-03-18 18:38:44 +00:00
Pedro Alves ee99023e12 * regcache.c (struct regcache_descr): Rename
sizeof_raw_register_valid_p field to sizeof_raw_register_status,
	and sizeof_cooked_register_valid_p to
	sizeof_cooked_register_status.
	(init_regcache_descr): Adjust.
	(struct regcache): Rename register_valid_p field to
	register_status.
	(regcache_xmalloc_1, regcache_xfree, regcache_save)
	(do_cooked_read): Adjust.
	(regcache_valid_p): Rename to ...
	(regcache_register_status): ... this.  Adjust.
	(regcache_invalidate): Adjust.
	(regcache_raw_read, regcache_cooked_read, regcache_raw_write):
	Adjust.
	(regcache_raw_supply): Adjust.  If buf i NULL, mark the register
	as unavailable, not valid.
	(regcache_dump): Adjust.
	* regcache.h (enum register_status): New.
	(regcache_register_status): Declare.
	(regcache_invalidate): Delete declaration.
	* corelow.c (get_core_registers): Adjust.
	* tracepoint.c (tfile_fetch_registers): Adjust.
	* trad-frame.c (REG_VALUE): Rename to ...
	(TF_REG_VALUE): ... this.
	(REG_UNKNOWN): Rename to ...
	(TF_REG_UNKNOWN): ... this.
	(trad_frame_set_value, trad_frame_set_unknown): Adjust.
	* mi/mi-main.c (register_changed_p): Adjust.
2011-01-25 12:47:25 +00:00
Pedro Alves 99e42fd82a * regcache.c (struct regcache_descr): Remove outdated comment.
(init_regcache_descr): Remove sizeof_raw_register_valid_p
	overallocate hack.
	(regcache_xmalloc): Rename to ...
	(regcache_xmalloc_1): ... this.  Add `readonly_p' parameter.
	Allocate the regcache type accordingly.
	(regcache_xmalloc): New as wrapper around regcache_xmalloc_1.
	(regcache_xfree): Asser the source is also readonly.  Copy sizeof
	cooked registers, not raw.
	(regcache_dup_no_passthrough): Delete.
	(get_thread_arch_regcache): Use regcache_xmalloc_1.
	* h8300-tdep.c (h8300_push_dummy_call): Tweak comment to not
	mention obsolete write_register_bytes.
	* regcache.h (regcache_dup_no_passthrough): Delete declaration.
2011-01-25 12:13:20 +00:00
Michael Snyder 0df8b4180a 2011-01-10 Michael Snyder <msnyder@vmware.com>
* nto-procfs.c: Comment cleanup, mostly periods and spaces.
	* nto-tdep.c: Ditto.
	* nto-tdep.h: Ditto.
	* objc-exp.y: Ditto.
	* objc-lang.c: Ditto.
	* objfiles.c: Ditto.
	* objfiles.h: Ditto.
	* observer.c: Ditto.
	* opencl-lang.c: Ditto.
	* osabi.c: Ditto.
	* parse.c: Ditto.
	* parser-defs.h: Ditto.
	* p-exp.y: Ditto.
	* p-lang.c: Ditto.
	* posix-hdep.c: Ditto.
	* ppcbug-rom.c: Ditto.
	* ppc-linux-nat.c: Ditto.
	* ppc-linux-tdep.c: Ditto.
	* ppc-linux-tdep.h: Ditto.
	* ppcnbsd-tdep.c: Ditto.
	* ppcobsd-tdep.c: Ditto.
	* ppcobsd-tdep.h: Ditto.
	* ppc-sysv-tdep.c: Ditto.
	* ppc-tdep.h: Ditto.
	* printcmd.c: Ditto.
	* proc-abi.c: Ditto.
	* proc-flags.c: Ditto.
	* procfs.c: Ditto.
	* proc-utils.h: Ditto.
	* progspace.h: Ditto.
	* prologue-value.c: Ditto.
	* prologue-value.h: Ditto.
	* psympriv.h: Ditto.
	* psymtab.c: Ditto.
	* p-typeprint.c: Ditto.
	* p-valprint.c: Ditto.
	* ravenscar-sparc-thread.c: Ditto.
	* ravenscar-thread.c: Ditto.
	* ravenscar-thread.h: Ditto.
	* record.c: Ditto.
	* regcache.c: Ditto.
	* regcache.h: Ditto.
	* remote.c: Ditto.
	* remote-fileio.c: Ditto.
	* remote-fileio.h: Ditto.
	* remote.h: Ditto.
	* remote-m32r-sdi.c: Ditto.
	* remote-mips.c: Ditto.
	* remote-sim.c: Ditto.
	* rs6000-aix-tdep.c: Ditto.
	* rs6000-nat.c: Ditto.
	* rs6000-tdep.c: Ditto.
2011-01-10 20:38:51 +00:00
Michael Snyder 3e43a32aaa 2011-01-05 Michael Snyder <msnyder@vmware.com>
* addrmap.c: Shorten lines of >= 80 columns.
	* arch-utils.c: Ditto.
	* arch-utils.h: Ditto.
	* ax-gdb.c: Ditto.
	* ax-general.c: Ditto.
	* bcache.c: Ditto.
	* blockframe.c: Ditto.
	* breakpoint.c: Ditto.
	* buildsym.c: Ditto.
	* c-lang.c: Ditto.
	* c-typeprint.c: Ditto.
	* charset.c: Ditto.
	* coffread.c: Ditto.
	* command.h: Ditto.
	* corelow.c: Ditto.
	* cp-abi.c: Ditto.
	* cp-namespace.c: Ditto.
	* cp-support.c: Ditto.
	* dbug-rom.c: Ditto.
	* dbxread.c: Ditto.
	* defs.h: Ditto.
	* dfp.c: Ditto.
	* dfp.h: Ditto.
	* dictionary.c: Ditto.
	* disasm.c: Ditto.
	* doublest.c: Ditto.
	* dwarf2-frame.c: Ditto.
	* dwarf2expr.c: Ditto.
	* dwarf2loc.c: Ditto.
	* dwarf2read.c: Ditto.
	* elfread.c: Ditto.
	* eval.c: Ditto.
	* event-loop.c: Ditto.
	* event-loop.h: Ditto.
	* exceptions.h: Ditto.
	* exec.c: Ditto.
	* expprint.c: Ditto.
	* expression.h: Ditto.
	* f-lang.c: Ditto.
	* f-valprint.c: Ditto.
	* findcmd.c: Ditto.
	* frame-base.c: Ditto.
	* frame-unwind.c: Ditto.
	* frame-unwind.h: Ditto.
	* frame.c: Ditto.
	* frame.h: Ditto.
	* gcore.c: Ditto.
	* gdb-stabs.h: Ditto.
	* gdb_assert.h: Ditto.
	* gdb_dirent.h: Ditto.
	* gdb_obstack.h: Ditto.
	* gdbcore.h: Ditto.
	* gdbtypes.c: Ditto.
	* gdbtypes.h: Ditto.
	* inf-ttrace.c: Ditto.
	* infcall.c: Ditto.
	* infcmd.c: Ditto.
	* inflow.c: Ditto.
	* infrun.c: Ditto.
	* inline-frame.h: Ditto.
	* language.c: Ditto.
	* language.h: Ditto.
	* libunwind-frame.c: Ditto.
	* libunwind-frame.h: Ditto.
	* linespec.c: Ditto.
	* linux-nat.c: Ditto.
	* linux-nat.h: Ditto.
	* linux-thread-db.c: Ditto.
	* machoread.c: Ditto.
	* macroexp.c: Ditto.
	* macrotab.c: Ditto.
	* main.c: Ditto.
	* maint.c: Ditto.
	* mdebugread.c: Ditto.
	* memattr.c: Ditto.
	* minsyms.c: Ditto.
	* monitor.c: Ditto.
	* monitor.h: Ditto.
	* objfiles.c: Ditto.
	* objfiles.h: Ditto.
	* osabi.c: Ditto.
	* p-typeprint.c: Ditto.
	* p-valprint.c: Ditto.
	* parse.c: Ditto.
	* printcmd.c: Ditto.
	* proc-events.c: Ditto.
	* procfs.c: Ditto.
	* progspace.c: Ditto.
	* progspace.h: Ditto.
	* psympriv.h: Ditto.
	* psymtab.c: Ditto.
	* record.c: Ditto.
	* regcache.c: Ditto.
	* regcache.h: Ditto.
	* remote-fileio.c: Ditto.
	* remote.c: Ditto.
	* ser-mingw.c: Ditto.
	* ser-tcp.c: Ditto.
	* ser-unix.c: Ditto.
	* serial.c: Ditto.
	* serial.h: Ditto.
	* solib-frv.c: Ditto.
	* solib-irix.c: Ditto.
	* solib-osf.c: Ditto.
	* solib-pa64.c: Ditto.
	* solib-som.c: Ditto.
	* solib-sunos.c: Ditto.
	* solib-svr4.c: Ditto.
	* solib-target.c: Ditto.
	* solib.c: Ditto.
	* somread.c: Ditto.
	* source.c: Ditto.
	* stabsread.c: Ditto.
	* stabsread.c: Ditto.
	* stack.c: Ditto.
	* stack.h: Ditto.
	* symfile-mem.c: Ditto.
	* symfile.c: Ditto.
	* symfile.h: Ditto.
	* symmisc.c: Ditto.
	* symtab.c: Ditto.
	* symtab.h: Ditto.
	* target-descriptions.c: Ditto.
	* target-memory.c: Ditto.
	* target.c: Ditto.
	* target.h: Ditto.
	* terminal.h: Ditto.
	* thread.c: Ditto.
	* top.c: Ditto.
	* tracepoint.c: Ditto.
	* tracepoint.h: Ditto.
	* ui-file.c: Ditto.
	* ui-file.h: Ditto.
	* ui-out.h: Ditto.
	* user-regs.c: Ditto.
	* user-regs.h: Ditto.
	* utils.c: Ditto.
	* valarith.c: Ditto.
	* valops.c: Ditto.
	* valprint.c: Ditto.
	* valprint.h: Ditto.
	* value.c: Ditto.
	* varobj.c: Ditto.
	* varobj.h: Ditto.
	* vec.h: Ditto.
	* xcoffread.c: Ditto.
	* xcoffsolib.c: Ditto.
	* xcoffsolib.h: Ditto.
	* xml-syscall.c: Ditto.
	* xml-tdesc.c: Ditto.
2011-01-05 22:22:53 +00:00
Joel Brobecker 7b6bb8daac run copyright.sh for 2011. 2011-01-01 15:34:07 +00:00
Pedro Alves e66408edfd PR gdb/11557
gdb/
	* regcache.c (registers_changed): Rename to ...
	(registers_changed_ptid): ... this, and only delete register cache
	entries matching the ptid filter argument.
	(registers_changed): Reimplement on top of registers_changed_ptid.
	* regcache.h (registers_changed_ptid): Declare.
	* target.c (target_resume): Flush register caches.

	gdb/testsuite/
	* gdb.mi/mi-ns-stale-regcache.exp, gdb.mi/ns-stale-regcache.c: New
	files.
2010-04-29 16:33:16 +00:00
Daniel Jacobowitz d37346f037 * regcache.c (regcache_xmalloc): Add aspace argument. Use it
for the new regcache.  All callers updated.
	(regcache_cpy, regcache_cpy_no_passthrough): Do not set aspace here.
	(get_thread_arch_regcache): Do not set aspace here.
	* regcache.h (regcache_xmalloc): Update declaration.

	* frame.c, infcall.c, ppc-linux-tdep.c: Calls to
	regcache_xmalloc updated.
2010-01-28 22:07:58 +00:00
Joel Brobecker 4c38e0a4fc Update copyright year in most headers.
Automatic update by copyright.sh.
2010-01-01 07:32:07 +00:00
Pedro Alves 6c95b8df7f 2009-10-19 Pedro Alves <pedro@codesourcery.com>
Stan Shebs	<stan@codesourcery.com>

	Add base multi-executable/process support to GDB.

	gdb/
	* Makefile.in (SFILES): Add progspace.c.
	(COMMON_OBS): Add progspace.o.
	* progspace.h: New.
	* progspace.c: New.

	* breakpoint.h (struct bp_target_info) <placed_address_space>: New
	field.
	(struct bp_location) <pspace>: New field.
	(struct breakpoint) <pspace>: New field.
	(bpstat_stop_status, breakpoint_here_p)
	(moribund_breakpoint_here_p, breakpoint_inserted_here_p)
	(regular_breakpoint_inserted_here_p)
	(software_breakpoint_inserted_here_p, breakpoint_thread_match)
	(set_default_breakpoint): Adjust prototypes.
	(remove_breakpoints_pid, breakpoint_program_space_exit): Declare.
	(insert_single_step_breakpoint, deprecated_insert_raw_breakpoint):
	Adjust prototypes.
	* breakpoint.c (executing_startup): Delete.
	(default_breakpoint_sspace): New.
	(breakpoint_restore_shadows): Skip if the address space doesn't
	match.
	(update_watchpoint): Record the frame's program space in the
	breakpoint location.
	(insert_bp_location): Record the address space in target_info.
	Adjust to pass the symbol space to solib_name_from_address.
	(breakpoint_program_space_exit): New.
	(insert_breakpoint_locations): Switch the symbol space and thread
	when inserting breakpoints.  Don't insert breakpoints in a vfork
	parent waiting for vfork done if we're not attached to the vfork
	child.
	(remove_breakpoints_pid): New.
	(reattach_breakpoints): Switch to a thread of PID.  Ignore
	breakpoints of other symbol spaces.
	(create_internal_breakpoint): Store the symbol space in the sal.
	(create_longjmp_master_breakpoint): Iterate over all symbol
	spaces.
	(update_breakpoints_after_exec): Ignore breakpoints for other
	symbol spaces.
	(remove_breakpoint): Rename to ...
	(remove_breakpoint_1): ... this.  Pass the breakpoints symbol
	space to solib_name_from_address.
	(remove_breakpoint): New.
	(mark_breakpoints_out): Ignore breakpoints from other symbol
	spaces.
	(breakpoint_init_inferior): Ditto.
	(breakpoint_here_p): Add an address space argument and adjust to
	use breakpoint_address_match.
	(moribund_breakpoint_here_p): Ditto.
	(regular_breakpoint_inserted_here_p): Ditto.
	(breakpoint_inserted_here_p): Ditto.
	(software_breakpoint_inserted_here_p): Ditto.
	(breakpoint_thread_match): Ditto.
	(bpstat_check_location): Ditto.
	(bpstat_stop_status): Ditto.
	(print_breakpoint_location): If there's a location to print,
	switch the current symbol space.
	(print_one_breakpoint_location): Add `allflag' argument.
	(print_one_breakpoint): Ditto.	Adjust.
	(do_captured_breakpoint_query): Adjust.
	(breakpoint_1): Adjust.
	(breakpoint_has_pc): Also match the symbol space.
	(describe_other_breakpoints): Add a symbol space argument and
	adjust.
	(set_default_breakpoint): Add a symbol space argument.	Set
	default_breakpoint_sspace.
	(breakpoint_address_match): New.
	(check_duplicates_for): Add an address space argument, and adjust.
	(set_raw_breakpoint): Record the symbol space in the location and
	in the breakpoint.
	(set_longjmp_breakpoint): Skip longjmp master breakpoints from
	other symbol spaces.
	(remove_thread_event_breakpoints, remove_solib_event_breakpoints)
	(disable_breakpoints_in_shlibs): Skip breakpoints from other
	symbol spaces.
	(disable_breakpoints_in_unloaded_shlib): Match symbol spaces.
	(create_catchpoint): Set the symbol space in the sal.
	(disable_breakpoints_before_startup): Skip breakpoints from other
	symbol spaces.	Set executing_startup in the current symbol space.
	(enable_breakpoints_after_startup): Clear executing_startup in the
	current symbol space.  Skip breakpoints from other symbol spaces.
	(clone_momentary_breakpoint): Also copy the symbol space.
	(add_location_to_breakpoint): Set the location's symbol space.
	(bp_loc_is_permanent): Switch thread and symbol space.
	(create_breakpoint): Adjust.
	(expand_line_sal_maybe): Expand comment to mention symbol spaces.
	Switch thread and symbol space when reading memory.
	(parse_breakpoint_sals): Set the symbol space in the sal.
	(break_command_really): Ditto.
	(skip_prologue_sal): Switch and space.
	(resolve_sal_pc): Ditto.
	(watch_command_1): Record the symbol space in the sal.
	(create_ada_exception_breakpoint): Adjust.
	(clear_command): Adjust.  Match symbol spaces.
	(update_global_location_list): Use breakpoint_address_match.
	(breakpoint_re_set_one): Switch thread and space.
	(breakpoint_re_set): Save symbol space.
	(breakpoint_re_set_thread): Also reset the symbol space.
	(deprecated_insert_raw_breakpoint): Add an address space argument.
	Adjust.
	(insert_single_step_breakpoint): Ditto.
	(single_step_breakpoint_inserted_here_p): Ditto.
	(clear_syscall_counts): New.
	(_initialize_breakpoint): Install it as inferior_exit observer.

	* exec.h: Include "progspace.h".
	(exec_bfd, exec_bfd_mtime): New defines.
	(exec_close): Declare.
	* exec.c: Include "gdbthread.h" and "progspace.h".
	(exec_bfd, exec_bfd_mtime, current_target_sections_1): Delete.
	(using_exec_ops): New.
	(exec_close_1): Rename to exec_close, and make public.
	(exec_close): Rename to exec_close_1, and adjust all callers.  Add
	description.  Remove target sections and close executables from
	all program spaces.
	(exec_file_attach): Add comment.
	(add_target_sections): Check on `using_exec_ops' to check if the
	target should be pushed.
	(remove_target_sections): Only unpush the target if there are no
	more target sections in any symbol space.
	* gdbcore.h: Include "exec.h".
	(exec_bfd, exec_bfd_mtime): Remove declarations.

	* frame.h (get_frame_program_space, get_frame_address_space)
	(frame_unwind_program_space): Declare.
	* frame.c (struct frame_info) <pspace, aspace>: New fields.
	(create_sentinel_frame): Add program space argument.  Set the
	pspace and aspace fields of the frame object.
	(get_current_frame, create_new_frame): Adjust.
	(get_frame_program_space): New.
	(frame_unwind_program_space): New.
	(get_frame_address_space): New.
	* stack.c (print_frame_info): Adjust.
	(print_frame): Use the frame's program space.

	* gdbthread.h (any_live_thread_of_process): Declare.
	* thread.c (any_live_thread_of_process): New.
	(switch_to_thread): Switch the program space as well.
	(restore_selected_frame): Don't warn if trying to restore frame
	level 0.

	* inferior.h: Include "progspace.h".
	(detach_fork): Declare.
	(struct inferior) <removable, aspace, pspace>
	<vfork_parent, vfork_child, pending_detach>
	<waiting_for_vfork_done>: New fields.
	<terminal_info>: Remove field.
	<data, num_data>: New fields.
	(register_inferior_data, register_inferior_data_with_cleanup)
	(clear_inferior_data, set_inferior_data, inferior_data): Declare.
	(exit_inferior, exit_inferior_silent, exit_inferior_num_silent)
	(inferior_appeared): Declare.
	(find_inferior_pid): Typo.
	(find_inferior_id, find_inferior_for_program_space): Declare.
	(set_current_inferior, save_current_inferior, prune_inferiors)
	(number_of_inferiors): Declare.
	(inferior_list): Declare.
	* inferior.c: Include "gdbcore.h" and "symfile.h".
	(inferior_list): Make public.
	(delete_inferior_1): Always delete thread silently.
	(find_inferior_id): Make public.
	(current_inferior_): New.
	(current_inferior): Use it.
	(set_current_inferior): New.
	(restore_inferior): New.
	(save_current_inferior): New.
	(free_inferior): Free the per-inferior data.
	(add_inferior_silent): Allocate per-inferior data.
	Call inferior_appeared.
	(delete_threads_of_inferior): New.
	(delete_inferior_1): Adjust interface to take an inferior pointer.
	(delete_inferior): Adjust.
	(delete_inferior_silent): Adjust.
	(exit_inferior_1): New.
	(exit_inferior): New.
	(exit_inferior_silent): New.
	(exit_inferior_num_silent): New.
	(detach_inferior): Adjust.
	(inferior_appeared): New.
	(discard_all_inferiors): Adjust.
	(find_inferior_id): Make public.  Assert pid is not zero.
	(find_inferior_for_program_space): New.
	(have_inferiors): Check if we have any inferior with pid not zero.
	(have_live_inferiors): Go over all pushed targets looking for
	process_stratum.
	(prune_inferiors): New.
	(number_of_inferiors): New.
	(print_inferior): Add executable column.  Print vfork parent/child
	relationships.
	(inferior_command): Adjust to cope with not running inferiors.
	(remove_inferior_command): New.
	(add_inferior_command): New.
	(clone_inferior_command): New.
	(struct inferior_data): New.
	(struct inferior_data_registration): New.
	(struct inferior_data_registry): New.
	(inferior_data_registry): New.
	(register_inferior_data_with_cleanup): New.
	(register_inferior_data): New.
	(inferior_alloc_data): New.
	(inferior_free_data): New.
	(clear_inferior_data): New.
	(set_inferior_data): New.
	(inferior_data): New.
	(initialize_inferiors): New.
	(_initialize_inferiors): Register "add-inferior",
	"remove-inferior" and "clone-inferior" commands.

	* objfiles.h: Include "progspace.h".
	(struct objfile) <pspace>: New field.
	(symfile_objfile, object_files): Don't declare.
	(ALL_PSPACE_OBJFILES): New.
	(ALL_PSPACE_OBJFILES_SAFE): New.
	(ALL_OBJFILES, ALL_OBJFILES_SAFE): Adjust.
	(ALL_PSPACE_SYMTABS): New.
	(ALL_PRIMARY_SYMTABS): Adjust.
	(ALL_PSPACE_PRIMARY_SYMTABS): New.
	(ALL_PSYMTABS): Adjust.
	(ALL_PSPACE_PSYMTABS): New.
	* objfiles.c (object_files, symfile_objfile): Delete.
	(struct objfile_sspace_info): New.
	(objfiles_pspace_data): New.
	(objfiles_pspace_data_cleanup): New.
	(get_objfile_pspace_data): New.
	(objfiles_changed_p): Delete.
	(allocate_objfile): Set the objfile's program space.  Adjust to
	reference objfiles_changed_p in pspace data.
	(free_objfile): Adjust to reference objfiles_changed_p in pspace
	data.
	(objfile_relocate): Ditto.
	(update_section_map): Add pspace argument.  Adjust to iterate over
	objfiles in the passed in pspace.
	(find_pc_section): Delete sections and num_sections statics.
	Adjust to refer to program space's objfiles_changed_p.	Adjust to
	refer to sections and num_sections store in the objfile's pspace
	data.
	(objfiles_changed): Adjust to reference objfiles_changed_p in
	pspace data.
	(_initialize_objfiles): New.
	* linespec.c (decode_all_digits, decode_dollar): Set the sal's
	program space.
	* source.c (current_source_pspace): New.
	(get_current_source_symtab_and_line): Set the sal's program space.
	(set_current_source_symtab_and_line): Set current_source_pspace.
	(select_source_symtab): Ditto.	Use ALL_OBJFILES.
	(forget_cached_source_info): Iterate over all program spaces.
	* symfile.c (clear_symtab_users): Adjust.
	* symmisc.c (print_symbol_bcache_statistics): Iterate over all
	program spaces.
	(print_objfile_statistics): Ditto.
	(maintenance_print_msymbols): Ditto.
	(maintenance_print_objfiles): Ditto.
	(maintenance_info_symtabs): Ditto.
	(maintenance_info_psymtabs): Ditto.
	* symtab.h (SYMTAB_PSPACE): New.
	(struct symtab_and_line) <pspace>: New field.
	* symtab.c (init_sal): Clear the sal's program space.
	(find_pc_sect_symtab): Set the sal's program space.  Switch thread
	and space.
	(append_expanded_sal): Add program space argument.  Iterate over
	all program spaces.
	(expand_line_sal): Iterate over all program spaces.  Switch
	program space.

	* target.h (enum target_waitkind) <TARGET_WAITKIND_VFORK_DONE>: New.
	(struct target_ops) <to_thread_address_space>: New field.
	(target_thread_address_space): Define.
	* target.c (target_detach): Only remove breakpoints from the
	inferior we're detaching.
	(target_thread_address_space): New.

	* defs.h (initialize_progspace): Declare.
	* top.c (gdb_init): Call it.

	* solist.h (struct so_list) <sspace>: New field.
	* solib.h (struct program_space): Forward declare.
	(solib_name_from_address): Adjust prototype.
	* solib.c (so_list_head): Replace with a macro referencing the
	program space.
	(update_solib_list): Set the so's program space.
	(solib_name_from_address): Add a program space argument and adjust.

	* solib-svr4.c (struct svr4_info) <pid>: Delete field.
	<interp_text_sect_low, interp_text_sect_high, interp_plt_sect_low>
	<interp_plt_sect_high>: New fields.
	(svr4_info_p, svr4_info): Delete.
	(solib_svr4_sspace_data): New.
	(get_svr4_info): Rewrite.
	(svr4_sspace_data_cleanup): New.
	(open_symbol_file_object): Adjust.
	(svr4_default_sos): Adjust.
	(svr4_fetch_objfile_link_map): Adjust.
	(interp_text_sect_low, interp_text_sect_high, interp_plt_sect_low)
	(interp_plt_sect_high): Delete.
	(svr4_in_dynsym_resolve_code): Adjust.
	(enable_break): Adjust.
	(svr4_clear_solib): Revert bit that removed the svr4_info here,
	and reinstate clearing debug_base, debug_loader_offset_p,
	debug_loader_offset and debug_loader_name.
	(_initialize_svr4_solib): Register solib_svr4_pspace_data.  Don't
	install an inferior_exit observer anymore.

	* printcmd.c (struct display) <pspace>: New field.
	(display_command): Set the display's sspace.
	(do_one_display): Match the display's sspace.
	(display_uses_solib_p): Ditto.

	* linux-fork.c (detach_fork): Moved to infrun.c.
	(_initialize_linux_fork): Moved "detach-on-fork" command to
	infrun.c.
	* infrun.c (detach_fork): Moved from linux-fork.c.
	(proceed_after_vfork_done): New.
	(handle_vfork_child_exec_or_exit): New.
	(follow_exec_mode_replace, follow_exec_mode_keep)
	(follow_exec_mode_names, follow_exec_mode_string)
	(show_follow_exec_mode_string): New.
	(follow_exec): New.  Reinstate the mark_breakpoints_out call.
	Remove shared libraries before attaching new executable.  If user
	wants to keep the inferior, keep it.
	(displaced_step_fixup): Adjust to pass an address space to the
	breakpoints module.
	(resume): Ditto.
	(clear_proceed_status): In all-stop mode, always clear the proceed
	status of all threads.
	(prepare_to_proceed): Adjust to pass an address space to the
	breakpoints module.
	(proceed): Ditto.
	(adjust_pc_after_break): Ditto.
	(handle_inferior_event): When handling a process exit, switch the
	program space to the inferior's that had exited.  Call
	handle_vfork_child_exec_or_exit.  Adjust to pass an address space
	to the breakpoints module.  In non-stop mode, when following a
	fork and detach-fork is off, also resume the other branch.  Handle
	TARGET_WAITKIND_VFORK_DONE.  Set the program space in sals.
	(normal_stop): Prune inferiors.
	(_initialize_infrun): Install the new "follow-exec-mode" command.
	"detach-on-fork" moved here.

	* regcache.h (get_regcache_aspace): Declare.
	* regcache.c (struct regcache) <aspace>: New field.
	(regcache_xmalloc): Clear the aspace.
	(get_regcache_aspace): New.
	(regcache_cpy): Copy the aspace field.
	(regcache_cpy_no_passthrough): Ditto.
	(get_thread_regcache): Fetch the thread's address space from the
	target, and store it in the regcache.

	* infcall.c (call_function_by_hand): Set the sal's pspace.

	* arch-utils.c (default_has_shared_address_space): New.
	* arch-utils.h (default_has_shared_address_space): Declare.

	* gdbarch.sh (has_shared_address_space): New.
	* gdbarch.h, gdbarch.c: Regenerate.

	* linux-tdep.c: Include auxv.h, target.h, elf/common.h.
	(linux_has_shared_address_space): New.
	(_initialize_linux_tdep): Declare.

	* arm-tdep.c (arm_software_single_step): Pass the frame's address
	space to insert_single_step_breakpoint.
	* arm-linux-tdep.c (arm_linux_software_single_step): Pass the
	frame's pspace to breakpoint functions.
	* cris-tdep.c (crisv32_single_step_through_delay): Ditto.
	(cris_software_single_step): Ditto.
	* mips-tdep.c (deal_with_atomic_sequence): Add frame argument.
	Pass the frame's pspace to breakpoint functions.
	(mips_software_single_step): Adjust.
	(mips_single_step_through_delay): Adjust.
	* rs6000-aix-tdep.c (rs6000_software_single_step): Adjust.
	* rs6000-tdep.c (ppc_deal_with_atomic_sequence): Adjust.
	* solib-irix.c (enable_break): Adjust to pass the current frame's
	address space to breakpoint functions.
	* sparc-tdep.c (sparc_software_single_step): Ditto.
	* spu-tdep.c (spu_software_single_step): Ditto.
	* alpha-tdep.c (alpha_software_single_step): Ditto.
	* record.c (record_wait): Adjust to pass an address space to the
	breakpoints module.

	* fork-child.c (fork_inferior): Set the new inferior's program and
	address spaces.
	* inf-ptrace.c (inf_ptrace_follow_fork): Copy the parent's program
	and address spaces.
	(inf_ptrace_attach): Set the inferior's program and address spaces.
	* linux-nat.c: Include "solib.h".
	(linux_child_follow_fork): Manage parent and child's program and
	address spaces.	 Clone the parent's program space if necessary.
	Don't wait for the vfork to be done here.  Refuse to resume if
	following the vfork parent while leaving the child stopped.
	(resume_callback): Don't resume a vfork parent.
	(linux_nat_resume): Also check for pending events in the
	lp->waitstatus field.
	(linux_handle_extended_wait): Report TARGET_WAITKIND_VFORK_DONE
	events to the core.
	(stop_wait_callback): Don't wait for SIGSTOP on vfork parents.
	(cancel_breakpoint): Adjust.
	* linux-thread-db.c (thread_db_wait): Don't remove thread event
	breakpoints here.
	(thread_db_mourn_inferior): Don't mark breakpoints out here.
	Remove thread event breakpoints after mourning.
	* corelow.c: Include progspace.h.
	(core_open): Set the inferior's program and address spaces.
	* remote.c (remote_add_inferior): Set the new inferior's program
	and address spaces.
	(remote_start_remote): Update address spaces.
	(extended_remote_create_inferior_1): Don't init the thread list if
	we already debugging other inferiors.
	* darwin-nat.c (darwin_attach): Set the new inferior's program and
	address spaces.
	* gnu-nat.c (gnu_attach): Ditto.
	* go32-nat.c (go32_create_inferior): Ditto.
	* inf-ttrace.c (inf_ttrace_follow_fork, inf_ttrace_attach): Ditto.
	* monitor.c (monitor_open): Ditto.
	* nto-procfs.c (procfs_attach, procfs_create_inferior): Ditto.
	* procfs.c (do_attach): Ditto.
	* windows-nat.c (do_initial_windows_stuff): Ditto.

	* inflow.c (inferior_process_group)
	(terminal_init_inferior_with_pgrp, terminal_inferior,
	(terminal_ours_1, inflow_inferior_exit, copy_terminal_info)
	(child_terminal_info, new_tty_postfork, set_sigint_trap): Adjust
	to use per-inferior data instead of inferior->terminal_info.
	(inflow_inferior_data): New.
	(inflow_new_inferior): Delete.
	(inflow_inferior_data_cleanup): New.
	(get_inflow_inferior_data): New.

	* mi/mi-interp.c (mi_new_inferior): Rename to...
	(mi_inferior_appeared): ... this.
	(mi_interpreter_init): Adjust.

	* tui/tui-disasm.c: Include "progspace.h".
	(tui_set_disassem_content): Pass an address space to
	breakpoint_here_p.

	* NEWS: Mention multi-program debugging support.  Mention new
	commands "add-inferior", "clone-inferior", "remove-inferior",
	"maint info program-spaces", and new option "set
	follow-exec-mode".

2009-10-19  Pedro Alves	 <pedro@codesourcery.com>
	    Stan Shebs	<stan@codesourcery.com>

	gdb/doc/
	* observer.texi (new_inferior): Rename to...
	(inferior_appeared): ... this.

2009-10-19  Pedro Alves	 <pedro@codesourcery.com>
	    Stan Shebs	<stan@codesourcery.com>

	gdb/testsuite/
	* gdb.base/foll-vfork.exp: Adjust to spell out "follow-fork".
	* gdb.base/foll-exec.exp: Adjust to expect a process id before
	"Executing new program".
	* gdb.base/foll-fork.exp: Adjust to spell out "follow-fork".
	* gdb.base/multi-forks.exp: Ditto.  Adjust to the inferior being
	left listed after having been killed.
	* gdb.base/attach.exp: Adjust to spell out "symbol-file".
	* gdb.base/maint.exp: Adjust test.

	* Makefile.in (ALL_SUBDIRS): Add gdb.multi.
	* gdb.multi/Makefile.in: New.
	* gdb.multi/base.exp: New.
	* gdb.multi/goodbye.c: New.
	* gdb.multi/hangout.c: New.
	* gdb.multi/hello.c: New.
	* gdb.multi/bkpt-multi-exec.c: New.
	* gdb.multi/bkpt-multi-exec.exp: New.
	* gdb.multi/crashme.c: New.

2009-10-19  Pedro Alves	 <pedro@codesourcery.com>
	    Stan Shebs	<stan@codesourcery.com>

	gdb/doc/
	* gdb.texinfo (Inferiors): Rename node to ...
	(Inferiors and Programs): ... this.  Mention running multiple
	programs in the same debug session.
	<info inferiors>: Mention the new 'Executable' column if "info
	inferiors".  Update examples.  Document the "add-inferior",
	"clone-inferior", "remove-inferior" and "maint info
	program-spaces" commands.
	(Process): Rename node to...
	(Forks): ... this.  Document "set|show follow-exec-mode".
2009-10-19 09:51:43 +00:00
Ulrich Weigand c2250ad1c4 * target.h (struct target_ops): New member to_thread_architecture.
(target_thread_architecture): New macro.
	* target.c (update_current_target): Inherit to_thread_architecture.
	(default_thread_architecture): New function.
	(debug_to_thread_architecture): New function.
	(setup_target_debug): Handle to_thread_architecture.

	* regcache.h (get_thread_arch_regcache): New.
	* regcache.c (struct regcache_list): New data type.
	(current_regcache): Hold regcache list instead of single regcache.
	(current_thread_ptid, current_thread_arch): New static variables.
	(get_thread_arch_regcache): New function.
	(get_thread_regcache): Use it.  Call target_thread_architecture.
	(regcache_thread_ptid_changed): Update to current_regcache changes.
	(registers_changed): Likewise.  Reset current_thread_arch and
	current_thread_ptid.

	* remote.c (remote_wait): Access target registers in target_gdbarch.
	* linux-nat.c (linux_nat_do_thread_registers): Likewise.
	* proc-service.c (ps_lgetregs, ps_lsetregs): Likewise.
	(ps_lgetfpregs, ps_lsetfpregs): Likewise.
	* sol-thread.c (ps_lgetregs, ps_lsetregs): Likewise.
	(ps_lgetfpregs, ps_lsetfpregs): Likewise.
	* solib-svr4.c (enable_break): Likewise.
	(svr4_relocate_main_executable): Likewise.
2009-07-02 17:06:44 +00:00
Joel Brobecker 0fb0cc7590 Updated copyright notices for most files. 2009-01-03 05:58:08 +00:00
Ulrich Weigand 515630c5e5 * inferior.h (read_pc_pid, write_pc_pid): Remove.
* regcache.h (regcache_read_pc, regcache_write_pc): Add prototypes.

	* regcache.c (read_pc_pid): Remove, replace by ...
	(regcache_read_pc): ... this function.
	(write_pc_pid): Remove, replace by ...
	(regcache_write_pc): ... this function.
	(read_pc, write_pc): Update.

	* infrun.c (displaced_step_prepare): Replace read_pc_pid and
	write_pc_pid by regcache_read_pc and regcache_write_pc.
	(displaced_step_fixup): Likewise.
	(resume): Likewise.  Use regcache arch instead of current_gdbarch.
	(prepare_to_proceed): Likewise.
	(proceed): Likewise.
	(adjust_pc_after_break): Likewise.
	(handle_inferior_event): Likewise.

	* linux-nat.c (cancel_breakpoint): Likewise.
	* linux-thread-db.c (check_event): Likewise.
	* aix-thread.c (aix_thread_wait): Likewise.
	* tracepoint.c (trace_dump_command): Likewise.
2008-05-04 14:12:34 +00:00
Markus Deuling caaa79ad89 * sentinel-frame.c (sentinel_frame_prev_register): Do not call
register_offset_hack anymore.

	* regcache.{c,h} (register_offset_hack): Remove.
2008-02-18 16:37:17 +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 594f77850b * regcache.c (struct regcache): Add ptid_t member.
(regcache_xmalloc): Initialize it.
	(regcache_cpy_no_passthrough): Do not refer to current_regcache.
	(regcache_dup): Likewise.
	(regcache_dup_no_passthrough): Likewise.
	(current_regcache): Make static.
	(registers_ptid): Remove variable.
	(get_thread_regcache): New function.
	(get_current_regcache): New function.
	(registers_changed): Implement by freeing current regcache.
	(regcache_raw_read): Do not refer to current_regcache.  Set
	inferior_ptid to regcache->ptid while calling target routines.
	(regcache_raw_write): Likewise.
	(regcache_raw_supply): Do not refer to current_regcache.
	(read_pc_pid): Use thread regcache.  Do not modify inferior_ptid.
	(write_pc_pid): Likewise.
	(build_regcache): Remove.
	(_initialize_regcache): Do not call DEPRECATED_REGISTER_GDBARCH_SWAP
	or deprecated_register_gdbarch_swap.  Do not initialize
	registers_ptid.
	* regcache.h (get_current_regcache): Add prototype.
	(get_thread_regcache): Likewise.
	(current_regcache): Remove declaration.

	* corelow.c (core_open): Replace current_regcache by
	get_current_regcache ().
	* frame.c (frame_pop): Likewise.
	(put_frame_register): Likewise.
	(get_current_frame, create_new_frame): Likewise.
	* mi/mi-main.c (mi_cmd_data_write_register_values): Likewise.
	* stack.c (return_command): Likewise.
	* infcall.c (call_function_by_hand): Likewise.
	* infrun.c (resume): Likewise.
	(save_inferior_status, restore_inferior_status): Likewise.
	* linux-fork.c (fork_load_infrun_state): Likewise.
	(fork_save_infrun_state): Likewise.
	* win32-nat.c (win32_resume): Likewise.
	* i386fbsd-nat.c (i386fbsd_resume): Likewise.
	* monitor.c (monitor_wait): Likewise.
	* remote.c (remote_wait): Likewise.
	* remote-mips.c (mips_wait): Likewise.

	* bsd-kvm.c (bsd_kvm_open): Likewise
	(bsd_kvm_proc_cmd, bsd_kvm_pcb_cmd): Likewise.
	* fbsd-nat.c (fbsd_make_corefile_notes): Likewise.
	* i386-linux-nat.c (i386_linux_resume): Likewise.
	* ia64-linux-nat.c (ia64_linux_insert_watchpoint): Likewise.
	(ia64_linux_stopped_data_address): Likewise.

	* frv-tdep.c (frv_fdpic_loadmap_addresses): Likewise.
	* m32c-tdep.c (m32c_virtual_frame_pointer): Likewise.
	* mep-tdep.c (current_me_module, current_options): Likewise.
	* mips-tdep.c (deprecated_mips_set_processor_regs_hack): Likewise.

	* linux-nat.c (linux_nat_do_thread_registers): Use thread
	regcache instead of current_regcache.  Call target_fetch_registers.
	(linux_nat_corefile_thread_callback): Update call site.
	(linux_nat_do_registers): Likewise.
	* procfs.c (procfs_do_thread_registers): Use thread regcache instead
	of current_regcache.
	(procfs_make_note_section): Likewise.
	* proc-service.c (ps_lgetregs, ps_lsetregs): Likewise.
	(ps_lgetfpregs, ps_lsetfpregs): Likewise.
	* sol-thread.c (ps_lgetregs, ps_lsetregs): Likewise.
	(ps_lgetfpregs, ps_lsetfpregs): Likewise.
2007-06-16 17:16:26 +00:00
Ulrich Weigand 51a7a21286 * regcache.c (read_register, read_register_pid): Remove.
(write_register, write_register_pid): Likewise.
	* regcache.h (read_register, read_register_pid): Remove prototype.
	(write_register, write_register_pid): Likewise.
2007-06-15 22:45:57 +00:00
Ulrich Weigand 9c5ea4d965 * regcache.c (regcache_invalidate): New function.
(register_cached): Remove.
	(set_register_cached): Remove.
	(deprecated_registers_fetched): Remove.
	(registers_changed): Use regcache_invalidate instead
	of set_register_cached.
	(regcache_raw_read): Update comment.

	* regcache.h (regcache_invalidate): Add prototype.
	(register_cached): Remove.
	(set_register_cached): Remove.
	(deprecated_registers_fetched): Remove.

	* findvar.c (value_of_register): Do not call register_cached.
	* frame.c (frame_register): Likewise.
	* tui/tui-regs.c (tui_get_register): Likewise.

	* remote.c (fetch_register_using_p): Do not call set_register_cached.
	(process_g_packet): Likewise.
	(remote_fetch_registers): Likewise.
	* remote-sim.c (gdbsim_fetch_register): Likewise.
	* mt-tdep.c (mt_select_coprocessor): Replace set_register_cached call
	by regcache_invalidate.
	(mt_pseudo_register_write): Likewise.
	* sh-tdep.c (sh_pseudo_register_write): Likewise.

	* corelow.c (get_core_registers): Replace deprecated_registers_fetched
	call by loop over regcache_raw_supply (..., NULL).
2007-05-06 19:37:31 +00:00
Ulrich Weigand 81c4a259cd * regcache.c (deprecated_read_register_gen): Remove, inline ...
(read_register): ... here.
	(deprecated_write_register_gen): Remove, inline ...
	(write_register): ... here.
	* regcache.h (deprecated_read_register_gen): Remove prototype.
	(deprecated_write_register_gen): Likewise.

	* remote-sim.c (gdbsim_store_register): Replace call to
	deprecated_read_register_gen with regcache_cooked_read.
	* target.c (debug_print_register): Replace calls to
	deprecated_read_register_gen and read_register with
	regcache_cooked_read.
2007-04-29 01:51:51 +00:00
Ulrich Weigand 6ed7ea50e8 * gdbarch.sh: Remove deprecated_register_byte.
* gdbarch.c, gdbarch.h: Regenerate.
	* arch-utils.h (generic_register_size, generic_register_byte): Remove.
	* arch-utils.c (generic_register_size, generic_register_byte): Remove.

	* regcache.h (regcache_valid_p): Make REGCACHE parameter const.
	* regcache.c (regcache_valid_p): Allow to query cooked registers in
	read-only register caches.  Make REGCACHE parameter const.
	(regcache_dump): Do not check DEPRECATED_REGISTER_BYTE.

	* mi/mi-main.c (old_regs): Remove.
	(mi_setup_architecture_data, _initialize_mi_main): Remove.
	(register_changed_p): Reimplement to compare two register caches.
	(mi_cmd_data_list_changed_registers): Update caller.
	* mi/mi-main.h (mi_setup_architecture_data): Remove.
	* mi/mi-interp.c (mi_interpreter_init): Do not call
	mi_setup_architecture_data.
2007-04-28 21:52:38 +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
Mark Kettenis 5e66aab290 * gdbarch.sh (deprecated_extract_return_value)
(deprecated_store_return_value): Remove.
	(extract_return_value, store_return_value): Remove default values.
	* gdbarch.c, gdbarch.h: Regenerate.
	* arch-utils.c, arch-utils.h (legacy_extract_return_value)
	(legacy_store_return_value): Remove.
	* regcache.c, regcache.h (deprecated_grub_regcache_for_registers):
	Remove.
2007-01-13 23:24:43 +00:00
Mark Kettenis 23303b2e52 * regcache.c, regcache.h (deprecated_register_bytes)
(deprecated_read_register_bytes)
	(deprecated_write_register_bytes): Remove.
2007-01-13 22:32:14 +00:00
Daniel Jacobowitz 6aba47ca06 Copyright updates for 2007. 2007-01-09 17:59:20 +00:00
Eli Zaretskii 197e01b6dc * breakpoint.c:
* arm-tdep.c:
	* ia64-tdep.c:
	* i386-tdep.c:
	* hpread.c:
	* hppa-tdep.c:
	* hppa-hpux-tdep.c:
	* gnu-nat.c:
	* gdbtypes.c:
	* gdbarch.h:
	* gdbarch.c:
	* eval.c:
	* dwarf2read.c:
	* dbxread.c:
	* copying:
	* symfile.c:
	* stabsread.c:
	* sh64-tdep.c:
	* sh-tdep.c:
	* s390-tdep.c:
	* rs6000-tdep.c:
	* remote.c:
	* remote-mips.c:
	* mips-tdep.c:
	* mdebugread.c:
	* linux-nat.c:
	* infrun.c:
	* xcoffread.c:
	* win32-nat.c:
	* valops.c:
	* utils.c:
	* tracepoint.c:
	* target.c:
	* symtab.c:
	* c-exp.y:
	* ada-valprint.c:
	* ada-typeprint.c:
	* ada-lex.l:
	* ada-lang.h:
	* ada-lang.c:
	* ada-exp.y:
	* alphafbsd-tdep.c:
	* alphabsd-tdep.h:
	* alphabsd-tdep.c:
	* alphabsd-nat.c:
	* alpha-tdep.h:
	* alpha-tdep.c:
	* alpha-osf1-tdep.c:
	* alpha-nat.c:
	* alpha-mdebug-tdep.c:
	* alpha-linux-tdep.c:
	* alpha-linux-nat.c:
	* aix-thread.c:
	* abug-rom.c:
	* arch-utils.c:
	* annotate.h:
	* annotate.c:
	* amd64obsd-tdep.c:
	* amd64obsd-nat.c:
	* amd64nbsd-tdep.c:
	* amd64nbsd-nat.c:
	* amd64fbsd-tdep.c:
	* amd64fbsd-nat.c:
	* amd64bsd-nat.c:
	* amd64-tdep.h:
	* amd64-tdep.c:
	* amd64-sol2-tdep.c:
	* amd64-nat.h:
	* amd64-nat.c:
	* amd64-linux-tdep.c:
	* amd64-linux-nat.c:
	* alphanbsd-tdep.c:
	* block.h:
	* block.c:
	* bfd-target.h:
	* bfd-target.c:
	* bcache.h:
	* bcache.c:
	* ax.h:
	* ax-general.c:
	* ax-gdb.h:
	* ax-gdb.c:
	* avr-tdep.c:
	* auxv.h:
	* auxv.c:
	* armnbsd-tdep.c:
	* armnbsd-nat.c:
	* arm-tdep.h:
	* arm-linux-nat.c:
	* arch-utils.h:
	* charset.c:
	* call-cmds.h:
	* c-valprint.c:
	* c-typeprint.c:
	* c-lang.h:
	* c-lang.c:
	* buildsym.h:
	* buildsym.c:
	* bsd-uthread.h:
	* bsd-uthread.c:
	* bsd-kvm.h:
	* bsd-kvm.c:
	* breakpoint.h:
	* core-regset.c:
	* core-aout.c:
	* completer.h:
	* completer.c:
	* complaints.h:
	* complaints.c:
	* command.h:
	* coffread.c:
	* coff-solib.h:
	* coff-solib.c:
	* coff-pe-read.h:
	* coff-pe-read.c:
	* cli-out.h:
	* cli-out.c:
	* charset.h:
	* dink32-rom.c:
	* dictionary.h:
	* dictionary.c:
	* demangle.c:
	* defs.h:
	* dcache.h:
	* dcache.c:
	* d10v-tdep.c:
	* cpu32bug-rom.c:
	* cp-valprint.c:
	* cp-support.h:
	* cp-support.c:
	* cp-namespace.c:
	* cp-abi.h:
	* cp-abi.c:
	* corelow.c:
	* corefile.c:
	* environ.c:
	* elfread.c:
	* dwarfread.c:
	* dwarf2loc.c:
	* dwarf2expr.h:
	* dwarf2expr.c:
	* dwarf2-frame.h:
	* dwarf2-frame.c:
	* dve3900-rom.c:
	* dummy-frame.h:
	* dummy-frame.c:
	* dsrec.c:
	* doublest.h:
	* doublest.c:
	* disasm.h:
	* disasm.c:
	* fork-child.c:
	* findvar.c:
	* fbsd-nat.h:
	* fbsd-nat.c:
	* f-valprint.c:
	* f-typeprint.c:
	* f-lang.h:
	* f-lang.c:
	* expression.h:
	* expprint.c:
	* exec.h:
	* exec.c:
	* exceptions.h:
	* exceptions.c:
	* event-top.h:
	* event-top.c:
	* event-loop.h:
	* event-loop.c:
	* gdb.c:
	* gdb-stabs.h:
	* gdb-events.h:
	* gdb-events.c:
	* gcore.c:
	* frv-tdep.h:
	* frv-tdep.c:
	* frv-linux-tdep.c:
	* frame.h:
	* frame.c:
	* frame-unwind.h:
	* frame-unwind.c:
	* frame-base.h:
	* frame-base.c:
	* gdb_vfork.h:
	* gdb_thread_db.h:
	* gdb_string.h:
	* gdb_stat.h:
	* gdb_regex.h:
	* gdb_ptrace.h:
	* gdb_proc_service.h:
	* gdb_obstack.h:
	* gdb_locale.h:
	* gdb_dirent.h:
	* gdb_curses.h:
	* gdb_assert.h:
	* gdbarch.sh:
	* gdb.h:
	* hpux-thread.c:
	* hppabsd-nat.c:
	* hppa-tdep.h:
	* hpacc-abi.c:
	* h8300-tdep.c:
	* gregset.h:
	* go32-nat.c:
	* gnu-v3-abi.c:
	* gnu-v2-abi.h:
	* gnu-v2-abi.c:
	* gnu-nat.h:
	* glibc-tdep.c:
	* gdbtypes.h:
	* gdbcore.h:
	* gdbcmd.h:
	* i386nbsd-tdep.c:
	* i386nbsd-nat.c:
	* i386gnu-tdep.c:
	* i386gnu-nat.c:
	* i386fbsd-tdep.c:
	* i386fbsd-nat.c:
	* i386bsd-tdep.c:
	* i386bsd-nat.h:
	* i386bsd-nat.c:
	* i386-tdep.h:
	* i386-sol2-nat.c:
	* i386-nto-tdep.c:
	* i386-nat.c:
	* i386-linux-tdep.h:
	* i386-linux-tdep.c:
	* i386-linux-nat.c:
	* i386-cygwin-tdep.c:
	* inf-ttrace.c:
	* inf-ptrace.h:
	* inf-ptrace.c:
	* inf-loop.h:
	* inf-loop.c:
	* inf-child.h:
	* inf-child.c:
	* ia64-tdep.h:
	* ia64-linux-nat.c:
	* i387-tdep.h:
	* i387-tdep.c:
	* i386v4-nat.c:
	* i386v-nat.c:
	* i386obsd-tdep.c:
	* i386obsd-nat.c:
	* kod.c:
	* jv-valprint.c:
	* jv-typeprint.c:
	* jv-lang.h:
	* jv-lang.c:
	* irix5-nat.c:
	* iq2000-tdep.c:
	* interps.h:
	* interps.c:
	* inftarg.c:
	* inflow.h:
	* inflow.c:
	* inferior.h:
	* infcmd.c:
	* infcall.h:
	* infcall.c:
	* inf-ttrace.h:
	* m32r-tdep.h:
	* m32r-tdep.c:
	* m32r-rom.c:
	* m32r-linux-tdep.c:
	* m32r-linux-nat.c:
	* m2-valprint.c:
	* m2-typeprint.c:
	* m2-lang.h:
	* m2-lang.c:
	* lynx-nat.c:
	* linux-thread-db.c:
	* linux-nat.h:
	* linespec.c:
	* libunwind-frame.h:
	* libunwind-frame.c:
	* language.h:
	* language.c:
	* macroexp.c:
	* macrocmd.c:
	* m88kbsd-nat.c:
	* m88k-tdep.h:
	* m88k-tdep.c:
	* m68klinux-tdep.c:
	* m68klinux-nat.c:
	* m68kbsd-tdep.c:
	* m68kbsd-nat.c:
	* m68k-tdep.h:
	* m68k-tdep.c:
	* mips-linux-nat.c:
	* mips-irix-tdep.c:
	* minsyms.c:
	* memattr.h:
	* memattr.c:
	* mem-break.c:
	* mdebugread.h:
	* main.h:
	* main.c:
	* macrotab.h:
	* macrotab.c:
	* macroscope.h:
	* macroscope.c:
	* macroexp.h:
	* nbsd-tdep.c:
	* mt-tdep.c:
	* monitor.h:
	* monitor.c:
	* mn10300-tdep.h:
	* mn10300-tdep.c:
	* mn10300-linux-tdep.c:
	* mipsv4-nat.c:
	* mipsread.c:
	* mipsnbsd-tdep.h:
	* mipsnbsd-tdep.c:
	* mipsnbsd-nat.c:
	* mips64obsd-tdep.c:
	* mips64obsd-nat.c:
	* mips-tdep.h:
	* mips-mdebug-tdep.c:
	* mips-linux-tdep.c:
	* osabi.h:
	* osabi.c:
	* ocd.h:
	* ocd.c:
	* observer.c:
	* objfiles.h:
	* objfiles.c:
	* objc-lang.h:
	* objc-lang.c:
	* objc-exp.y:
	* nto-tdep.h:
	* nto-tdep.c:
	* nto-procfs.c:
	* nlmread.c:
	* nbsd-tdep.h:
	* ppcobsd-tdep.c:
	* ppcobsd-nat.c:
	* ppcnbsd-tdep.h:
	* ppcnbsd-tdep.c:
	* ppcnbsd-nat.c:
	* ppcbug-rom.c:
	* ppc-tdep.h:
	* ppc-sysv-tdep.c:
	* ppc-linux-tdep.c:
	* ppc-linux-nat.c:
	* ppc-bdm.c:
	* parser-defs.h:
	* parse.c:
	* p-valprint.c:
	* p-typeprint.c:
	* p-lang.h:
	* p-lang.c:
	* remote-fileio.h:
	* remote-fileio.c:
	* remote-est.c:
	* remote-e7000.c:
	* regset.h:
	* regset.c:
	* reggroups.h:
	* reggroups.c:
	* regcache.h:
	* regcache.c:
	* proc-why.c:
	* proc-service.c:
	* proc-events.c:
	* printcmd.c:
	* ppcobsd-tdep.h:
	* sentinel-frame.h:
	* sentinel-frame.c:
	* scm-valprint.c:
	* scm-tags.h:
	* scm-lang.h:
	* scm-lang.c:
	* scm-exp.c:
	* s390-tdep.h:
	* rom68k-rom.c:
	* remote.h:
	* remote-utils.c:
	* remote-st.c:
	* remote-sim.c:
	* remote-sds.c:
	* remote-rdp.c:
	* remote-rdi.c:
	* remote-hms.c:
	* sim-regno.h:
	* shnbsd-tdep.h:
	* shnbsd-tdep.c:
	* shnbsd-nat.c:
	* sh-tdep.h:
	* serial.h:
	* serial.c:
	* ser-unix.h:
	* ser-unix.c:
	* ser-tcp.c:
	* ser-pipe.c:
	* ser-go32.c:
	* ser-e7kpc.c:
	* ser-base.h:
	* ser-base.c:
	* solib.c:
	* solib-svr4.h:
	* solib-svr4.c:
	* solib-sunos.c:
	* solib-som.h:
	* solib-som.c:
	* solib-pa64.h:
	* solib-pa64.c:
	* solib-osf.c:
	* solib-null.c:
	* solib-legacy.c:
	* solib-irix.c:
	* solib-frv.c:
	* solib-aix5.c:
	* sol-thread.c:
	* sparc64-linux-tdep.c:
	* sparc64-linux-nat.c:
	* sparc-tdep.h:
	* sparc-tdep.c:
	* sparc-sol2-tdep.c:
	* sparc-sol2-nat.c:
	* sparc-nat.h:
	* sparc-nat.c:
	* sparc-linux-tdep.c:
	* sparc-linux-nat.c:
	* source.h:
	* source.c:
	* somread.c:
	* solist.h:
	* solib.h:
	* std-regs.c:
	* stack.h:
	* stack.c:
	* stabsread.h:
	* sparcobsd-tdep.c:
	* sparcnbsd-tdep.c:
	* sparcnbsd-nat.c:
	* sparc64obsd-tdep.c:
	* sparc64nbsd-tdep.c:
	* sparc64nbsd-nat.c:
	* sparc64fbsd-tdep.c:
	* sparc64fbsd-nat.c:
	* sparc64-tdep.h:
	* sparc64-tdep.c:
	* sparc64-sol2-tdep.c:
	* sparc64-nat.c:
	* ui-file.c:
	* typeprint.h:
	* typeprint.c:
	* tramp-frame.h:
	* tramp-frame.c:
	* trad-frame.h:
	* trad-frame.c:
	* tracepoint.h:
	* top.c:
	* tobs.inc:
	* thread.c:
	* terminal.h:
	* target.h:
	* symfile.h:
	* stop-gdb.c:
	* vaxbsd-nat.c:
	* vax-tdep.h:
	* vax-tdep.c:
	* vax-nat.c:
	* varobj.h:
	* varobj.c:
	* value.h:
	* value.c:
	* valprint.h:
	* valprint.c:
	* v850-tdep.c:
	* uw-thread.c:
	* user-regs.c:
	* ui-out.h:
	* ui-out.c:
	* ui-file.h:
	* xcoffsolib.h:
	* xcoffsolib.c:
	* wrapper.c:
	* wince.c:
	* wince-stub.h:
	* wince-stub.c:
	* vaxobsd-tdep.c:
	* vaxnbsd-tdep.c:
	* gdb_gcore.sh:
	* copying.c:
	* configure.ac:
	* aclocal.m4:
	* acinclude.m4:
	* reply_mig_hack.awk:
	* observer.sh:
	* gdb_mbuild.sh:
	* arm-linux-tdep.c:
	* blockframe.c:
	* dbug-rom.c:
	* environ.h:
	* dwarf2loc.h:
	* gdb-events.sh:
	* glibc-tdep.h:
	* gdb_wait.h:
	* gdbthread.h:
	* i386-sol2-tdep.c:
	* hppabsd-tdep.c:
	* hppa-linux-nat.c:
	* hppa-hpux-nat.c:
	* ia64-linux-tdep.c:
	* infptrace.c:
	* linespec.h:
	* maint.c:
	* mips-mdebug-tdep.h:
	* remote-m32r-sdi.c:
	* s390-nat.c:
	* rs6000-nat.c:
	* remote-utils.h:
	* sh3-rom.c:
	* sh-linux-tdep.c:
	* top.h:
	* symtab.h:
	* symmisc.c:
	* symfile-mem.c:
	* srec.h:
	* user-regs.h:
	* version.h:
	* valarith.c:
	* xstormy16-tdep.c:
	* wrapper.h:
	* Makefile.in:
	* f-exp.y:
	* cris-tdep.c:
	* cp-name-parser.y:
	* procfs.c:
	* proc-utils.h:
	* proc-flags.c:
	* proc-api.c:
	* p-exp.y:
	* m68hc11-tdep.c:
	* m2-exp.y:
	* kod.h:
	* kod-cisco.c:
	* jv-exp.y:
	* hppa-linux-tdep.c: Add (c) after Copyright.  Update the FSF
	address.
2005-12-17 22:34:03 +00:00
Mark Kettenis 6618125dce * regcache.c (regcache_raw_supply, regcache_raw_collect): Change
type of last argument back to `void *'.
* regcache.h (regcache_raw_supply, regcache_raw_collect): Likewise.
2005-06-18 15:22:55 +00:00
Andrew Cagney 2d522557c6 2005-05-19 Andrew Cagney <cagney@gnu.org>
* regcache.h (regcache_raw_read, regcache_raw_write)
	(regcache_raw_read_part, regcache_raw_write_part)
	(regcache_cooked_read_part, regcache_cooked_write_part)
	(regcache_cooked_read, regcache_cooked_write)
	(regcache_raw_supply, regcache_raw_collect)
	(regcache_cooked_read_ftype, regcache_save, regcache_restore)
	(deprecated_read_register_gen, deprecated_write_register_gen)
	(deprecated_read_register_bytes, deprecated_write_register_bytes)
	(deprecated_grub_regcache_for_registers): Use gdb_byte for byte
	buffer parameters.
	* ia64-tdep.c (ia64_extract_return_value): Update.
	* frame.c (do_frame_register_read): Update.
	* regcache.c (deprecated_grub_regcache_for_registers)
	(struct regcache, regcache_save, regcache_restore, regcache_cpy)
	(do_cooked_read, regcache_xmalloc, register_buffer)
	(deprecated_read_register_bytes, regcache_raw_read)
	(regcache_raw_read_signed, regcache_raw_read_unsigned)
	(deprecated_read_register_gen, regcache_cooked_read)
	(regcache_cooked_read_signed, regcache_cooked_read_unsigned)
	(deprecated_write_register_gen, regcache_cooked_write)
	(deprecated_write_register_bytes, regcache_raw_read_part)
	(regcache_raw_write_part, regcache_cooked_read_part)
	(regcache_cooked_write_part, read_register, regcache_raw_supply):
2005-05-19 16:37:09 +00:00
Andrew Cagney 8851ec7ac2 2004-11-13 Andrew Cagney <cagney@gnu.org>
* regcache.h (deprecated_register_valid): Delete.
	(deprecated_registers): Delete.
	* regcache.c (deprecated_register_valid): Delete.
	(deprecated_registers): Delete.
	(deprecated_read_register_byte, _initialize_regcache)
	(deprecated_write_register_bytes, build_regcache): Update.
	* config/powerpc/ppc-sim.mt (TDEPFILES): Remove ppc-bdm.o and
	remote-sds.o.
	* config/powerpc/ppc-eabi.mt (TDEPFILES): Ditto.
	* config/mips/embed.mt (TDEPFILES): Remove remote-mips.o.
2004-11-14 01:11:07 +00:00
Andrew Cagney f42accbe77 2004-08-02 Andrew Cagney <cagney@gnu.org>
* gdbarch.sh (deprecated_register_bytes): Delete.
	* gdbarch.h, gdbarch.c: Re-generate.
	* regcache.c (deprecated_register_bytes): New function.
	* regcache.h (deprecated_register_bytes): Declare.
	* xstormy16-tdep.c (xstormy16_gdbarch_init): Update.
	* v850-tdep.c (v850_gdbarch_init): Update.
	* sh64-tdep.c (sh64_gdbarch_init): Update.
	* ns32k-tdep.c (ns32k_gdbarch_init_32082): Update.
	* mn10300-tdep.c (mn10300_gdbarch_init): Update.
	* mcore-tdep.c (mcore_gdbarch_init): Update.
	* cris-tdep.c (cris_gdbarch_init): Update.
	* arm-tdep.c (arm_gdbarch_init): Update.
	* remote.c (init_remote_state): Update.
	* remote-vx.c (vx_prepare_to_store): Update.
	* remote-sds.c (sds_fetch_registers, sds_prepare_to_store): Update.
	* irix5-nat.c (fetch_core_registers): Update.
	* cris-tdep.c (cris_register_bytes_ok): Update.
	* config/nm-gnu.h (CHILD_PREPARE_TO_STORE): Update.
2004-08-03 02:02:24 +00:00
Andrew Cagney 01e1877c5f 2004-08-02 Andrew Cagney <cagney@gnu.org>
* regcache.h: Delete DEPRECATED_REGISTER_VIRTUAL_SIZE and
	DEPRECATED_REGISTER_RAW_SIZE from comments.
	* regcache.c (init_regcache_descr, regcache_dump): Do not check or
	use DEPRECATED_REGISTER_VIRTUAL_SIZE and
	DEPRECATED_REGISTER_RAW_SIZE.
	* findvar.c (value_of_register): Simplify by assuming that the
	registers raw and virtual sizes are identical.
	* regcache.h: Delete DEPRECATED_REGISTER_VIRTUAL_TYPE in
	comment.
	* arch-utils.c (generic_register_size): Simplify by assuming
	register_type.
2004-08-02 21:58:44 +00:00
Andrew Cagney 822c97322c 2004-07-23 Andrew Cagney <cagney@gnu.org>
Use regcache_raw_collect instead of regcache_collect.
	* regcache.h (regcache_collect): Delete declaration.
	* regcache.c (regcache_colect): Delete function.
	* win32-nat.c (do_child_store_inferior_registers): Update.
	* sol-thread.c (sol_thread_store_registers): Update.
	* shnbsd-tdep.c (shnbsd_fill_reg): Update.
	* rs6000-nat.c (store_register): Update.
	* remote.c (store_register_using_P, remote_store_registers): Update.
	* ppcnbsd-tdep.c (ppcnbsd_fill_reg): Update.
	* ppc-linux-nat.c (store_altivec_register, store_spe_register)
	(fill_vrregset, store_spe_registers, fill_gregset)
	(fill_gregset): Update.
	* nto-procfs.c (procfs_store_registers): Update.
	* mipsnbsd-tdep.c (mipsnbsd_fill_reg): Update.
	* mips-linux-tdep.c (fill_gregset, mips64_fill_gregset): Update.
	* m68klinux-nat.c (store_register, fill_gregset): Update.
	* m68k-tdep.c (fill_gregset): Update.
	* infptrace.c (store_register): Update.
	* i386-nto-tdep.c (i386nto_regset_fill): Update.
	* i386-linux-nat.c (store_register, fill_gregset): Update.
	* hppa-linux-nat.c (fill_gregset): Update.
	* go32-nat.c (store_register): Update.
	* armnbsd-nat.c (store_register, store_regs, store_fp_register)
	(store_fp_regs): Update.
	* arm-linux-nat.c (store_nwfpe_single, store_nwfpe_double)
	(store_nwfpe_extended, store_fpregister, store_fpregs)
	(store_register, store_regs, fill_gregset, fill_fpregset): Update.
	* alpha-tdep.c (alpha_fill_int_regs, alpha_fill_fp_regs): Update.
	* aix-thread.c (fill_gprs64, fill_fprs, fill_sprs64, fill_sprs32)
	(store_regs_user_thread, store_regs_kernel_thread): Update.
2004-07-24 01:00:21 +00:00
Andrew Cagney 23a6d36940 2004-07-21 Andrew Cagney <cagney@gnu.org>
Use regcache_raw_supply instead of supply_register.
	* regcache.h (supply_register): Delete declaration.
	* regcache.c (supply_register): Delete function.
	* wince.c (do_child_fetch_inferior_registers): Update.
	* win32-nat.c (do_child_fetch_inferior_registers)
	(fetch_elf_core_registers): Update.
	* v850ice.c (v850ice_fetch_registers): Update.
	* thread-db.c (thread_db_store_registers): Update.
	* sol-thread.c (sol_thread_store_registers): Update.
	* shnbsd-tdep.c (shnbsd_supply_reg): Update.
	* rs6000-nat.c (fetch_register): Update.
	* rom68k-rom.c (rom68k_supply_one_register): Update.
	* remote.c (remote_wait, remote_async_wait): Update.
	* remote-st.c (get_hex_regs): Update.
	* remote-sim.c (gdbsim_fetch_register): Update.
	* remote-sds.c (sds_fetch_registers): Update.
	* remote-rdp.c (remote_rdp_fetch_register): Update.
	* remote-rdi.c (arm_rdi_fetch_registers): Update.
	* remote-mips.c (mips_wait, mips_fetch_registers): Update.
	* remote-m32r-sdi.c (m32r_fetch_register): Update.
	* remote-hms.c (init_hms_cmds): Update.
	* remote-est.c (init_est_cmds): Update.
	* remote-e7000.c (get_hex_regs, fetch_regs_from_dump)
	(e7000_fetch_registers, sub2_from_pc, e7000_wait): Update.
	* ppcnbsd-tdep.c (ppcnbsd_supply_reg, ppcnbsd_supply_fpreg): Update.
	* ppc-linux-nat.c (fetch_altivec_register, fetch_spe_register)
	(fetch_register, supply_vrregset, supply_vrregset)
	(fetch_spe_registers): Update.
	* ppc-bdm.c (bdm_ppc_fetch_registers): Update.
	* monitor.c (monitor_supply_register): Update.
	* mipsv4-nat.c (supply_gregset, supply_fpregset): Update.
	* mipsnbsd-tdep.c (mipsnbsd_supply_reg)
	(mipsnbsd_supply_fpreg): Update.
	* mips-nat.c (fetch_inferior_registers)
	(fetch_core_registers): Update.
	* mips-linux-tdep.c (supply_32bit_reg, supply_gregset)
	(supply_fpregset, mips64_supply_gregset)
	(mips64_supply_fpregset): Update.
	* m68klinux-nat.c (fetch_register, supply_gregset)
	(supply_fpregset): Update.
	* m68k-tdep.c (supply_gregset, supply_fpregset): Update.
	* m32r-rom.c (init_m32r_cmds, init_mon2000_cmds): Update.
	* lynx-nat.c (fetch_inferior_registers, fetch_core_registers): Update.
	* irix5-nat.c (supply_gregset, supply_fpregset): Update.
	* infptrace.c (fetch_register): Update.
	* ia64-linux-nat.c (supply_gregset, supply_fpregset): Update.
	* ia64-aix-nat.c (supply_gregset, supply_fpregset): Update.
	* i386gnu-nat.c (fetch_fpregs, supply_gregset)
	(gnu_fetch_registers, gnu_store_registers): Update.
	* i386-nto-tdep.c (i386nto_supply_gregset): Update.
	* i386-linux-nat.c (fetch_register, supply_gregset)
	(dummy_sse_values): Update.
	* hpux-thread.c (hpux_thread_fetch_registers): Update.
	* hppah-nat.c (fetch_register): Update.
	* hppa-linux-nat.c (fetch_register, supply_gregset)
	(supply_fpregset): Update.
	* go32-nat.c (fetch_register): Update.
	* dve3900-rom.c (fetch_bitmapped_register)
	(_initialize_r3900_rom): Update.
	* cris-tdep.c (supply_gregset): Update.
	* abug-rom.c (init_abug_cmds): Update.
	* core-aout.c (fetch_core_registers): Update.
	* armnbsd-nat.c (supply_gregset, supply_fparegset)
	(fetch_register, fetch_fp_register): Update.
	* arm-linux-nat.c (fetch_nwfpe_single, fetch_nwfpe_none)
	(fetch_nwfpe_extended, fetch_fpregister, fetch_fpregs)
	(fetch_register, fetch_regs, supply_gregset, supply_fpregset): Update.
	* alphanbsd-tdep.c (fetch_core_registers): Update.
	* alpha-tdep.c (alpha_supply_int_regs, alpha_supply_fp_regs): Update.
	* alpha-nat.c (fetch_osf_core_registers)
	(fetch_osf_core_registers, fetch_osf_core_registers): Update.
	* aix-thread.c (supply_gprs64, supply_reg32, supply_fprs)
	(supply_sprs64, supply_sprs32, fetch_regs_kernel_thread): Update.
2004-07-22 01:31:49 +00:00
Andrew Cagney ce2826aa7a Index: mi/ChangeLog
2003-10-24  Andrew Cagney  <cagney@redhat.com>

	* tui-out.c: Fix "fortunatly"[sic].

Index: doc/ChangeLog
2003-10-24  Andrew Cagney  <cagney@redhat.com>

	* annotate.texinfo: Fix "fortunatly"[sic].

2003-10-24  Andrew Cagney  <cagney@redhat.com>

	* osabi.c (gdbarch_init_osabi): Fix typos, and "fortunatly"[sic].
	* PROBLEMS, arch-utils.c, cli-out.c, command.h: Ditto.
	* complaints.c, cris-tdep.c, disasm.c, dwarf2-frame.c: Ditto.
	* frame.c, frame.h, infcall.c, infcmd.c, infrun.c: Ditto.
	* kod.c, mips-tdep.c, regcache.c, regcache.h, remote.c: Ditto.
2003-10-24 17:37:04 +00:00
Andrew Cagney f30992d46d 2003-09-30 Andrew Cagney <cagney@redhat.com>
* mi-main.c: Rename REGISTER_VIRTUAL_SIZE to
	DEPRECATED_REGISTER_VIRTUAL_SIZE.

2003-09-30  Andrew Cagney  <cagney@redhat.com>

	* gdbarch.sh (DEPRECATED_REGISTER_VIRTUAL_SIZE): Rename
	REGISTER_VIRTUAL_SIZE.
	* gdbarch.h, gdbarch.c: Regenerate.
	* vax-tdep.h, sparc-tdep.c, regcache.h: Update.
	* regcache.c, mn10300-tdep.c, mips-tdep.c: Update.
	* infcmd.c, frame.c, findvar.c, cris-tdep.c: Update.

2003-09-30  Andrew Cagney  <cagney@redhat.com>

	* gdbint.texinfo (Target Architecture Definition): Rename
	REGISTER_VIRTUAL_SIZE to DEPRECATED_REGISTER_VIRTUAL_SIZE.
	(Target Architecture Definition):
2003-09-30 19:12:20 +00:00
Andrew Cagney 2e0926257d 2003-09-29 Andrew Cagney <cagney@redhat.com>
* gdbarch.sh (DEPRECATED_REGISTER_VIRTUAL_TYPE): Rename
	DEPRECATED_REGISTER_VIRTUAL_TYPE.
	* gdbarch.h, gdbarch.c: Regenerate.
	* arch-utils.c,	hppa-tdep.c, regcache.c, regcache.h: Update.
	* sh64-tdep.c, sparc-tdep.c: Update.

2003-09-30  Andrew Cagney  <cagney@redhat.com>

	* gdbint.texinfo (Target Architecture Definition): Rename
	REGISTER_VIRTUAL_TYPE to DEPRECATED_REGISTER_VIRTUAL_TYPE.
2003-09-30 13:29:44 +00:00
Mark Kettenis 41d35cb0fe * regcache.h (get_regcache_arch): New prototype.
* regcache.c (get_regcache_arch): New function.
2003-09-27 19:32:53 +00:00
Mark Kettenis 9a661b68d1 * regcache.c (register_buffer): Consitify first argument.
(regcache_raw_supply, regcache_raw_collect): New
functions.
2003-08-29 09:59:28 +00:00
Andrew Cagney b923b08ddf 2003-05-15 Andrew Cagney <cagney@redhat.com>
* regcache.c (build_regcache): Set deprecated_register_valid
	directly.
	(deprecated_grub_regcache_for_register_valid): Delete function.
	* regcache.h (deprecated_grub_regcache_for_register_valid): Delete
	declaration.
2003-05-15 18:01:50 +00:00
Andrew Cagney 123a958e01 2003-05-08 Andrew Cagney <cagney@redhat.com>
* regcache.h (max_register_size): Delete declaration.
	* regcache.c (max_register_size): Delete function.
	(struct regcache_descr): Delete field "max_register_size".
	(init_regcache_descr, init_legacy_regcache_descr): Assert that all
	registers fit in MAX_REGISTER_SIZE.
	(regcache_save): Replace max_register_size with MAX_REGISTER_SIZE.
	(regcache_restore, regcache_xfer_part, regcache_dump): Ditto.
	* thread-db.c: Replace max_register_size with MAX_REGISTER_SIZE.
	* sh-tdep.c, rom68k-rom.c, remote-sim.c, remote-mips.c: Ditto.
	* remote-e7000.c, monitor.c, mipsv4-nat.c, mips-nat.c: Ditto.
	* m68klinux-nat.c, lynx-nat.c, irix4-nat.c: Ditto.
	* hpux-thread.c, hppah-nat.c, hppab-nat.c, hppa-tdep.c: Ditto.
	* dve3900-rom.c, hppa-tdep.c: Ditto.
2003-05-08 22:33:14 +00:00
Andrew Cagney 22540ece94 2003-05-08 Andrew Cagney <cagney@redhat.com>
* mips-tdep.c (read_signed_register): New function, moved to here
	from "regcache.c".
	(read_signed_register_pid): Ditto.
	* regcache.c (read_signed_register_pid): Delete function, moved to
	"mips-tdep.c".
	(read_signed_register): Ditto.
	* regcache.h (read_signed_register): Delete declaration.
	(read_signed_register_pid): Delete declaration.
2003-05-08 20:38:07 +00:00
Andrew Cagney ac2adee56d 2003-03-12 Andrew Cagney <cagney@redhat.com>
* frame.c (get_saved_register): Delete function.
	* xstormy16-tdep.c: Update comment.
	* regcache.h: Update comments.
	* sparc-tdep.c (sparc_init_extra_frame_info): Instead of
	get_saved_register and extract_address, use
	frame_read_unsigned_register.
	(sparc_frame_saved_pc): Ditto.
	(sparc_get_saved_register): Instead of get_saved_register, use
	frame_register.
	(sparc_pop_frame): Ditto.
	* frame.h (get_saved_register): Delete declaration.
	* findvar.c: Update comments.
	(value_of_register): Call frame_register instead of
	get_saved_register.
	(value_from_register): Ditto.
	* config/sparc/tm-sparc.h: Update comment.
	* breakpoint.c: Update comment.

Index: doc/ChangeLog
2003-03-12  Andrew Cagney  <cagney@redhat.com>

	* gdbint.texinfo (Target Architecture Definition): Delete
	references to get_saved_register.
2003-03-14 17:07:01 +00:00
Andrew Cagney a66a9c2331 2003-03-12 Andrew Cagney <cagney@redhat.com>
* regcache.c (regcache_cooked_write_signed): New function.
	(regcache_cooked_write_unsigned): New function.
	(regcache_cooked_read_unsigned): Fix regnum in range assertion.
	(regcache_cooked_read_signed): Fix regnum in range assertion.
	* regcache.h (regcache_cooked_write_signed): Declare.
	(regcache_cooked_write_unsigned): Declare.
2003-03-12 20:50:13 +00:00
Andrew Cagney 5602984a0d 2003-03-10 Andrew Cagney <cagney@redhat.com>
* regcache.h (regcache_cooked_read_ftype): Define.
	(regcache_save, regcache_restore): Add a cooked_read parameter.
	* regcache.c (regcache_save, regcache_restore): Update.
	(do_cooked_read): New function.
	(regcache_cpy): Pass do_cooked_read to regcache_save and
	regcache_restore.
2003-03-10 19:08:47 +00:00
Andrew Cagney 08a617dae2 2003-02-28 Andrew Cagney <cagney@redhat.com>
* regcache.c (register_size): New function.
	* regcache.h (register_size): Declare
	* d10v-tdep.c: Use register_size instead of REGISTER_RAW_SIZE, use
	max_register_size instead of MAX_REGISTER_RAW_SIZE.
2003-02-28 17:47:43 +00:00
Andrew Cagney 6e7f8b9cba 2002-11-29 Andrew Cagney <ac131313@redhat.com>
* stack.c (selected_frame, select_frame): Move from here ...
	* frame.c (selected_frame, select_frame): ... to here.  Include
	"language.h".
	* Makefile.in (frame.o): Update dependencies.
	* frame.c (get_selected_frame): New function.
	* frame.h (get_selected_frame): Declare.
	(deprecated_selected_frame): Rename selected_frame.
	* ada-lang.c, ada-tasks.c, breakpoint.c, corelow.c: Update.
	* eval.c, f-valprint.c, findvar.c, frame.c, frame.h: Update.
	* h8300-tdep.c, h8500-tdep.c, hppa-tdep.c, infcmd.c: Update.
	* inflow.c, infrun.c, macroscope.c, mips-tdep.c: Update.
	* mn10300-tdep.c, ocd.c, regcache.h, remote-e7000.c: Update.
	* remote-mips.c, remote-rdp.c, sh-tdep.c, sparc-tdep.c: Update.
	* stack.c, thread.c, tracepoint.c, valops.c, varobj.c: Update.
	* z8k-tdep.c, cli/cli-cmds.c: Update.

Index: mi/ChangeLog
2002-11-29  Andrew Cagney  <ac131313@redhat.com>

	* mi/mi-cmd-stack.c, mi/mi-main.c: Update to use
	deprecated_selected_frame.

Index: tui/ChangeLog
2002-11-29  Andrew Cagney  <ac131313@redhat.com>

	* tui/tui-hooks.c: Update to use deprecated_selected_frame.
	* tui/tui.c, tui/tuiDisassem.c, tui/tuiRegs.c: Ditto.
	* tui/tuiSource.c, tui/tuiSourceWin.c, tui/tuiWin.c: Ditto.
2002-11-29 19:15:16 +00:00
Andrew Cagney 524d7c188c 2002-11-14 Andrew Cagney <ac131313@redhat.com>
* regcache.h (deprecated_registers): Rename registers.
	* a68v-nat.c, alpha-nat.c, arch-utils.c, core-sol2.c: Update.
	* hp300ux-nat.c, hppab-nat.c, hppah-nat.c: Update.
	* hppam3-nat.c, hpux-thread.c, i386gnu-nat.c: Update.
	* ia64-aix-nat.c, ia64-linux-nat.c, ia64-tdep.c: Update.
	* irix4-nat.c, irix5-nat.c, lynx-nat.c, m68k-tdep.c: Update.
	* m68knbsd-nat.c, mips-linux-tdep.c, mipsm3-nat.c: Update.
	* mipsv4-nat.c, ns32knbsd-nat.c, ppc-bdm.c: Update.
	* ppc-sysv-tdep.c, ptx4-nat.c, regcache.c, remote-es.c: Update.
	* remote-sds.c, remote-vx68.c, remote-vxmips.c: Update.
	* remote-vxsparc.c, rs6000-tdep.c, sol-thread.c: Update.
	* sparc-nat.c, sparc-tdep.c, sun3-nat.c, symm-nat.c: Update.
	* v850ice.c: Update.
2002-11-14 20:37:29 +00:00
Andrew Cagney 73937e031a 2002-11-13 Andrew Cagney <cagney@redhat.com>
* regcache.h (deprecated_read_register_bytes): Rename
	read_register_bytes.
	(deprecated_write_register_bytes): Rename write_register_bytes.
	* alpha-tdep.c, arm-tdep.c, cris-tdep.c, d10v-tdep.c: Update.
	* dwarf2cfi.c, frv-tdep.c, hppa-tdep.c, ia64-tdep.c: Update.
	* m68k-tdep.c, mcore-tdep.c, mips-tdep.c, mn10300-tdep.c: Update.
	* ns32k-tdep.c, regcache.c, remote-sds.c, remote-vx.c: Update.
	* remote.c, rs6000-tdep.c, s390-tdep.c, sh-tdep.c: Update.
	* sparc-tdep.c, v850-tdep.c, vax-tdep.c, x86-64-tdep.c: Update.
	* xstormy16-tdep.c, z8k-tdep.c, config/nm-gnu.h: Update.
	* config/nm-m3.h, config/h8500/tm-h8500.h: Update.
	* config/i386/nm-ptx4.h, config/i386/nm-symmetry.h: Update.
	* config/m32r/tm-m32r.h, config/m68k/nm-sun3.h: Update.
	* config/m68k/tm-delta68.h, config/m68k/tm-linux.h: Update.
	* config/mn10200/tm-mn10200.h, config/pa/tm-hppa64.h: Update.
	* config/sparc/nm-nbsd.h, config/sparc/nm-sun4os4.h: Update.
	* config/sparc/nm-sun4sol2.h, config/sparc/tm-sparclet.h: Update.

2002-11-13  Andrew Cagney  <ac131313@redhat.com>

	* mi-main.c (mi_cmd_data_write_register_values): Use
	deprecated_write_register_bytes instead of write_register_bytes.
2002-11-14 00:25:05 +00:00
Andrew Cagney 2d28509afb 2002-11-13 Andrew Cagney <cagney@redhat.com>
* regcache.c (struct regcache): Replace passthough_p with
	readonly_p.
	(regcache_xmalloc): Initialize readonly_p.
	(build_regcache): Initialize readonly_p.
	(regcache_save): New function.
	(regcache_restore): New function.
	(regcache_cpy): Re-implement using regcache_save and
	regcache_restore.
	(regcache_raw_read): Update.
	(regcache_cooked_read): When a read-only cache, checked for cached
	pseudo register values.
	(regcache_raw_write): Assert that the cache is not read-only.
	Remove code handling a non-passthrough cache.
	* regcache.h (regcache_save): Declare.
	(regcache_restore): Declare.
2002-11-13 17:59:40 +00:00
Andrew Cagney e600bd345d 2002-11-07 Andrew Cagney <ac131313@redhat.com>
* regcache.h (regcache_cooked_read_using_offset_hack)
	(regcache_cooked_write_using_offset_hack): Delete declarations.
	(register_changed): Delete declaration.
	* regcache.c (regcache_cooked_read_using_offset_hack)
	(regcache_cooked_write_using_offset_hack): Delete functions.
	(cooked_xfer_using_offset_hack): Delete function.
	(register_changed): Delete function.
2002-11-07 21:43:23 +00:00
Andrew Cagney 2b9e5f3fab 2002-11-07 Andrew Cagney <ac131313@redhat.com>
* regcache.c (deprecated_registers_fetched): Update.
	* regcache.h (deprecated_registers_fetched): Rename
	registers_fetched.
	* remote-vxsparc.c (vx_read_register): Update.
	* remote-vxmips.c (vx_read_register): Update.
	* remote-vx68.c (vx_read_register): Update.
	* irix5-nat.c (fetch_core_registers): Update.
	* mipsm3-nat.c (fetch_inferior_registers): Update.
	* sun3-nat.c (fetch_inferior_registers): Update.
	* symm-nat.c (fetch_inferior_registers): Update.
	* ns32knbsd-nat.c (fetch_inferior_registers): Update.
	(fetch_core_registers): Update.
	(fetch_kcore_registers): Update.
	* mips-nat.c (fetch_inferior_registers): Update.
	* corelow.c (get_core_registers): Update.
	* a68v-nat.c (fetch_inferior_registers): Update.
2002-11-07 15:31:31 +00:00
Andrew Cagney 8262ee2317 2002-11-06 Andrew Cagney <ac131313@redhat.com>
* regcache.h (deprecated_register_valid): Rename register_valid.
	* regcache.c: Update.
	* ia64-aix-nat.c: Update.
	* i386gnu-nat.c: Update.
	* alpha-nat.c: Update.
	* sparc-nat.c: Update.
	* lynx-nat.c: Update.
	* remote-mips.c: Update.
2002-11-07 02:40:28 +00:00
Andrew Cagney 192dbe3389 2002-11-02 Andrew Cagney <ac131313@redhat.com>
* regcache.h: Add coment indicating replacements for deprecated
	functions.
2002-11-02 20:06:56 +00:00
Andrew Cagney 4caf0990c1 2002-11-02 Andrew Cagney <cagney@redhat.com>
* regcache.h (deprecated_read_register_gen): Rename
	read_register_gen.
	(deprecated_write_register_gen): Rename write_register_gen.
	* i387-tdep.c: Update.
	* x86-64-linux-nat.c: Update
	* wince.c: Update.
	* thread-db.c: Update.
	* win32-nat.c: Update.
	* mips-tdep.c: Update.
	* d10v-tdep.c: Update.
	* cris-tdep.c: Update.
	* remote-sim.c: Update.
	* remote-rdi.c: Update.
	* remote-rdp.c: Update.
	* frame.c: Update.
	* target.c: Update.
	* blockframe.c: Update.
	* x86-64-tdep.c: Update.
	* xstormy16-tdep.c: Update.
	* sh-tdep.c: Update.
	* s390-tdep.c: Update.
	* rs6000-tdep.c: Update.
	* sparc-tdep.c: Update.
	* i386-tdep.c: Update.
	* dwarf2cfi.c: Update.
	* regcache.c: Update.
2002-11-02 14:59:10 +00:00
Mark Kettenis c00dcbe965 * regcache.c (regcache_raw_write_signed,
regcache_raw_write_unsigned): New functions.
* regcache.h (regcache_raw_write_signed,
regcache_raw_write_unsigned): New prototypes.
2002-08-25 23:44:30 +00:00
Andrew Cagney d3b22ed57c 2002-08-25 Andrew Cagney <ac131313@redhat.com>
* regcache.h (register_offset_hack): Declare.
	(regcache_cooked_read_using_offset_hack): Declare.
	(regcache_cooked_write_using_offset_hack): Declare.

	* regcache.c (register_offset_hack): New function.
	(regcache_cooked_read_using_offset_hack): New function.
	(regcache_cooked_write_using_offset_hack): New function.
	(regcache_dump): Check that the registers, according to their
	offset, are packed hard against each other.
	(cooked_xfer_using_offset_hack): New function.
2002-08-25 18:47:16 +00:00
Andrew Cagney bb4250135d 2002-08-25 Andrew Cagney <ac131313@redhat.com>
* regcache.c (struct regcache_descr): Add field register_type.
	(init_legacy_regcache_descr): Pass a pre-allocated regcache_descr
	in as a parameter
	(init_regcache_descr): Initialize register_type.  Pass the descr
	to init_legacy_regcache_descr.  Use register_type instead of
	REGISTER_VIRTUAL_TYPE.
	(register_type): New function.
	(regcache_dump): Replace REGISTER_VIRTUAL_TYPE with register_type.
	* regcache.h (register_type): Declare.
2002-08-25 15:36:11 +00:00
Andrew Cagney 0ed04cce6d 2002-08-25 Andrew Cagney <ac131313@redhat.com>
* regcache.c (max_register_size): New function.
	(init_legacy_regcache_descr): Ensure that max_register_size is
	large enough for REGISTER_VIRTUAL_SIZE.
	* regcache.h (max_register_size): Declare.
2002-08-25 14:44:04 +00:00
Andrew Cagney 06c0b04e1c 2002-08-18 Andrew Cagney <ac131313@redhat.com>
* regcache.c (regcache_xfer_part): New function.
(regcache_raw_read_part): New function.
(regcache_raw_write_part): New function.
(regcache_cooked_read_part): New function.
(regcache_cooked_write_part): New function.
* regcache.h (regcache_raw_read_part): Declare.
(regcache_raw_write_part): Declare.
(regcache_cooked_read_part): Declare.
(regcache_cooked_write_part): Declare.
2002-08-19 00:43:41 +00:00
Andrew Cagney 28fc674094 2002-08-13 Andrew Cagney <cagney@redhat.com>
* i386-tdep.c (i386_register_name): Handle mmx registers.
(mmx_regnum_p): New function.
(i386_mmx_names): New array.
(mmx_num_regs): New variable.
(i386_pseudo_register_read): New function.
(i386_pseudo_register_write): New function.
(mmx_regnum_to_fp_regnum): New function. Code from Fernando Nasser.

* regcache.c (regcache_raw_read_unsigned): New function.
(regcache_raw_read_signed): New function.
* regcache.h (regcache_raw_read_unsigned): Declare.
(regcache_raw_read_signed): Declare.
2002-08-13 14:32:28 +00:00
Andrew Cagney a378f41926 2002-08-12 Andrew Cagney <cagney@redhat.com>
* regcache.c (regcache_raw_read_as_address): Delete function.
(regcache_cooked_read_signed): New function.
(regcache_cooked_read_unsigned): New function.
* regcache.h (regcache_cooked_read_signed): Declare.
(regcache_cooked_read_unsigned): Declare.
(regcache_raw_read_as_address): Delete declaration.
* blockframe.c (generic_read_register_dummy): Use
regcache_cooked_read_unsigned.
* i386-tdep.c (i386_extract_struct_value_address): Use
regcache_cooked_read_unsigned.
2002-08-13 13:58:50 +00:00
Andrew Cagney 68365089fc Add the cooked register interface. 2002-08-02 18:08:31 +00:00
Andrew Cagney 1aaa5f999f 2002-07-24 Andrew Cagney <cagney@redhat.com>
* regcache.c (regcache_raw_write): Change buf parameter to a
constant void pointer.
(regcache_raw_read): Change buf parameter to a void pointer.
(legacy_write_register_gen): Change myaddr parameter a constant
void pointer.
(supply_register): Change val parameter to a const void pointer.
* regcache.h (regcache_raw_write): Update declaration.
(regcache_raw_read): Update declaration.
(supply_register): Update declaration.
2002-07-24 19:43:43 +00:00
Andrew Cagney 0818c12a55 2002-07-24 Andrew Cagney <cagney@redhat.com>
* regcache.h (regcache_raw_read, regcache_raw_write): Replace
regcache_read and regcache_write.
(regcache_raw_read_as_address): Replace regcache_read_as_address.
* regcache.c: Update.
* sh-tdep.c (sh64_push_arguments): Update comment.
(sh_pseudo_register_read): Update.
(sh_pseudo_register_write): Update.
(sh4_register_read): Update.
(sh4_register_write): Update.
(sh64_pseudo_register_read): Update.
(sh64_pseudo_register_write): Update.
(sh64_register_read): Update.
(sh64_register_write): Update.
* i386-tdep.c (i386_extract_return_value): Update.
(i386_extract_struct_value_address): Update.
(i386_extract_return_value): Update.
* blockframe.c (generic_read_register_dummy): Update.
(generic_call_dummy_register_unwind): Update
* infrun.c (write_inferior_status_register): Update.
2002-07-24 14:38:55 +00:00
Andrew Cagney 36160dc4b2 * infcmd.c (print_return_value): Remove compatibility code calling
deprecated_grub_regcache_for_registers.

* values.c: Include "regcache.h".
(value_being_returned): Update.  Use
deprecated_grub_regcache_for_registers to extract the register
buffer address.
* value.h (value_being_returned): Change ``retbuf'' parameter to a
``struct regcache''.
* Makefile.in (values.o): Add dependency on $(regcache_h).

* inferior.h (run_stack_dummy): Change type of second parameter to
a ``struct regcache''.
* valops.c (hand_function_call): Change type of retbuf to ``struct
regcache''.  Allocate using regcache_xmalloc, clean using
make_cleanup_regcache_xfree.
* infcmd.c (run_stack_dummy): Update.  Use
regcache_cpu_no_passthrough instead of memcpy to copy the buffer.

* regcache.c (do_regcache_xfree): New function.
(make_cleanup_regcache_xfree): New function.
* regcache.h (make_cleanup_regcache_xfree): Declare.
2002-07-03 20:36:54 +00:00
Andrew Cagney 37e7137227 * regcache.h: Update comments describing the regcache_cpy family
of functions.
(regcache_save, regcache_restore): Delete declaration.
(regcache_save_no_passthrough): Delete declaration.
(regcache_restore_no_passthrough): Delete declaration.
* regcache.c (regcache_save): Delete function.
(regcache_save_no_passthrough): Delete function.
(regcache_restore): Delete function.
(regcache_restore_no_passthrough): Delete function.
2002-06-22 21:18:32 +00:00