public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM]  archer-sergiodj-stap: Merge remote branch 'origin/master' into archer-sergio-stap
@ 2011-03-28 23:12 sergiodj
  0 siblings, 0 replies; only message in thread
From: sergiodj @ 2011-03-28 23:12 UTC (permalink / raw)
  To: archer-commits

The branch, archer-sergiodj-stap has been updated
       via  39408dcdff87543c04dccce5e9f586607a974c14 (commit)
       via  48ccae6422ee8e4025e0ff4b35668672a58e0d53 (commit)
       via  b5f799550a4d17b2820b5f0b27dabe1833188564 (commit)
       via  e4ad4000154dfd6b4a4e1cacde400441ebca608f (commit)
       via  26d160eaebc737c1a45f07f99c80cce979874aac (commit)
       via  f10617c2cd5f8a2951fba9b3a256726f8e0dec8a (commit)
       via  be30267300397d0fef6ec261d91864f0d837124e (commit)
       via  e02d3cc0fc7e6e1ad50b49945c28620568f3f2f8 (commit)
       via  6e1991d4baf179528193e885bf0ae5a2034384fe (commit)
       via  18444b46717da61b1ef977891fa163ed74a94a88 (commit)
       via  628f295c973dfb00698e5593476cd46bcac5520a (commit)
      from  90bd86f0127cc94e20268299a4b8cbe741af9dc8 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit 39408dcdff87543c04dccce5e9f586607a974c14
Merge: 90bd86f 48ccae6
Author: Sergio Durigan Junior <sergiodj@redhat.com>
Date:   Mon Mar 28 20:12:00 2011 -0300

    Merge remote branch 'origin/master' into archer-sergio-stap
    
    Conflicts:
    	gdb/elfread.c

commit 48ccae6422ee8e4025e0ff4b35668672a58e0d53
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Mon Mar 28 20:31:53 2011 +0000

    gdb/testsuite/
    	Test STT_GNU_IFUNC support.
    	* gdb.base/gnu-ifunc-lib.c: New file.
    	* gdb.base/gnu-ifunc.c: New file.
    	* gdb.base/gnu-ifunc.exp: New file.

commit b5f799550a4d17b2820b5f0b27dabe1833188564
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Mon Mar 28 20:29:50 2011 +0000

    gdb/
    	Support resolution of STT_GNU_IFUNC via breakpoints.
    	* breakpoint.c (print_it_typical): Support bp_gnu_ifunc_resolver and
    	bp_gnu_ifunc_resolver_return.
    	(bpstat_what): Rename parameter to bs_head, new variable bs, adjust
    	the loop.  Support bp_gnu_ifunc_resolver and
    	bp_gnu_ifunc_resolver_return.  New comment after the loop.  New loop
    	for bp_gnu_ifunc_resolver and bp_gnu_ifunc_resolver_return
    	breakpoints.
    	(bptype_string, print_one_breakpoint_location): Support
    	bp_gnu_ifunc_resolver and bp_gnu_ifunc_resolver_return.
    	(user_settable_breakpoint): Return true also for
    	bp_gnu_ifunc_resolver.
    	(allocate_bp_location): Support bp_gnu_ifunc_resolver and
    	bp_gnu_ifunc_resolver_return.
    	(set_breakpoint_location_function): New parameter explicit_loc,
    	describe it.  Call find_pc_partial_function_gnu_ifunc with new
    	variable IS_GNU_IFUNC and adjust the address for STT_GNU_IFUNC if
    	EXPLICIT_LOC is not set.
    	(set_raw_breakpoint): Set EXPLICIT_LOC for
    	set_breakpoint_location_function.
    	(clone_momentary_breakpoint): Use true for EXPLICIT_LOC of
    	set_breakpoint_location_function.
    	(mention): Support bp_gnu_ifunc_resolver and
    	bp_gnu_ifunc_resolver_return.
    	(add_location_to_breakpoint): Set EXPLICIT_LOC for
    	set_breakpoint_location_function.
    	(update_breakpoint_locations): Remove static.
    	(breakpoint_re_set_one): Support bp_gnu_ifunc_resolver and
    	bp_gnu_ifunc_resolver_return.
    	* breakpoint.h (enum bptype): New fields bp_gnu_ifunc_resolver and
    	bp_gnu_ifunc_resolver_return.
    	(update_breakpoint_locations): New declaration.
    	* elfread.c: Include gdbthread.h and regcache.h.
    	(elf_gnu_ifunc_resolver_stop, elf_gnu_ifunc_resolver_return_stop): New
    	functions.
    	(elf_gnu_ifunc_fns): Install them.
    	* minsyms.c (stub_gnu_ifunc_resolver_stop)
    	(stub_gnu_ifunc_resolver_return_stop): New functions.
    	(stub_gnu_ifunc_fns): Install them.
    	* symtab.h (struct gnu_ifunc_fns): New fields gnu_ifunc_resolver_stop
    	and gnu_ifunc_resolver_return_stop.
    	(gnu_ifunc_resolver_stop, gnu_ifunc_resolver_return_stop): New.

