This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH]: Don't use deprecated regcache functions


David S. Miller wrote:
From: Michael Snyder <msnyder@redhat.com>
Date: Wed, 12 Apr 2006 12:25:01 -0700


David S. Miller wrote:

From: Daniel Jacobowitz <drow@false.org>
Date: Tue, 11 Apr 2006 09:00:57 -0400



On Tue, Apr 11, 2006 at 01:39:09AM -0700, David S. Miller wrote:


Otherwise, ok to apply?

-      deprecated_read_register_gen (regno, raw);
+      regcache_raw_collect (current_regcache, regno, raw);
     thread_db_fetch_registers (-1);
     regcache_raw_supply (current_regcache, regno, raw);

I might be mistaken, but what the heck does the call to thread_db_fetch_registers accomplish? I think nothing.

Daniel, David's got the right of it.

Ok to apply? :-)

Well, I meant your explanation as to why thread_db_fetch_registers was used. Now that I look at the actual change...

Why did you pick register_raw_collect as the replacement?
It's not semantically equivalent.  I would have thought
that the least-intrusive, most semantically-neutral change
would have been to use regcache_cooked_read.

That doesn't mean I think it's more or less correct...
I get confused just thinking about all these variants.
If you have an argument for why one is more correct in
this context, I'm certainly open to it.  I can't really
convince myself that the current behavior is correct,
since deprecated_read_register_gen calls regcache_cooked_read,
which may call regcache_raw_read, which may call
target_fetch_registers *before* capturing the current value.
Which it seems like would defeat the purpose of the whole
exercise...



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]