From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark Kettenis To: eliz@delorie.com Cc: gdb@sources.redhat.com Subject: Re: gdb doesn't work very well with dynamic linked binaries Date: Fri, 08 Sep 2000 08:30:00 -0000 Message-id: <200009081529.e88FTjx15960@debye.wins.uva.nl> References: <200009070855.EAA00749@albacore> <200009071500.LAA07756@indy.delorie.com> X-SW-Source: 2000-09/msg00086.html Date: Thu, 7 Sep 2000 11:00:32 -0400 (EDT) From: Eli Zaretskii CC: jcownie@etnus.com, gdb@sources.redhat.com Content-Type: text Content-Length: 1217 > Date: Thu, 7 Sep 2000 12:09:50 +0200 (MET DST) > From: Mark Kettenis > > Yep. This means that getting HW watchpoints working for > multi-threaded processes is a bit difficult, since GDB expects them to > be process-wide. So any HW watchpoints will have to be inserted in > *all* threads, not just one as we do now. > > Eli, this probably means that adding the debugging registers to GDB's > register cache isn't a good idea. Something more specialized is > needed, i.e. a native-dependent interface that updates the address and > control register in all threads. This might implicate that keeping > the actual HW watchpoint support a native-only thing is a good idea. Why ``native-dependent'' and not ``target-dependent''? Won't the same problem affect any multithreaded ia32 target? Or am I missing something? Well, we already have a special packet in the remote protocol for setting watchpoints, so in principle it isn't necessary to be ``target-dependant''. The problems are likely to be different for the other multi-threaded systems. Linux is kinda weird in that respect. In any case, would a special array of debug registers be an okay solution? The elements of that array will be set by ia32_insert_watchpoint and ia32_remove_watchpoint (to be written), and target-dependent subroutines which resume the inferior and get control when the inferior is stopped will access that array to pass the registers to the debuggee. I think it is important to realize that the address and control registers should be per-process, whereas the status register should be per-thread. On Linux, the code to actually pass the registers to the debuggee should probably live in the (currently native-only) threads-module. Oh, and please use an i386_ prefix for the function names instead of ia32_ for consistency :-). Mark