commit e4ad4000154dfd6b4a4e1cacde400441ebca608f
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Mon Mar 28 20:26:24 2011 +0000

    gdb/
    	STT_GNU_IFUNC reader implementation.
    	* elfread.c: Include gdbtypes.h, value.h and infcall.h.
    	(SYMBOL_GOT_PLT_SUFFIX, elf_rel_plt_read)
    	(elf_objfile_gnu_ifunc_cache_data, struct elf_gnu_ifunc_cache)
    	(elf_gnu_ifunc_cache_hash, elf_gnu_ifunc_cache_eq)
    	(elf_gnu_ifunc_record_cache, elf_gnu_ifunc_resolve_by_cache)
    	(elf_gnu_ifunc_resolve_by_got, elf_gnu_ifunc_resolve_name)
    	(elf_gnu_ifunc_resolve_addr): New.
    	(elf_symfile_read): Call elf_rel_plt_read.
    	(elf_gnu_ifunc_fns): New.
    	(_initialize_elfread): Initialize elf_objfile_gnu_ifunc_cache_data.
    	Install elf_gnu_ifunc_fns.
    	* infcall.c (find_function_return_type): New function.
    	(find_function_addr): Resolve TYPE_GNU_IFUNC functions, if possible.
    	* minsyms.c (stub_gnu_ifunc_resolve_addr)
    	(stub_gnu_ifunc_resolve_name): New functions.
    	(stub_gnu_ifunc_fns, gnu_ifunc_fns_p): New variables.
    	* symtab.h (struct gnu_ifunc_fns, gnu_ifunc_resolve_addr)
    	(gnu_ifunc_resolve_name, gnu_ifunc_fns_p): New.

commit 26d160eaebc737c1a45f07f99c80cce979874aac
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Mon Mar 28 20:24:04 2011 +0000

    gdb/
    	Code cleanup for later STT_GNU_IFUNC support.
    	* infcall.c (find_function_addr): Remove variable code, use explicit
    	dereferences for it.  Move VALUE_TYPE initialization later.

commit f10617c2cd5f8a2951fba9b3a256726f8e0dec8a
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Mon Mar 28 20:22:51 2011 +0000

    gdb/
    	GDB find_pc_partial_function support for STT_GNU_IFUNC.
    	* blockframe.c (cache_pc_function_is_gnu_ifunc): New variable.
    	(clear_pc_function_cache): Clear it.
    	(find_pc_partial_function): Rename to ...
    	(find_pc_partial_function_gnu_ifunc): ... this function.  New
    	parameter is_gnu_ifunc_p, describe it.  Set *IS_GNU_IFUNC_P.
    	(find_pc_partial_function): New wrapper for this function.
    	* symtab.h (find_pc_partial_function_gnu_ifunc): New declaration.

commit be30267300397d0fef6ec261d91864f0d837124e
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Mon Mar 28 20:21:03 2011 +0000

    gdb/
    	GDB internal type support for STT_GNU_IFUNC.
    	* elfread.c (record_minimal_symbol): Support mst_text_gnu_ifunc.
    	(elf_symtab_read): Set mst_text_gnu_ifunc for
    	BSF_GNU_INDIRECT_FUNCTION.
    	* eval.c (evaluate_subexp_standard): Support TYPE_GNU_IFUNC.
    	* gdbtypes.c (init_type): Support TYPE_FLAG_GNU_IFUNC,
    	builtin_func_func, nodebug_text_gnu_ifunc_symbol and
    	nodebug_got_plt_symbol.
    	* gdbtypes.h (enum type_flag_value): New entry TYPE_FLAG_GNU_IFUNC.
    	(TYPE_GNU_IFUNC): New.
    	(struct main_type): New field flag_gnu_ifunc.
    	(struct builtin_type): New field builtin_func_func.
    	(struct objfile_type): New fields nodebug_text_gnu_ifunc_symbol and
    	nodebug_got_plt_symbol.
    	* minsyms.c (lookup_minimal_symbol_text): Support mst_text_gnu_ifunc.
    	(in_gnu_ifunc_stub): New.
    	(prim_record_minimal_symbol, find_solib_trampoline_target): Support
    	mst_text_gnu_ifunc.
    	* parse.c (write_exp_msymbol): New variable ifunc_msym.  Detect and
    	support mst_text_gnu_ifunc.  Support mst_slot_got_plt.
    	* solib-svr4.c (svr4_in_dynsym_resolve_code): Return true also for
    	in_gnu_ifunc_stub.
    	* symmisc.c (dump_msymbols): Support mst_text_gnu_ifunc.
    	* symtab.c (search_symbols): Likewise.
    	* symtab.h (enum minimal_symbol_type): New fields mst_text_gnu_ifunc
    	and mst_slot_got_plt.
    	(in_gnu_ifunc_stub): New declaration.

