This is the mail archive of the gdb@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: Implementation of different software breakpoint kinds in gdb server


> It's not the next_pc bits per se, but the run control stuff that always
> gets tricky.  Well, every time I think touching run control stuff in either
> gdb or gdbserver shouldn't be hard, I spend long whiles head banging.
> Maybe it's just me.  :-)

It's not just you.  For the first few years that I maintained GDB in
the 1990s, whenever I changed something in that big wait_for_inferior
jungle, I would introduce two bugs for every bug I fixed.  I got
pretty cautious about messing around in there.  Eventually I
started factoring the huge function into smaller functions, which
reduced the conceptual complexity somewhat.  Also, I gradually
got better at learning what would break it, and we also built up
a test suite that could test for obvious breakages.

> It'd be nice to avoid the duplication, though that might not be easy.

If you DO end up moving any of this infrastructure into the
target environment, I strongly recommend using common code.
It is hard enough to debug it once -- let alone debugging it
separately on each target as they evolve separate versions of
this very complicated code.

	John


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