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: [3/3] RFC: fix PR mi/8444


On Thursday 17 November 2011 16:41:13, Tom Tromey wrote:
> >>>>> "Pedro" == Pedro Alves <pedro@codesourcery.com> writes:
> 
> Pedro> TARGET_WAITKIND_LOADED targets print this elsewhere, as
> Pedro> they don't use a shared library event breakpoint.  See
> Pedro> infrun.c:normal_stop.  Can you give that the same treatment?
> 
> What do you think of the appended?
> 
> I don't think I have access to a TARGET_WAITKIND_LOADED target, so I
> can't test this.
> 
> I added a 'kind' argument to bpstat_print, to centralize the printing.
> I wasn't sure if this is a good idea or not; I think the centralization
> idea is fine, but I wasn't sure if this addition is violating some
> abstraction boundary.

Yeah, looks fine.  This should probably be a catchpoint anyway.

> --- /dev/null
> +++ b/gdb/testsuite/gdb.mi/mi-solib.exp
> @@ -0,0 +1,55 @@

> +load_lib mi-support.exp
> +set MIFLAGS "-i=mi2"

The test uses shared libs -- it should be skipped if skip_shlib_tests.

> +
> +gdb_exit
> +if [mi_gdb_start] {
> +    continue
> +}
> +
> +set libname "solib-lib"
> +set srcfile_lib ${srcdir}/${subdir}/${libname}.c
> +set binfile_lib ${objdir}/${subdir}/${libname}.so
> +set lib_flags [list debug ldflags=-Wl,-Bsymbolic]

Is -Bsymbolic necessary?

> +
> +set testfile "solib-main"
> +set srcfile ${srcdir}/${subdir}/${testfile}.c
> +set binfile ${objdir}/${subdir}/${testfile}
> +set bin_flags [list debug shlib=${binfile_lib}]
> +
> +if [get_compiler_info ${binfile}] {
> +    return -1
> +}
> +
> +if { [gdb_compile_shlib ${srcfile_lib} ${binfile_lib} $lib_flags] != ""
> +     || [gdb_compile ${srcfile} ${binfile} executable $bin_flags] != "" } {
> +  untested "Could not compile $binfile_lib or $binfile."
> +  return -1
> +}
> +
> +mi_delete_breakpoints
> +mi_gdb_reinitialize_dir $srcdir/$subdir
> +mi_gdb_reinitialize_dir $srcdir/$subdir
> +mi_gdb_load ${binfile}

gdb_load_shlibs missing.

> --- /dev/null
> +++ b/gdb/testsuite/gdb.mi/solib-lib.c

> +#include <stdio.h>

Unnecessary header.

> --- /dev/null
> +++ b/gdb/testsuite/gdb.mi/solib-main.c

> +*/
> +#include <stdio.h>

Ditto.

>  
> +proc mi_run_cmd {args} {
> +    return [eval mi_run_cmd_full 1 $args]
> +}
> +
> +proc mi_run_with_cli {args} {
> +    return [eval mi_run_cmd_full 0 $args]
> +}

Describing comments would be nice.

Otherwise looks good to me.

-- 
Pedro Alves


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