From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Snyder To: Eli Zaretskii Cc: kettenis@science.uva.nl, gdb-patches@sources.redhat.com Subject: Re: [PATCH]: Make Linux use the new unified x86 watchpoint support Date: Tue, 27 Mar 2001 11:58:00 -0000 Message-id: <3AC0F0EA.F7E2AC40@cygnus.com> References: <3AC0C5B6.3C05@redhat.com> <200103271746.MAA08374@indy.delorie.com> X-SW-Source: 2001-03/msg00509.html Eli Zaretskii wrote: > > > Date: Tue, 27 Mar 2001 08:54:14 -0800 > > From: Michael Snyder > > > > > > This possibility has been discussed back in November, but the > > > > conclusion was that it's not a good idea. I don't remember the > > > > details, but the reasons had something to do with threads and how > > > > the register cache is used in conjunction with threads. (I can dig > > > > out the URLs of the relevant messages, if you want to read them.) > > > > > > > > I suggested doing this, but several people objected to exposing the > > > > debug registers in this way. Threads have nothing to do with it > > > > > > I'm quite sure they did. IIRC, the issue was that debug registers are > > > global, whereas normal registers are per thread. > > > > Mmmmm... that's probably true. However the effect would just be > > that all threads appear to have the same values for debug regs. > > If you change them in one, they'll change in all. > > As far as I understood, GDB's regcache cannot do such magic. It > assumes that all the registers are per thread, so if you change them > in one thread, the other threads' registers remain unchanged in the > cache. Currently there is only one cache (not one per thread). When you change threads, the cache is flushed. However, there are plans for a per-thread cache, so your concern is not ill-placed. > In other words, this kind of global registers is (or was when we > discussed it) incompatible with how regcache works. That is why I was > advised not to introduce the debug registers into the regcache. They could be pseudo-registers, which means the debugger would have the opportunity to handle them specially.