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: [patch] testsuite: singlejmp-reverse.exp compatibility with Doug's GDB (PR 14615)


On Mon, Sep 24, 2012 at 10:58 PM, Jan Kratochvil
<jan.kratochvil@redhat.com> wrote:
> Hello Doug,
>
> http://sourceware.org/bugzilla/show_bug.cgi?id=14615
>
> according to IRC discussions IIUC Doug has disabled this patch:
>         [rfc, 7.3?] -O2 -g breakpoints internal error + prologue skipping
>         http://sourceware.org/ml/gdb-patches/2011-04/msg00229.html
>         http://sourceware.org/ml/gdb-patches/2011-05/msg00190.html
>         (there was no reply from anyone)

For completeness sake, I've only tentatively disabled the setting of
locations_valid if gcc_4_minor >= 7.
It's not perfect, it's just a heuristic, but all of this is currently
based on heuristics ...

For reference sake, here's one testcase.

int
main ()
{
  int a;
  a = 0;
  return a;
}

Compiled with a relatively recent gcc head with -O0 -g
-fomit-frame-pointer -mno-red-zone on amd64-linux I get this with gdb
cvs head:

(gdb) disas /m main
Dump of assembler code for function main:
3       {
   0x00000000004004cc <+0>:     sub    $0x10,%rsp

4         int a;
5         a = 0;
   0x00000000004004d0 <+4>:     movl   $0x0,0xc(%rsp)

6         return a;
   0x00000000004004d8 <+12>:    mov    0xc(%rsp),%eax

7       }
   0x00000000004004dc <+16>:    add    $0x10,%rsp
   0x00000000004004e0 <+20>:    retq

End of assembler dump.
(gdb) b main
Breakpoint 1 at 0x4004cc: file fomit-frame-pointer.c, line 3.

> The recent testcase below depends on this behavior but it is unrelated to its
> subject of test, therefore the testcase below can be made compatible with any
> GDB behavior wrt prologue skipping.

> This sure does not solve the Doug's changes for the prologue skipping itself.
>
>
> Thanks,
> Jan
>
>
> gdb/testsuite/
> 2012-09-25  Jan Kratochvil  <jan.kratochvil@redhat.com>
>
>         PR 14615
>         * gdb.reverse/singlejmp-reverse.exp: Use *main.
>
> diff --git a/gdb/testsuite/gdb.reverse/singlejmp-reverse.exp b/gdb/testsuite/gdb.reverse/singlejmp-reverse.exp
> index 830a89f..95d4d9b 100644
> --- a/gdb/testsuite/gdb.reverse/singlejmp-reverse.exp
> +++ b/gdb/testsuite/gdb.reverse/singlejmp-reverse.exp
> @@ -38,7 +38,9 @@ if [info exists COMPILE] {
>
>  clean_restart $executable
>
> -if ![runto_main] {
> +# '*' is there to ensure prologue is not skipped with some GDB versions.
> +# This is just to unify the commands below across various GDB versions.
> +if ![runto "*main"] {
>      return -1
>  }

That's one solution, thanks.
Note that this doesn't really need to go into fsf gdb.
I'll do something here, but I'm not expecting upstream's testsuite to
contain patches addressing non-upstream gdbs (for particular
situations such as this - in a different context I may feel
differently).


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