This is the mail archive of the gdb-patches@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: [win32] Fix suspend count handling


On Nov 21, 2007 2:13 PM, Pierre Muller wrote:

>   Your patch does indeed correct this to 3, which is what is wanted.
> But if you use 'continue' instead of 'next' when you are at line
> 37, you will get '4' printed out instead of three, because
> the main thread will have call SuspendThread before gdb does.
> This is at least what happens on my computer.
>

Are you sure this was from a gdb with this patch installed?  I get 4
without the patch, but with this patch (*without* the other
watchpoint patch on top) I still get 3 no matter how I try it:

$ gdb/gdb.exe main.exe
GNU gdb 6.7.50.20071121
Copyright (C) 2007 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-cygwin"...
(gdb) b 37
Breakpoint 1 at 0x40119a: file main.c, line 37.
(gdb) r
Starting program: /d/gdb/build/main.exe

Breakpoint 1, main (argc=1, argv=0x6b3270) at main.c:37
37        suspend_count = ResumeThread (h); /* set breakpoint here */
(gdb) c
Continuing.
3

Program exited normally.
(gdb)

>
>   OK, in that case it is indeed correct to do all the ResumeThread calls
> before ContinueDebugEvent is called, and thus the suspend_count can be
> replaced
> by suspended Boolean value.

Not a boolean, its a three state -- suspend_count also accepted -1, and I've
kept that.

>   But only the combination of the two patches will ensure to
> always obtain '3' using 'continue' or 'next'.

That's not what I see here.  Can you show me a run where you get 4
only this patch applied?

Cheers,
Pedro Alves


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