commit e02d3cc0fc7e6e1ad50b49945c28620568f3f2f8
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Mon Mar 28 20:18:56 2011 +0000

    gdb/
    	Support a ring of related breakpoints.
    	* breakpoint.c (watchpoint_del_at_next_stop): New, move here code from
    	other functions, add gdb_assert.
    	(update_watchpoint, watchpoint_check): Add gdb_assert.  Use
    	watchpoint_del_at_next_stop.
    	(bpstat_check_watchpoint): Use watchpoint_del_at_next_stop.
    	(bpstat_stop_status): Handle ring in related_breakpoint.
    	(set_raw_breakpoint_without_location): Initialize ring in
    	related_breakpoint.
    	(delete_breakpoint): Handle ring in related_breakpoint, use
    	watchpoint_del_at_next_stop.
    	(map_breakpoint_numbers): Handle ring in related_breakpoint.
    
    gdb/testsuite/
    	Support a ring of related breakpoints.
    	* gdb.base/watchpoint-delete.c: New file.
    	* gdb.base/watchpoint-delete.exp: New file.

commit 6e1991d4baf179528193e885bf0ae5a2034384fe
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Mon Mar 28 20:07:12 2011 +0000

    gdb/testsuite/
    	* gdb.ada/arrayparam.exp (print first after function call): Use
    	explicit package name.  Add a comment
    	(print lasta after function call): Rename ...
    	(print last after function call): ... it and use explicit package
    	name.
    	(print length after function call): Use explicit package name.
    	* gdb.ada/str_ref_cmp.exp (operator = works for strings): New test.
    	* gdb.ada/sym_print_name.exp: Change `i' to `integervar'.
    	(multiple matches for symbol i): Rename ...
    	(multiple matches for symbol integervar): ... it.
    	* gdb.ada/sym_print_name/foo.adb (Foo): Change `I' to `IntegerVar'.
    	* gdb.ada/sym_print_name/pck.ads (Pck): Likewise.

commit 18444b46717da61b1ef977891fa163ed74a94a88
Author: Tom Tromey <tromey@redhat.com>
Date:   Mon Mar 28 19:53:12 2011 +0000

    	PR symtab/12441:
    	* dwarf2read.c (prepare_one_comp_unit): Don't call set_cu_language
    	with `language_minimal'.

commit 628f295c973dfb00698e5593476cd46bcac5520a
Author: Tom Tromey <tromey@redhat.com>
Date:   Mon Mar 28 18:05:38 2011 +0000

    	* gdb.texinfo (Set Tracepoints): Fix typo.

-----------------------------------------------------------------------

Summary of changes:
 gdb/ChangeLog                                |  135 +++++++
 gdb/blockframe.c                             |   35 ++-
 gdb/breakpoint.c                             |  184 ++++++++--
 gdb/breakpoint.h                             |   16 +
 gdb/doc/ChangeLog                            |    4 +
 gdb/doc/gdb.texinfo                          |    2 +-
 gdb/dwarf2read.c                             |    5 +-
 gdb/elfread.c                                |  495 +++++++++++++++++++++++++-
 gdb/eval.c                                   |    2 +
 gdb/gdbtypes.c                               |   16 +
 gdb/gdbtypes.h                               |   14 +
 gdb/infcall.c                                |   46 ++-
 gdb/minsyms.c                                |   72 ++++-
 gdb/parse.c                                  |   24 ++-
 gdb/solib-svr4.c                             |    3 +-
 gdb/symmisc.c                                |    3 +
 gdb/symtab.c                                 |    2 +-
 gdb/symtab.h                                 |   37 ++
 gdb/testsuite/ChangeLog                      |   28 ++
 gdb/testsuite/gdb.ada/arrayparam.exp         |   11 +-
 gdb/testsuite/gdb.ada/str_ref_cmp.exp        |   13 +
 gdb/testsuite/gdb.ada/sym_print_name.exp     |   10 +-
 gdb/testsuite/gdb.ada/sym_print_name/foo.adb |    4 +-
 gdb/testsuite/gdb.ada/sym_print_name/pck.ads |    4 +-
 gdb/testsuite/gdb.base/gnu-ifunc-lib.c       |   33 ++
 gdb/testsuite/gdb.base/gnu-ifunc.c           |   61 ++++
 gdb/testsuite/gdb.base/gnu-ifunc.exp         |  146 ++++++++
 gdb/testsuite/gdb.base/watchpoint-delete.c   |   33 ++
 gdb/testsuite/gdb.base/watchpoint-delete.exp |   38 ++
 29 files changed, 1396 insertions(+), 80 deletions(-)
 create mode 100644 gdb/testsuite/gdb.base/gnu-ifunc-lib.c
 create mode 100644 gdb/testsuite/gdb.base/gnu-ifunc.c
 create mode 100644 gdb/testsuite/gdb.base/gnu-ifunc.exp
 create mode 100644 gdb/testsuite/gdb.base/watchpoint-delete.c
 create mode 100644 gdb/testsuite/gdb.base/watchpoint-delete.exp

First 500 lines of diff:
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index a21aa81..03885dd 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,138 @@
+2011-03-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+	Support resolution of STT_GNU_IFUNC via breakpoints.
+	* breakpoint.c (print_it_typical): Support bp_gnu_ifunc_resolver and
+	bp_gnu_ifunc_resolver_return.
+	(bpstat_what): Rename parameter to bs_head, new variable bs, adjust
+	the loop.  Support bp_gnu_ifunc_resolver and
+	bp_gnu_ifunc_resolver_return.  New comment after the loop.  New loop
+	for bp_gnu_ifunc_resolver and bp_gnu_ifunc_resolver_return
+	breakpoints.
+	(bptype_string, print_one_breakpoint_location): Support
+	bp_gnu_ifunc_resolver and bp_gnu_ifunc_resolver_return.
+	(user_settable_breakpoint): Return true also for
+	bp_gnu_ifunc_resolver.
+	(allocate_bp_location): Support bp_gnu_ifunc_resolver and
+	bp_gnu_ifunc_resolver_return.
+	(set_breakpoint_location_function): New parameter explicit_loc,
+	describe it.  Call find_pc_partial_function_gnu_ifunc with new
+	variable IS_GNU_IFUNC and adjust the address for STT_GNU_IFUNC if
+	EXPLICIT_LOC is not set.
+	(set_raw_breakpoint): Set EXPLICIT_LOC for
+	set_breakpoint_location_function.
+	(clone_momentary_breakpoint): Use true for EXPLICIT_LOC of
+	set_breakpoint_location_function.
+	(mention): Support bp_gnu_ifunc_resolver and
+	bp_gnu_ifunc_resolver_return.
+	(add_location_to_breakpoint): Set EXPLICIT_LOC for
+	set_breakpoint_location_function.
+	(update_breakpoint_locations): Remove static.
+	(breakpoint_re_set_one): Support bp_gnu_ifunc_resolver and
+	bp_gnu_ifunc_resolver_return.
+	* breakpoint.h (enum bptype): New fields bp_gnu_ifunc_resolver and
+	bp_gnu_ifunc_resolver_return.
+	(update_breakpoint_locations): New declaration.
+	* elfread.c: Include gdbthread.h and regcache.h.
+	(elf_gnu_ifunc_resolver_stop, elf_gnu_ifunc_resolver_return_stop): New
+	functions.
+	(elf_gnu_ifunc_fns): Install them.
+	* minsyms.c (stub_gnu_ifunc_resolver_stop)
+	(stub_gnu_ifunc_resolver_return_stop): New functions.
+	(stub_gnu_ifunc_fns): Install them.
+	* symtab.h (struct gnu_ifunc_fns): New fields gnu_ifunc_resolver_stop
+	and gnu_ifunc_resolver_return_stop.
+	(gnu_ifunc_resolver_stop, gnu_ifunc_resolver_return_stop): New.
+
+2011-03-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+	STT_GNU_IFUNC reader implementation.
+	* elfread.c: Include gdbtypes.h, value.h and infcall.h.
+	(SYMBOL_GOT_PLT_SUFFIX, elf_rel_plt_read)
+	(elf_objfile_gnu_ifunc_cache_data, struct elf_gnu_ifunc_cache)
+	(elf_gnu_ifunc_cache_hash, elf_gnu_ifunc_cache_eq)
+	(elf_gnu_ifunc_record_cache, elf_gnu_ifunc_resolve_by_cache)
+	(elf_gnu_ifunc_resolve_by_got, elf_gnu_ifunc_resolve_name)
+	(elf_gnu_ifunc_resolve_addr): New.
+	(elf_symfile_read): Call elf_rel_plt_read.
+	(elf_gnu_ifunc_fns): New.
+	(_initialize_elfread): Initialize elf_objfile_gnu_ifunc_cache_data.
+	Install elf_gnu_ifunc_fns.
+	* infcall.c (find_function_return_type): New function.
+	(find_function_addr): Resolve TYPE_GNU_IFUNC functions, if possible.
+	* minsyms.c (stub_gnu_ifunc_resolve_addr)
+	(stub_gnu_ifunc_resolve_name): New functions.
+	(stub_gnu_ifunc_fns, gnu_ifunc_fns_p): New variables.
+	* symtab.h (struct gnu_ifunc_fns, gnu_ifunc_resolve_addr)
+	(gnu_ifunc_resolve_name, gnu_ifunc_fns_p): New.
+
+2011-03-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+	Code cleanup for later STT_GNU_IFUNC support.
+	* infcall.c (find_function_addr): Remove variable code, use explicit
+	dereferences for it.  Move VALUE_TYPE initialization later.
+
+2011-03-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+	GDB find_pc_partial_function support for STT_GNU_IFUNC.
+	* blockframe.c (cache_pc_function_is_gnu_ifunc): New variable.
+	(clear_pc_function_cache): Clear it.
+	(find_pc_partial_function): Rename to ...
+	(find_pc_partial_function_gnu_ifunc): ... this function.  New
+	parameter is_gnu_ifunc_p, describe it.  Set *IS_GNU_IFUNC_P.
+	(find_pc_partial_function): New wrapper for this function.
+	* symtab.h (find_pc_partial_function_gnu_ifunc): New declaration.
+
+2011-03-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+	GDB internal type support for STT_GNU_IFUNC.
+	* elfread.c (record_minimal_symbol): Support mst_text_gnu_ifunc.
+	(elf_symtab_read): Set mst_text_gnu_ifunc for
+	BSF_GNU_INDIRECT_FUNCTION.
+	* eval.c (evaluate_subexp_standard): Support TYPE_GNU_IFUNC.
+	* gdbtypes.c (init_type): Support TYPE_FLAG_GNU_IFUNC,
+	builtin_func_func, nodebug_text_gnu_ifunc_symbol and
+	nodebug_got_plt_symbol.
+	* gdbtypes.h (enum type_flag_value): New entry TYPE_FLAG_GNU_IFUNC.
+	(TYPE_GNU_IFUNC): New.
+	(struct main_type): New field flag_gnu_ifunc.
+	(struct builtin_type): New field builtin_func_func.
+	(struct objfile_type): New fields nodebug_text_gnu_ifunc_symbol and
+	nodebug_got_plt_symbol.
+	* minsyms.c (lookup_minimal_symbol_text): Support mst_text_gnu_ifunc.
+	(in_gnu_ifunc_stub): New.
+	(prim_record_minimal_symbol, find_solib_trampoline_target): Support
+	mst_text_gnu_ifunc.
+	* parse.c (write_exp_msymbol): New variable ifunc_msym.  Detect and
+	support mst_text_gnu_ifunc.  Support mst_slot_got_plt.
+	* solib-svr4.c (svr4_in_dynsym_resolve_code): Return true also for
+	in_gnu_ifunc_stub.
+	* symmisc.c (dump_msymbols): Support mst_text_gnu_ifunc.
+	* symtab.c (search_symbols): Likewise.
+	* symtab.h (enum minimal_symbol_type): New fields mst_text_gnu_ifunc
+	and mst_slot_got_plt.
+	(in_gnu_ifunc_stub): New declaration.
+
+2011-03-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+	Support a ring of related breakpoints.
+	* breakpoint.c (watchpoint_del_at_next_stop): New, move here code from
+	other functions, add gdb_assert.
+	(update_watchpoint, watchpoint_check): Add gdb_assert.  Use
+	watchpoint_del_at_next_stop.
+	(bpstat_check_watchpoint): Use watchpoint_del_at_next_stop.
+	(bpstat_stop_status): Handle ring in related_breakpoint.
+	(set_raw_breakpoint_without_location): Initialize ring in
+	related_breakpoint.
+	(delete_breakpoint): Handle ring in related_breakpoint, use
+	watchpoint_del_at_next_stop.
+	(map_breakpoint_numbers): Handle ring in related_breakpoint.
+
+2011-03-28  Tom Tromey  <tromey@redhat.com>
+
+	PR symtab/12441:
+	* dwarf2read.c (prepare_one_comp_unit): Don't call set_cu_language
+	with `language_minimal'.
+
 2011-03-25  Ulrich Weigand  <ulrich.weigand@linaro.org>
 
 	* arm-tdep.c (arm_elf_make_msymbol_special): Use ARM_SYM_BRANCH_TYPE
diff --git a/gdb/blockframe.c b/gdb/blockframe.c
index 5bc5930..3b546a7 100644
--- a/gdb/blockframe.c
+++ b/gdb/blockframe.c
@@ -163,6 +163,7 @@ static CORE_ADDR cache_pc_function_low = 0;
 static CORE_ADDR cache_pc_function_high = 0;
 static char *cache_pc_function_name = 0;
 static struct obj_section *cache_pc_function_section = NULL;
+static int cache_pc_function_is_gnu_ifunc = 0;
 
 /* Clear cache, e.g. when symbol table is discarded.  */
 
@@ -173,6 +174,7 @@ clear_pc_function_cache (void)
   cache_pc_function_high = 0;
   cache_pc_function_name = (char *) 0;
   cache_pc_function_section = NULL;
+  cache_pc_function_is_gnu_ifunc = 0;
 }
 
 /* Finds the "function" (text symbol) that is smaller than PC but
@@ -180,17 +182,19 @@ clear_pc_function_cache (void)
    *NAME and/or *ADDRESS conditionally if that pointer is non-null.
    If ENDADDR is non-null, then set *ENDADDR to be the end of the
    function (exclusive), but passing ENDADDR as non-null means that
-   the function might cause symbols to be read.  This function either
-   succeeds or fails (not halfway succeeds).  If it succeeds, it sets
-   *NAME, *ADDRESS, and *ENDADDR to real information and returns 1.
-   If it fails, it sets *NAME, *ADDRESS, and *ENDADDR to zero and
-   returns 0.  */
+   the function might cause symbols to be read.  If IS_GNU_IFUNC_P is provided
+   *IS_GNU_IFUNC_P is set to 1 on return if the function is STT_GNU_IFUNC.
+   This function either succeeds or fails (not halfway succeeds).  If it
+   succeeds, it sets *NAME, *ADDRESS, and *ENDADDR to real information and
+   returns 1.  If it fails, it sets *NAME, *ADDRESS, *ENDADDR and
+   *IS_GNU_IFUNC_P to zero and returns 0.  */
 
 /* Backward compatibility, no section argument.  */
 
 int
-find_pc_partial_function (CORE_ADDR pc, char **name, CORE_ADDR *address,
-			  CORE_ADDR *endaddr)
+find_pc_partial_function_gnu_ifunc (CORE_ADDR pc, char **name,
+				    CORE_ADDR *address, CORE_ADDR *endaddr,
+				    int *is_gnu_ifunc_p)
 {
   struct obj_section *section;
   struct symbol *f;
@@ -240,6 +244,7 @@ find_pc_partial_function (CORE_ADDR pc, char **name, CORE_ADDR *address,
 	  cache_pc_function_high = BLOCK_END (SYMBOL_BLOCK_VALUE (f));
 	  cache_pc_function_name = SYMBOL_LINKAGE_NAME (f);
 	  cache_pc_function_section = section;
+	  cache_pc_function_is_gnu_ifunc = TYPE_GNU_IFUNC (SYMBOL_TYPE (f));
 	  goto return_cached_value;
 	}
     }
@@ -262,12 +267,15 @@ find_pc_partial_function (CORE_ADDR pc, char **name, CORE_ADDR *address,
 	*address = 0;
       if (endaddr != NULL)
 	*endaddr = 0;
+      if (is_gnu_ifunc_p != NULL)
+	*is_gnu_ifunc_p = 0;
       return 0;
     }
 
   cache_pc_function_low = SYMBOL_VALUE_ADDRESS (msymbol);
   cache_pc_function_name = SYMBOL_LINKAGE_NAME (msymbol);
   cache_pc_function_section = section;
+  cache_pc_function_is_gnu_ifunc = MSYMBOL_TYPE (msymbol) == mst_text_gnu_ifunc;
 
   /* If the minimal symbol has a size, use it for the cache.
      Otherwise use the lesser of the next minimal symbol in the same
@@ -330,9 +338,22 @@ find_pc_partial_function (CORE_ADDR pc, char **name, CORE_ADDR *address,
 	*endaddr = cache_pc_function_high;
     }
 
+  if (is_gnu_ifunc_p)
+    *is_gnu_ifunc_p = cache_pc_function_is_gnu_ifunc;
+
   return 1;
 }
 
+/* See find_pc_partial_function_gnu_ifunc, only the IS_GNU_IFUNC_P parameter
+   is omitted here for backward API compatibility.  */
+
+int
+find_pc_partial_function (CORE_ADDR pc, char **name, CORE_ADDR *address,
+			  CORE_ADDR *endaddr)
+{
+  return find_pc_partial_function_gnu_ifunc (pc, name, address, endaddr, NULL);
+}
+
 /* Return the innermost stack frame executing inside of BLOCK, or NULL
    if there is no such frame.  If BLOCK is NULL, just return NULL.  */
 
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index bfd46bf..583c870 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -1161,6 +1161,25 @@ watchpoint_in_thread_scope (struct breakpoint *b)
 	      && !is_executing (inferior_ptid)));
 }
 
+/* Set watchpoint B to disp_del_at_next_stop, even including its possible
+   associated bp_watchpoint_scope breakpoint.  */
+
+static void
+watchpoint_del_at_next_stop (struct breakpoint *b)
+{
+  gdb_assert (is_watchpoint (b));
+
+  if (b->related_breakpoint != b)
+    {
+      gdb_assert (b->related_breakpoint->type == bp_watchpoint_scope);
+      gdb_assert (b->related_breakpoint->related_breakpoint == b);
+      b->related_breakpoint->disposition = disp_del_at_next_stop;
+      b->related_breakpoint->related_breakpoint = b->related_breakpoint;
+      b->related_breakpoint = b;
+    }
+  b->disposition = disp_del_at_next_stop;
+}
+
 /* Assuming that B is a watchpoint:
    - Reparse watchpoint expression, if REPARSE is non-zero
    - Evaluate expression and store the result in B->val
@@ -1220,6 +1239,8 @@ update_watchpoint (struct breakpoint *b, int reparse)
   struct frame_id saved_frame_id;
   int frame_saved;
 
+  gdb_assert (is_watchpoint (b));
+
   /* If this is a local watchpoint, we only want to check if the
      watchpoint frame is in scope if the current thread is the thread
      that was used to create the watchpoint.  */
@@ -1455,13 +1476,7 @@ update_watchpoint (struct breakpoint *b, int reparse)
 Watchpoint %d deleted because the program has left the block\n\
 in which its expression is valid.\n"),
 		       b->number);
-      if (b->related_breakpoint)
-	{
-	  b->related_breakpoint->disposition = disp_del_at_next_stop;
-	  b->related_breakpoint->related_breakpoint = NULL;
-	  b->related_breakpoint= NULL;
-	}
-      b->disposition = disp_del_at_next_stop;
+      watchpoint_del_at_next_stop (b);
     }
 
   /* Restore the selected frame.  */
@@ -3586,6 +3601,8 @@ print_it_typical (bpstat bs)
     case bp_tracepoint:
     case bp_fast_tracepoint:
     case bp_jit_event:
+    case bp_gnu_ifunc_resolver:
+    case bp_gnu_ifunc_resolver_return:
     default:
       result = PRINT_UNKNOWN;
       break;
@@ -3811,6 +3828,8 @@ watchpoint_check (void *p)
   gdb_assert (bs->breakpoint_at != NULL);
   b = bs->breakpoint_at;
 
+  gdb_assert (is_watchpoint (b));
+
   /* If this is a local watchpoint, we only want to check if the
      watchpoint frame is in scope if the current thread is the thread
      that was used to create the watchpoint.  */
@@ -3920,13 +3939,7 @@ watchpoint_check (void *p)
 		   " deleted because the program has left the block in\n\
 which its expression is valid.\n");     
 
-      if (b->related_breakpoint)
-	{
-	  b->related_breakpoint->disposition = disp_del_at_next_stop;
-	  b->related_breakpoint->related_breakpoint = NULL;
-	  b->related_breakpoint = NULL;
-	}
-      b->disposition = disp_del_at_next_stop;
+      watchpoint_del_at_next_stop (b);
 
       return WP_DELETED;
     }
@@ -4131,9 +4144,7 @@ bpstat_check_watchpoint (bpstat bs)
 	    case 0:
 	      /* Error from catch_errors.  */
 	      printf_filtered (_("Watchpoint %d deleted.\n"), b->number);
-	      if (b->related_breakpoint)
-		b->related_breakpoint->disposition = disp_del_at_next_stop;
-	      b->disposition = disp_del_at_next_stop;
+	      watchpoint_del_at_next_stop (b);
 	      /* We've already printed what needs to be printed.  */
 	      bs->print_it = print_it_done;
 	      break;
@@ -4344,7 +4355,7 @@ bpstat_stop_status (struct address_space *aspace,
 	     watchpoint as triggered so that we will handle the
 	     out-of-scope event.  We'll get to the watchpoint next
 	     iteration.  */
-	  if (b->type == bp_watchpoint_scope)
+	  if (b->type == bp_watchpoint_scope && b->related_breakpoint != b)
 	    b->related_breakpoint->watchpoint_triggered = watch_triggered_yes;
 	}
     }
@@ -4466,7 +4477,7 @@ handle_jit_event (void)
 /* Decide what infrun needs to do with this bpstat.  */
 
 struct bpstat_what
-bpstat_what (bpstat bs)
+bpstat_what (bpstat bs_head)
 {
   struct bpstat_what retval;
   /* We need to defer calling `solib_add', as adding new symbols
@@ -4474,12 +4485,13 @@ bpstat_what (bpstat bs)
      and hence may clear unprocessed entries in the BS chain.  */
   int shlib_event = 0;
   int jit_event = 0;
+  bpstat bs;
 
   retval.main_action = BPSTAT_WHAT_KEEP_CHECKING;
   retval.call_dummy = STOP_NONE;
   retval.is_longjmp = 0;
 
-  for (; bs != NULL; bs = bs->next)
+  for (bs = bs_head; bs != NULL; bs = bs->next)
     {
       /* Extract this BS's action.  After processing each BS, we check
 	 if its action overrides all we've seem so far.  */
@@ -4609,6 +4621,16 @@ bpstat_what (bpstat bs)
 	     out already.  */
 	  internal_error (__FILE__, __LINE__,
 			  _("bpstat_what: tracepoint encountered"));
+	  break;
+	case bp_gnu_ifunc_resolver:
+	  /* Step over it (and insert bp_gnu_ifunc_resolver_return).  */
+	  this_action = BPSTAT_WHAT_SINGLE;
+	  break;
+	case bp_gnu_ifunc_resolver_return:
+	  /* The breakpoint will be removed, execution will restart from the
+	     PC of the former breakpoint.  */
+	  this_action = BPSTAT_WHAT_KEEP_CHECKING;
+	  break;
 	default:
 	  internal_error (__FILE__, __LINE__,
 			  _("bpstat_what: unhandled bptype %d"), (int) bptype);
@@ -4617,6 +4639,9 @@ bpstat_what (bpstat bs)
       retval.main_action = max (retval.main_action, this_action);
     }
 
+  /* These operations may affect the bs->breakpoint_at state so they are
+     delayed after MAIN_ACTION is decided above.  */
+
   if (shlib_event)
     {
       if (debug_infrun)
@@ -4646,6 +4671,23 @@ bpstat_what (bpstat bs)
       handle_jit_event ();
     }
 
+  for (bs = bs_head; bs != NULL; bs = bs->next)
+    {
+      struct breakpoint *b = bs->breakpoint_at;
+
+      if (b == NULL)
+	continue;
+      switch (b->type)
+	{
+	case bp_gnu_ifunc_resolver:
+	  gnu_ifunc_resolver_stop (b);
+	  break;
+	case bp_gnu_ifunc_resolver_return:
+	  gnu_ifunc_resolver_return_stop (b);
+	  break;
+	}
+    }
+
   return retval;
 }
 
