* [RFA] Fix disabling of longjmp breakpoint.
@ 2008-04-10 20:00 Vladimir Prus
2008-04-17 16:47 ` Daniel Jacobowitz
0 siblings, 1 reply; 5+ messages in thread
From: Vladimir Prus @ 2008-04-10 20:00 UTC (permalink / raw)
To: gdb-patches
The current code in step_1_continuation fails to disable
longjmp breakpoint. When we're done with 'step N', we call step_once
with the count of 0, which does nothing, and we don't remove the
breakpoint. We only remove it when we stop for some reason that
is not stepping.
Since step_1_continuation is used for 'step', not just 'step N',
it means we pretty much always fail to remove longjmp breakpoint.
Now, in always-inserted mode it causes an attempt to insert
longjmp breakpoint when restarting the program, which fails.
This patch fixes the logic in step_1_continuation to always
cleanup properly. It should be applied on top of the exec_cleanup
murder patch.
This patch was actually written by Pedro Alves, and I got to
test it since it's located between two other patches of mine :-)
OK?
- Volodya
* infcmd.c (step_1_continuation): Always disable longjmp
breakpoint if we're not going to do another step.
---
gdb/infcmd.c | 33 +++++++++++++++++----------------
1 files changed, 17 insertions(+), 16 deletions(-)
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index 0b4dc5d..238c001 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -798,24 +798,25 @@ which has no line number information.\n"), name);
static void
step_1_continuation (struct continuation_arg *arg, int error)
{
- if (error)
- disable_longjmp_breakpoint ();
- else
- {
- int count;
- int skip_subroutines;
- int single_inst;
+ int count;
+ int skip_subroutines;
+ int single_inst;
- skip_subroutines = arg->data.integer;
- single_inst = arg->next->data.integer;
- count = arg->next->next->data.integer;
-
- if (stop_step)
- step_once (skip_subroutines, single_inst, count - 1);
- else
- if (!single_inst || skip_subroutines)
- disable_longjmp_breakpoint ();
+ skip_subroutines = arg->data.integer;
+ single_inst = arg->next->data.integer;
+ count = arg->next->next->data.integer;
+
+ if (error || !step_multi || !stop_step)
+ {
+ /* We either hit an error, or stopped for some reason
+ that is not stepping, or there are no further steps
+ to make. Cleanup. */
+ if (!single_inst || skip_subroutines)
+ disable_longjmp_breakpoint ();
+ step_multi = 0;
}
+ else
+ step_once (skip_subroutines, single_inst, count - 1);
}
/* Do just one step operation. If count >1 we will have to set up a
--
1.5.3.5
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [RFA] Fix disabling of longjmp breakpoint.
2008-04-10 20:00 [RFA] Fix disabling of longjmp breakpoint Vladimir Prus
@ 2008-04-17 16:47 ` Daniel Jacobowitz
2008-04-17 16:55 ` Pedro Alves
0 siblings, 1 reply; 5+ messages in thread
From: Daniel Jacobowitz @ 2008-04-17 16:47 UTC (permalink / raw)
To: Vladimir Prus; +Cc: gdb-patches
On Thu, Apr 10, 2008 at 11:48:18PM +0400, Vladimir Prus wrote:
> This patch was actually written by Pedro Alves, and I got to
> test it since it's located between two other patches of mine :-)
>
> OK?
>
> - Volodya
>
> * infcmd.c (step_1_continuation): Always disable longjmp
> breakpoint if we're not going to do another step.
OK, but I bet there'll be some conflicts if Pedro gets around to
committing the longjmp overhaul first...
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFA] Fix disabling of longjmp breakpoint.
2008-04-17 16:47 ` Daniel Jacobowitz
@ 2008-04-17 16:55 ` Pedro Alves
2008-04-17 17:22 ` Pedro Alves
0 siblings, 1 reply; 5+ messages in thread
From: Pedro Alves @ 2008-04-17 16:55 UTC (permalink / raw)
To: gdb-patches; +Cc: Daniel Jacobowitz, Vladimir Prus
A Thursday 17 April 2008 17:36:13, Daniel Jacobowitz escreveu:
> On Thu, Apr 10, 2008 at 11:48:18PM +0400, Vladimir Prus wrote:
> > This patch was actually written by Pedro Alves, and I got to
> > test it since it's located between two other patches of mine :-)
> >
> > OK?
> >
> > - Volodya
> >
> > * infcmd.c (step_1_continuation): Always disable longjmp
> > breakpoint if we're not going to do another step.
>
> OK, but I bet there'll be some conflicts if Pedro gets around to
> committing the longjmp overhaul first...
I'll handle the conflicts when Vlad checks this in and the
keep-breakpoints-always-inserted patch as well, as my patches
conflict with that one too.
--
Pedro Alves
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFA] Fix disabling of longjmp breakpoint.
2008-04-17 16:55 ` Pedro Alves
@ 2008-04-17 17:22 ` Pedro Alves
2008-04-24 13:01 ` Vladimir Prus
0 siblings, 1 reply; 5+ messages in thread
From: Pedro Alves @ 2008-04-17 17:22 UTC (permalink / raw)
To: gdb-patches; +Cc: Daniel Jacobowitz, Vladimir Prus
A Thursday 17 April 2008 17:47:08, Pedro Alves escreveu:
> A Thursday 17 April 2008 17:36:13, Daniel Jacobowitz escreveu:
> > On Thu, Apr 10, 2008 at 11:48:18PM +0400, Vladimir Prus wrote:
> > > This patch was actually written by Pedro Alves, and I got to
> > > test it since it's located between two other patches of mine :-)
> > >
> > > OK?
> > >
> > > - Volodya
> > >
> > > * infcmd.c (step_1_continuation): Always disable longjmp
> > > breakpoint if we're not going to do another step.
> >
> > OK, but I bet there'll be some conflicts if Pedro gets around to
> > committing the longjmp overhaul first...
>
> I'll handle the conflicts when Vlad checks this in and the
> keep-breakpoints-always-inserted patch as well, as my patches
> conflict with that one too.
Vlad, and I think the murder-exec-murder conflicts too. I'll wait
for that to be in too.
--
Pedro Alves
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFA] Fix disabling of longjmp breakpoint.
2008-04-17 17:22 ` Pedro Alves
@ 2008-04-24 13:01 ` Vladimir Prus
0 siblings, 0 replies; 5+ messages in thread
From: Vladimir Prus @ 2008-04-24 13:01 UTC (permalink / raw)
To: gdb-patches
Pedro Alves wrote:
> A Thursday 17 April 2008 17:47:08, Pedro Alves escreveu:
>> A Thursday 17 April 2008 17:36:13, Daniel Jacobowitz escreveu:
>> > On Thu, Apr 10, 2008 at 11:48:18PM +0400, Vladimir Prus wrote:
>> > > This patch was actually written by Pedro Alves, and I got to
>> > > test it since it's located between two other patches of mine :-)
>> > >
>> > > OK?
>> > >
>> > > - Volodya
>> > >
>> > > * infcmd.c (step_1_continuation): Always disable longjmp
>> > > breakpoint if we're not going to do another step.
>> >
>> > OK, but I bet there'll be some conflicts if Pedro gets around to
>> > committing the longjmp overhaul first...
>>
>> I'll handle the conflicts when Vlad checks this in and the
>> keep-breakpoints-always-inserted patch as well, as my patches
>> conflict with that one too.
>
> Vlad, and I think the murder-exec-murder conflicts too. I'll wait
> for that to be in too.
Both exec-cleanup-murder and this one are now in. Thanks for the patience!
- Volodya
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-04-24 11:45 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-10 20:00 [RFA] Fix disabling of longjmp breakpoint Vladimir Prus
2008-04-17 16:47 ` Daniel Jacobowitz
2008-04-17 16:55 ` Pedro Alves
2008-04-17 17:22 ` Pedro Alves
2008-04-24 13:01 ` Vladimir Prus
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox