[PATCH V8 1/1] Intel MPX bound violation handling

Pedro Alves palves@redhat.com
Wed Feb 17 15:51:00 GMT 2016


On 02/05/2016 04:58 PM, Walfred Tedeschi wrote:

> diff --git a/gdb/NEWS b/gdb/NEWS
> index d9cbb80..19985bc 100644
> --- a/gdb/NEWS
> +++ b/gdb/NEWS
> @@ -3,6 +3,20 @@
>  
>  *** Changes since GDB 7.10
>  
> +* Intel MPX bound violation handling.

(Please remember to move this to the 7.11 section.)

>  
>  static void
> diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
> index 7da31c8..3e9b289 100644
> --- a/gdb/doc/gdb.texinfo
> +++ b/gdb/doc/gdb.texinfo
> @@ -5819,6 +5819,33 @@ $1 = (void *) 0x7ffff7ff7000

> +bounds, while with @code{handle nostop SIGSEGV} no additional
> +information is displayed..

Spurious double period.

> +void
> +i386_linux_handle_segmentation_fault (struct gdbarch *gdbarch,
> +				      struct ui_out *uiout)
> +{


> +  ui_out_text (uiout, _("]"));
> +  return;

Remove useless return.

> +set segv_upper_bound "$u_fault.*$gdb_prompt $"
> +
> +set segv_lower_bound "$l_fault.*$gdb_prompt $"

AFAICS, these two are unused now.  Remove them.

> +set parameters "print pass nostop"
> +with_test_prefix "$parameters" {
> +    if ![runto_main] {
> +        fail "could not run to main"
> +        return -1
> +    }
> +
> +    gdb_test "handle SIGSEGV $parameters"\
> +             ".*SIGSEGV.*No.*Yes.*Yes.*Segmentation fault.*"\
> +             "set parameters"
> +
> +    gdb_test "continue" ".*$segv_with_exit.*" "Display"
> +
> +    gdb_test "where" "No stack." "no inferior $parameters"

This "$parameters" here will end up producing redundant
test message, given the with_test_prefix already includes
that info.  Remove it:

   gdb_test "where" "No stack." "no inferior"

Please take look at the resulting gdb.sum file, and check for
other similar cases and fix them.

The code changes are OK with the above issues addressed.

I think you still need to get an OK from Eli, though.

Thanks,
Pedro Alves



More information about the Gdb-patches mailing list