@@ -4803,6 +4845,8 @@ bptype_string (enum bptype type)
     {bp_fast_tracepoint, "fast tracepoint"},
     {bp_static_tracepoint, "static tracepoint"},
     {bp_jit_event, "jit events"},
+    {bp_gnu_ifunc_resolver, "STT_GNU_IFUNC resolver"},
+    {bp_gnu_ifunc_resolver_return, "STT_GNU_IFUNC resolver return"},
   };
 
   if (((int) type >= (sizeof (bptypes) / sizeof (bptypes[0])))
@@ -4937,6 +4981,8 @@ print_one_breakpoint_location (struct breakpoint *b,
       case bp_fast_tracepoint:
       case bp_static_tracepoint:
       case bp_jit_event:
+      case bp_gnu_ifunc_resolver:
+      case bp_gnu_ifunc_resolver_return:
 	if (opts.addressprint)
 	  {
 	    annotate_field (4);
@@ -5212,7 +5258,8 @@ user_settable_breakpoint (const struct breakpoint *b)
 	  || b->type == bp_catchpoint
 	  || b->type == bp_hardware_breakpoint
 	  || is_tracepoint (b)
-	  || is_watchpoint (b));
+	  || is_watchpoint (b)
+	  || b->type == bp_gnu_ifunc_resolver);
 }
 
 /* Return true if this breakpoint was set by the user, false if it is
@@ -5708,6 +5755,8 @@ allocate_bp_location (struct breakpoint *bpt)
     case bp_longjmp_master:
     case bp_std_terminate_master:
     case bp_exception_master:
+    case bp_gnu_ifunc_resolver:
+    case bp_gnu_ifunc_resolver_return:
       loc->loc_type = bp_loc_software_breakpoint;
       break;
     case bp_hardware_breakpoint:
@@ -5797,6 +5846,7 @@ set_raw_breakpoint_without_location (struct gdbarch *gdbarch,
   b->ops = NULL;
   b->condition_not_parsed = 0;
   b->py_bp_object = NULL;
+  b->related_breakpoint = b;
 
   /* Add this breakpoint to the end of the chain so that a list of
      breakpoints will come out in order of increasing numbers.  */
@@ -5813,9 +5863,12 @@ set_raw_breakpoint_without_location (struct gdbarch *gdbarch,
   return b;
 }
 
-/* Initialize loc->function_name.  */
+/* Initialize loc->function_name.  EXPLICIT_LOC says no indirect function
+   resolutions should be made as the user specified the location explicitly
+   enough.  */
+
 static void
-set_breakpoint_location_function (struct bp_location *loc)
+set_breakpoint_location_function (struct bp_location *loc, int explicit_loc)
 {
   gdb_assert (loc->owner != NULL);
 
@@ -5823,8 +5876,33 @@ set_breakpoint_location_function (struct bp_location *loc)
       || loc->owner->type == bp_hardware_breakpoint
       || is_tracepoint (loc->owner))
     {
-      find_pc_partial_function (loc->address, &(loc->function_name), 
-				NULL, NULL);
+      int is_gnu_ifunc;
+
+      find_pc_partial_function_gnu_ifunc (loc->address, &loc->function_name,
+					  NULL, NULL, &is_gnu_ifunc);
+
+      if (is_gnu_ifunc && !explicit_loc)
+	{
+	  struct breakpoint *b = loc->owner;
+
+	  gdb_assert (loc->pspace == current_program_space);
+	  if (gnu_ifunc_resolve_name (loc->function_name,
+				      &loc->requested_address))
+	    {
+	      /* Recalculate ADDRESS based on new REQUESTED_ADDRESS.  */
+	      loc->address = adjust_breakpoint_address (loc->gdbarch,


hooks/post-receive
--
Repository for Project Archer.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-03-28 23:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-28 23:12 [SCM] archer-sergiodj-stap: Merge remote branch 'origin/master' into archer-sergio-stap sergiodj

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).