From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Jacobowitz To: Michael Snyder Cc: gdb-patches@sources.redhat.com Subject: Re: [PATCH/RFC] Improve the "thread_step_needed" logic Date: Sat, 16 Jun 2001 11:58:00 -0000 Message-id: <20010616115802.A29172@nevyn.them.org> References: <200106152335.f5FNZ9S02028@mvstp600e.cygnus.com> <20010615164433.A29314@nevyn.them.org> <3B2AB2D4.F8C95E0D@cygnus.com> X-SW-Source: 2001-06/msg00324.html On Fri, Jun 15, 2001 at 06:13:56PM -0700, Michael Snyder wrote: > > > > > > While you're fixing this, could you please address my issue from last > > week with this code? Checking "step" at this point in resume() is not > > correct, since it will have been cleared if SOFTWARE_SINGLE_STEP_P (). > > > > > --- 879,913 ---- > > > if (should_resume) > > > { > > > ptid_t resume_ptid; > > > + > > > + resume_ptid = RESUME_ALL; /* Default */ > > > > > > ! if ((step || singlestep_breakpoints_inserted_p) && > > > ! !breakpoints_inserted && breakpoint_here_p (read_pc ())) > > > > > + > > > + #ifdef CANNOT_STEP_BREAKPOINT > > > + /* Most targets can step a breakpoint instruction, thus executing it > > > + normally. But if this one cannot, just continue and we will hit > > > + it anyway. */ > > > + if (step && breakpoints_inserted && breakpoint_here_p (read_pc ())) > > > + step = 0; > > > + #endif > > > > Specifically, those bits. > > Oh, sorry, I missed this part of your msg. > Well, this isn't related to SOFTWARE_SINGLESTEP_P, > it's a separate issue. But if you'll notice, I believe this is also > handled correctly, because my "thread_step_needed" test includes > (NOT breakpoints_inserted), while this CANNOT_STEP_BREAKPOINT clause > will only be taken if breakpoints_inserted is true. So they are > mutually exclusive, if you will. I tested this on Alpha Linux, which > does NOT use software single step, but DOES use CANNOT_STEP_BREAKPOINT, > and it works. My apologies. I need to read closer before replying :) I'm assuming that singlestep_breakpoints_inserted_p is zero normally upon entering resume - that only makes sense. In that case, your change preserves the exact behavior I was asking for. I'm going to run it through the testsuite on MIPS/Linux, which I've finally gotten into (almost) functional shape, and let you know if something breaks - I expect that it will not break, though. -- Daniel Jacobowitz Debian GNU/Linux Developer Monta Vista Software Debian Security Team