From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29109 invoked by alias); 14 Jun 2012 10:27:08 -0000 Mailing-List: contact archer-commits-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: Received: (qmail 29068 invoked by uid 9514); 14 Jun 2012 10:27:07 -0000 Date: Thu, 14 Jun 2012 10:27:00 -0000 Message-ID: <20120614102707.29053.qmail@sourceware.org> From: pmuldoon@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] archer-pmuldoon-python-backtrace: Merge remote-tracking branch 'gdb/master' into archer-pmuldoon-python-backtrace X-Git-Refname: refs/heads/archer-pmuldoon-python-backtrace X-Git-Reftype: branch X-Git-Oldrev: ad9b70c700bac4bad3a314a5ed133d4f7f13fa41 X-Git-Newrev: 9cb749c41529373b3e12253f066a722b02aaf992 X-SW-Source: 2012-q2/txt/msg00059.txt.bz2 List-Id: The branch, archer-pmuldoon-python-backtrace has been updated via 9cb749c41529373b3e12253f066a722b02aaf992 (commit) via 79fe88ccefb50bcafdedcdbee27b73344c3a5f85 (commit) via c59d5e6f97af1d0b2bece85f9dad5c286f906a3b (commit) via 0f1126fffe378944ccd7b9a97833ff691c58cd47 (commit) via 15b692d89066c419cc5d802344d6bb31a4307d50 (commit) via 8ff506ab4d82a2e2747e95a3cda750641eee99dc (commit) via 2d41e8ff1d4f6d874bf8ade60708aa96e399b91d (commit) via 74193b83affd3b596b35e59a819aaadb18420b04 (commit) via ee91c8e0c33a3ebf00fd6b6c5f57317dd5e9d149 (commit) via f3951dfe9e62f8c299961125c9e9cd3ffd0b9bf5 (commit) via 6b7c08a27abe873cdd61accfecc3040a9c163b13 (commit) via 724254963b7ecf06fb4ebdc24f66859fc814c0c5 (commit) via 0581e13edef0280433d5c6d5175c6a7b740bdc4d (commit) via 136395f954eb858db4d208bb9807f4fdb4eac8f8 (commit) from ad9b70c700bac4bad3a314a5ed133d4f7f13fa41 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 9cb749c41529373b3e12253f066a722b02aaf992 Merge: ad9b70c 79fe88c Author: Phil Muldoon Date: Thu Jun 14 11:26:43 2012 +0100 Merge remote-tracking branch 'gdb/master' into archer-pmuldoon-python-backtrace commit 79fe88ccefb50bcafdedcdbee27b73344c3a5f85 Author: Alan Modra Date: Thu Jun 14 00:00:05 2012 +0000 daily update commit c59d5e6f97af1d0b2bece85f9dad5c286f906a3b Author: gdbadmin Date: Thu Jun 14 00:00:03 2012 +0000 *** empty log message *** commit 0f1126fffe378944ccd7b9a97833ff691c58cd47 Author: Jan Kratochvil Date: Wed Jun 13 21:31:05 2012 +0000 gdb/testsuite/ PR tdep/14222 * gdb.arch/i386-sse-stack-align.S: New file. * gdb.arch/i386-sse-stack-align.c: New file. * gdb.arch/i386-sse-stack-align.exp: New file. commit 15b692d89066c419cc5d802344d6bb31a4307d50 Author: Mark Kettenis Date: Wed Jun 13 21:21:24 2012 +0000 PR tdep/14222 * i386-tdep.c (i386_push_dummy_call): Unconditionally align the stack on a 16-byte boundary. commit 8ff506ab4d82a2e2747e95a3cda750641eee99dc Author: Tom Tromey Date: Wed Jun 13 21:16:48 2012 +0000 2012-06-13 Kaushik Srenevasan * jit.c (finalize_symtab): Set function's return type to 'void' by default. commit 2d41e8ff1d4f6d874bf8ade60708aa96e399b91d Author: Mark Kettenis Date: Wed Jun 13 20:36:47 2012 +0000 * amd64-linux-tdep.c (amd64_linux_init_abi_common): New function. Move bits common to both the classic LP64 and the new x32 ILP32 ABI here. (amd64_linux_init_abi): Call amd64_linux_init_abi_common. (amd64_x32_linux_init_abi): New function. (_initialize_amd64_linux_tdep): Register osabi for bfd_mach_x64_32 subtype. commit 74193b83affd3b596b35e59a819aaadb18420b04 Author: Mark Kettenis Date: Wed Jun 13 20:29:15 2012 +0000 H.J. Lu * i386-tdep.h (i386_pseudo_register_name): New prototype. * i386-tdep.c (i386_pseudo_register_name): Make public. * amd64-tdep.h (amd64_x32_init_abi): New prototype. * amd64-tdep.c (amd64_dword_names): Add "eip". (amd64_x32_pseudo_register_type): New function (amd64_x32_init_abi): New function. commit ee91c8e0c33a3ebf00fd6b6c5f57317dd5e9d149 Author: Jan Kratochvil Date: Wed Jun 13 18:15:04 2012 +0000 gdb/ PR build/14003 * inferior.h (struct inferior_suspend_state): Comment out. (struct inferior): Comment out the field suspend. * infrun.c (struct infcall_suspend_state): Comment out the field inferior_suspend. (save_infcall_suspend_state, restore_infcall_suspend_state): Comment out its assignment. commit f3951dfe9e62f8c299961125c9e9cd3ffd0b9bf5 Author: Keith Seitz Date: Wed Jun 13 18:06:06 2012 +0000 PR breakpoints/13798 and mi/11541 * gdb.linespec/ls-errs.exp: Add a few more tests for filenames with spaces and colons. commit 6b7c08a27abe873cdd61accfecc3040a9c163b13 Author: Jan Kratochvil Date: Wed Jun 13 16:10:05 2012 +0000 gdb/ PR c++/14177 - Fix parsing TYPENAME:: in parentheses. * c-exp.y (classify_inner_name): Remove caller assumptions in the function comment. Return ERROR for unresolved cases. Implement returning proper NAME. (yylex): Accept also NAME from classify_inner_name. * cp-namespace.c (cp_lookup_nested_type): Rename to ... (cp_lookup_nested_symbol): ... here. Return any found symbol, not just LOC_TYPEDEF type. * cp-support.h (cp_lookup_nested_type): Update its declaration. gdb/testsuite/ PR c++/14177 - Fix parsing TYPENAME:: in parentheses. * gdb.cp/cpexprs.cc (class CV, CV::i, ATTRIBUTE_USED, CV_f): New. (test_function): Call CV_f. * gdb.cp/cpexprs.exp (p 'CV::m(int)', p CV::m(int)) (p 'CV::m(int) const', p CV::m(int) const, p 'CV::m(int) volatile') (p CV::m(int) volatile, p 'CV::m(int) const volatile') (p CV::m(int) const volatile, p CV_f(int), p CV_f(CV::t)) (p CV_f(CV::i)): New tests. commit 724254963b7ecf06fb4ebdc24f66859fc814c0c5 Author: Tom Tromey Date: Wed Jun 13 15:50:18 2012 +0000 * breakpoint.c (condition_completer): New function. (_initialize_breakpoint): Use it. * value.c (complete_internalvar): New function. * value.h (complete_internalvar): Declare. testsuite * gdb.base/condbreak.exp: Add tests for "condition" completion. commit 0581e13edef0280433d5c6d5175c6a7b740bdc4d Author: Tom Tromey Date: Wed Jun 13 15:47:13 2012 +0000 * ada-lang.c (ada_make_symbol_completion_list): Return a VEC. * breakpoint.c (catch_syscall_completer): Return a VEC. * cli/cli-cmds.c (complete_command): Update. * cli/cli-decode.c (complete_on_cmdlist): Return a VEC. (complete_on_enum): Likewise. * command.h: Include gdb_vecs.h. (completer_ftype): Change return type. (complete_on_cmdlist, complete_on_enum): Likewise. * completer.c (noop_completer, filename_completer) (location_completer): Return a VEC. (add_struct_fields): Remove 'nextp' argument. Change 'output' to a VEC. (expression_completer, complete_line_internal, complete_line) (command_completer): Return a VEC. (gdb_completion_word_break_characters, line_completion_function): Update. * completer.h: Include gdb_vecs.h. (complete_line, noop_completer, filename_completer) (expression_completer, location_completer, command_completer): Update. * f-lang.c (f_word_break_characters): Return a VEC. * interps.c (interpreter_completer): Return a VEC. * language.h (struct language_defn) : Return a VEC. * python/py-cmd.c (cmdpy_completer): Return a VEC. * symtab.c (free_completion_list): Take a VEC. (return_val_size, return_val_index): Remove. (return_val): Now a VEC. (completion_list_add_name): Update. (default_make_symbol_completion_list_break_on) (default_make_symbol_completion_list, make_symbol_completion_list) (make_symbol_completion_list_fn, make_file_symbol_completion_list): Return a VEC. (add_filename_to_list): Update. (struct add_partial_filename_data) : Remove. : Now a VEC. (maybe_add_partial_symtab_filename): Update. (make_source_files_completion_list): Return a VEC. * symtab.h (default_make_symbol_completion_list_break_on) (default_make_symbol_completion_list, make_symbol_completion_list) (make_symbol_completion_list_fn, make_file_symbol_completion_list) (make_source_files_completion_list): Update. commit 136395f954eb858db4d208bb9807f4fdb4eac8f8 Author: Tom Tromey Date: Wed Jun 13 15:41:20 2012 +0000 * breakpoint.c (add_catch_command): Use completer_ftype. * breakpoint.h: Include command.h. (add_catch_command): Use completer_ftype. * cli/cli-decode.c (set_cmd_completer): Use completer_ftype. * cli/cli-decode.h (struct cmd_list_element) : Use completer_ftype. * command.h (completer_ftype): New typedef. (set_cmd_completer): Use it. * python/py-cmd.c (struct cmdpy_completer) : Use completer_ftype. ----------------------------------------------------------------------- Summary of changes: bfd/version.h | 2 +- gdb/ChangeLog | 117 ++++++++++++ gdb/ada-lang.c | 26 +--- gdb/amd64-linux-tdep.c | 119 +++++++++---- gdb/amd64-tdep.c | 40 ++++- gdb/amd64-tdep.h | 2 + gdb/breakpoint.c | 66 +++++++- gdb/breakpoint.h | 4 +- gdb/c-exp.y | 33 +++-- gdb/cli/cli-cmds.c | 32 ++-- gdb/cli/cli-decode.c | 98 +++-------- gdb/cli/cli-decode.h | 3 +- gdb/command.h | 17 +- gdb/completer.c | 137 ++++++--------- gdb/completer.h | 28 ++-- gdb/cp-namespace.c | 23 ++-- gdb/cp-support.h | 6 +- gdb/f-lang.c | 2 +- gdb/i386-tdep.c | 16 +- gdb/i386-tdep.h | 2 + gdb/inferior.h | 4 + gdb/infrun.c | 6 + gdb/interps.c | 39 ++--- gdb/jit.c | 5 + gdb/language.h | 8 +- gdb/python/py-cmd.c | 15 +- gdb/symtab.c | 107 ++++-------- gdb/symtab.h | 16 +- gdb/testsuite/ChangeLog | 28 +++ gdb/testsuite/gdb.arch/i386-sse-stack-align.S | 214 +++++++++++++++++++++++ gdb/testsuite/gdb.arch/i386-sse-stack-align.c | 70 ++++++++ gdb/testsuite/gdb.arch/i386-sse-stack-align.exp | 60 +++++++ gdb/testsuite/gdb.base/condbreak.exp | 5 + gdb/testsuite/gdb.cp/cpexprs.cc | 25 +++ gdb/testsuite/gdb.cp/cpexprs.exp | 21 +++ gdb/testsuite/gdb.linespec/ls-errs.exp | 4 +- gdb/value.c | 23 +++ gdb/value.h | 2 + gdb/version.in | 2 +- 39 files changed, 1007 insertions(+), 420 deletions(-) create mode 100644 gdb/testsuite/gdb.arch/i386-sse-stack-align.S create mode 100644 gdb/testsuite/gdb.arch/i386-sse-stack-align.c create mode 100644 gdb/testsuite/gdb.arch/i386-sse-stack-align.exp First 500 lines of diff: diff --git a/bfd/version.h b/bfd/version.h index e348750..e116fbc 100644 --- a/bfd/version.h +++ b/bfd/version.h @@ -1,4 +1,4 @@ -#define BFD_VERSION_DATE 20120613 +#define BFD_VERSION_DATE 20120614 #define BFD_VERSION @bfd_version@ #define BFD_VERSION_STRING @bfd_version_package@ @bfd_version_string@ #define REPORT_BUGS_TO @report_bugs_to@ diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 4befbd4..cdf6a01 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,120 @@ +2012-06-13 Mark Kettenis + Jan Kratochvil + + PR tdep/14222 + * i386-tdep.c (i386_push_dummy_call): Unconditionally align the + stack on a 16-byte boundary. + +2012-06-13 Kaushik Srenevasan + + * jit.c (finalize_symtab): Set function's return type to 'void' by + default. + +2012-06-13 Mark Kettenis + H.J. Lu + + * amd64-linux-tdep.c (amd64_linux_init_abi_common): New function. + Move bits common to both the classic LP64 and the new x32 ILP32 + ABI here. + (amd64_linux_init_abi): Call amd64_linux_init_abi_common. + (amd64_x32_linux_init_abi): New function. + (_initialize_amd64_linux_tdep): Register osabi for bfd_mach_x64_32 + subtype. + + * i386-tdep.h (i386_pseudo_register_name): New prototype. + * i386-tdep.c (i386_pseudo_register_name): Make public. + * amd64-tdep.h (amd64_x32_init_abi): New prototype. + * amd64-tdep.c (amd64_dword_names): Add "eip". + (amd64_x32_pseudo_register_type): New function + (amd64_x32_init_abi): New function. + +2012-06-13 Jan Kratochvil + + PR build/14003 + * inferior.h (struct inferior_suspend_state): Comment out. + (struct inferior): Comment out the field suspend. + * infrun.c (struct infcall_suspend_state): Comment out the field + inferior_suspend. + (save_infcall_suspend_state, restore_infcall_suspend_state): Comment + out its assignment. + +2012-06-13 Jan Kratochvil + + PR c++/14177 - Fix parsing TYPENAME:: in parentheses. + * c-exp.y (classify_inner_name): Remove caller assumptions in the + function comment. Return ERROR for unresolved cases. Implement + returning proper NAME. + (yylex): Accept also NAME from classify_inner_name. + * cp-namespace.c (cp_lookup_nested_type): Rename to ... + (cp_lookup_nested_symbol): ... here. Return any found symbol, not just + LOC_TYPEDEF type. + * cp-support.h (cp_lookup_nested_type): Update its declaration. + +2012-06-13 Tom Tromey + + * breakpoint.c (condition_completer): New function. + (_initialize_breakpoint): Use it. + * value.c (complete_internalvar): New function. + * value.h (complete_internalvar): Declare. + +2012-06-13 Tom Tromey + + * ada-lang.c (ada_make_symbol_completion_list): Return a VEC. + * breakpoint.c (catch_syscall_completer): Return a VEC. + * cli/cli-cmds.c (complete_command): Update. + * cli/cli-decode.c (complete_on_cmdlist): Return a VEC. + (complete_on_enum): Likewise. + * command.h: Include gdb_vecs.h. + (completer_ftype): Change return type. + (complete_on_cmdlist, complete_on_enum): Likewise. + * completer.c (noop_completer, filename_completer) + (location_completer): Return a VEC. + (add_struct_fields): Remove 'nextp' argument. Change 'output' + to a VEC. + (expression_completer, complete_line_internal, complete_line) + (command_completer): Return a VEC. + (gdb_completion_word_break_characters, line_completion_function): + Update. + * completer.h: Include gdb_vecs.h. + (complete_line, noop_completer, filename_completer) + (expression_completer, location_completer, command_completer): + Update. + * f-lang.c (f_word_break_characters): Return a VEC. + * interps.c (interpreter_completer): Return a VEC. + * language.h (struct language_defn) + : Return a VEC. + * python/py-cmd.c (cmdpy_completer): Return a VEC. + * symtab.c (free_completion_list): Take a VEC. + (return_val_size, return_val_index): Remove. + (return_val): Now a VEC. + (completion_list_add_name): Update. + (default_make_symbol_completion_list_break_on) + (default_make_symbol_completion_list, make_symbol_completion_list) + (make_symbol_completion_list_fn, make_file_symbol_completion_list): + Return a VEC. + (add_filename_to_list): Update. + (struct add_partial_filename_data) : Remove. + : Now a VEC. + (maybe_add_partial_symtab_filename): Update. + (make_source_files_completion_list): Return a VEC. + * symtab.h (default_make_symbol_completion_list_break_on) + (default_make_symbol_completion_list, make_symbol_completion_list) + (make_symbol_completion_list_fn, make_file_symbol_completion_list) + (make_source_files_completion_list): Update. + +2012-06-13 Tom Tromey + + * breakpoint.c (add_catch_command): Use completer_ftype. + * breakpoint.h: Include command.h. + (add_catch_command): Use completer_ftype. + * cli/cli-decode.c (set_cmd_completer): Use completer_ftype. + * cli/cli-decode.h (struct cmd_list_element) : + Use completer_ftype. + * command.h (completer_ftype): New typedef. + (set_cmd_completer): Use it. + * python/py-cmd.c (struct cmdpy_completer) : Use + completer_ftype. + 2012-06-13 Pedro Alves Partial revert of previous change. diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index af0fdb5..6f65472 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -5797,11 +5797,10 @@ ada_expand_partial_symbol_name (const char *name, void *user_data) data->wild_match, data->encoded) != NULL; } -/* Return a list of possible symbol names completing TEXT0. The list - is NULL terminated. WORD is the entire command on which completion - is made. */ +/* Return a list of possible symbol names completing TEXT0. WORD is + the entire command on which completion is made. */ -static char ** +static VEC (char_ptr) * ada_make_symbol_completion_list (char *text0, char *word) { char *text; @@ -5914,24 +5913,7 @@ ada_make_symbol_completion_list (char *text0, char *word) } } - /* Append the closing NULL entry. */ - VEC_safe_push (char_ptr, completions, NULL); - - /* Make a copy of the COMPLETIONS VEC before we free it, and then - return the copy. It's unfortunate that we have to make a copy - of an array that we're about to destroy, but there is nothing much - we can do about it. Fortunately, it's typically not a very large - array. */ - { - const size_t completions_size = - VEC_length (char_ptr, completions) * sizeof (char *); - char **result = xmalloc (completions_size); - - memcpy (result, VEC_address (char_ptr, completions), completions_size); - - VEC_free (char_ptr, completions); - return result; - } + return completions; } /* Field Access */ diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c index 42dc89a..0adc22b 100644 --- a/gdb/amd64-linux-tdep.c +++ b/gdb/amd64-linux-tdep.c @@ -1288,41 +1288,12 @@ amd64_linux_core_read_description (struct gdbarch *gdbarch, } static void -amd64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) +amd64_linux_init_abi_common(struct gdbarch_info info, struct gdbarch *gdbarch) { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - const struct target_desc *tdesc = info.target_desc; - struct tdesc_arch_data *tdesc_data = (void *) info.tdep_info; - const struct tdesc_feature *feature; - int valid_p; - - gdb_assert (tdesc_data); linux_init_abi (info, gdbarch); - tdep->gregset_reg_offset = amd64_linux_gregset_reg_offset; - tdep->gregset_num_regs = ARRAY_SIZE (amd64_linux_gregset_reg_offset); - tdep->sizeof_gregset = 27 * 8; - - amd64_init_abi (info, gdbarch); - - /* Reserve a number for orig_rax. */ - set_gdbarch_num_regs (gdbarch, AMD64_LINUX_NUM_REGS); - - if (! tdesc_has_registers (tdesc)) - tdesc = tdesc_amd64_linux; - tdep->tdesc = tdesc; - - feature = tdesc_find_feature (tdesc, "org.gnu.gdb.i386.linux"); - if (feature == NULL) - return; - - valid_p = tdesc_numbered_register (feature, tdesc_data, - AMD64_LINUX_ORIG_RAX_REGNUM, - "orig_rax"); - if (!valid_p) - return; - tdep->sigtramp_p = amd64_linux_sigtramp_p; tdep->sigcontext_addr = amd64_linux_sigcontext_addr; tdep->sc_reg_offset = amd64_linux_sc_reg_offset; @@ -1330,10 +1301,6 @@ amd64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) tdep->xsave_xcr0_offset = I386_LINUX_XSAVE_XCR0_OFFSET; - /* GNU/Linux uses SVR4-style shared libraries. */ - set_solib_svr4_fetch_link_map_offsets - (gdbarch, svr4_lp64_fetch_link_map_offsets); - /* Add the %orig_rax register used for syscall restarting. */ set_gdbarch_write_pc (gdbarch, amd64_linux_write_pc); @@ -1543,6 +1510,88 @@ amd64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) tdep->i386_syscall_record = amd64_linux_syscall_record; } + +static void +amd64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) +{ + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + const struct target_desc *tdesc = info.target_desc; + struct tdesc_arch_data *tdesc_data = (void *) info.tdep_info; + const struct tdesc_feature *feature; + int valid_p; + + gdb_assert (tdesc_data); + + tdep->gregset_reg_offset = amd64_linux_gregset_reg_offset; + tdep->gregset_num_regs = ARRAY_SIZE (amd64_linux_gregset_reg_offset); + tdep->sizeof_gregset = 27 * 8; + + amd64_init_abi (info, gdbarch); + + /* Reserve a number for orig_rax. */ + set_gdbarch_num_regs (gdbarch, AMD64_LINUX_NUM_REGS); + + if (! tdesc_has_registers (tdesc)) + tdesc = tdesc_amd64_linux; + tdep->tdesc = tdesc; + + feature = tdesc_find_feature (tdesc, "org.gnu.gdb.i386.linux"); + if (feature == NULL) + return; + + valid_p = tdesc_numbered_register (feature, tdesc_data, + AMD64_LINUX_ORIG_RAX_REGNUM, + "orig_rax"); + if (!valid_p) + return; + + amd64_linux_init_abi_common (info, gdbarch); + + /* GNU/Linux uses SVR4-style shared libraries. */ + set_solib_svr4_fetch_link_map_offsets + (gdbarch, svr4_lp64_fetch_link_map_offsets); +} + +static void +amd64_x32_linux_init_abi(struct gdbarch_info info, struct gdbarch *gdbarch) +{ + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + const struct target_desc *tdesc = info.target_desc; + struct tdesc_arch_data *tdesc_data = (void *) info.tdep_info; + const struct tdesc_feature *feature; + int valid_p; + + gdb_assert (tdesc_data); + + tdep->gregset_reg_offset = amd64_linux_gregset_reg_offset; + tdep->gregset_num_regs = ARRAY_SIZE (amd64_linux_gregset_reg_offset); + tdep->sizeof_gregset = 27 * 8; + + amd64_x32_init_abi (info, gdbarch); + + /* Reserve a number for orig_rax. */ + set_gdbarch_num_regs (gdbarch, AMD64_LINUX_NUM_REGS); + + if (! tdesc_has_registers (tdesc)) + tdesc = tdesc_x32_linux; + tdep->tdesc = tdesc; + + feature = tdesc_find_feature (tdesc, "org.gnu.gdb.i386.linux"); + if (feature == NULL) + return; + + valid_p = tdesc_numbered_register (feature, tdesc_data, + AMD64_LINUX_ORIG_RAX_REGNUM, + "orig_rax"); + if (!valid_p) + return; + + amd64_linux_init_abi_common (info, gdbarch); + + /* GNU/Linux uses SVR4-style shared libraries. */ + set_solib_svr4_fetch_link_map_offsets + (gdbarch, svr4_ilp32_fetch_link_map_offsets); +} /* Provide a prototype to silence -Wmissing-prototypes. */ @@ -1553,6 +1602,8 @@ _initialize_amd64_linux_tdep (void) { gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64, GDB_OSABI_LINUX, amd64_linux_init_abi); + gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x64_32, + GDB_OSABI_LINUX, amd64_x32_linux_init_abi); /* Initialize the Linux target description. */ initialize_tdesc_amd64_linux (); diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c index df91a51..2db5cf0 100644 --- a/gdb/amd64-tdep.c +++ b/gdb/amd64-tdep.c @@ -258,7 +258,8 @@ static const char *amd64_word_names[] = static const char *amd64_dword_names[] = { "eax", "ebx", "ecx", "edx", "esi", "edi", "ebp", "esp", - "r8d", "r9d", "r10d", "r11d", "r12d", "r13d", "r14d", "r15d" + "r8d", "r9d", "r10d", "r11d", "r12d", "r13d", "r14d", "r15d", + "eip" }; /* Return the name of register REGNUM. */ @@ -2729,6 +2730,43 @@ amd64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) set_gdbarch_stap_parse_special_token (gdbarch, i386_stap_parse_special_token); } + + +static struct type * +amd64_x32_pseudo_register_type (struct gdbarch *gdbarch, int regnum) +{ + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + + switch (regnum - tdep->eax_regnum) + { + case AMD64_RBP_REGNUM: /* %ebp */ + case AMD64_RSP_REGNUM: /* %esp */ + return builtin_type (gdbarch)->builtin_data_ptr; + case AMD64_RIP_REGNUM: /* %eip */ + return builtin_type (gdbarch)->builtin_func_ptr; + } + + return i386_pseudo_register_type (gdbarch, regnum); +} + +void +amd64_x32_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) +{ + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + const struct target_desc *tdesc = info.target_desc; + + amd64_init_abi (info, gdbarch); + + if (! tdesc_has_registers (tdesc)) + tdesc = tdesc_x32; + tdep->tdesc = tdesc; + + tdep->num_dword_regs = 17; + set_tdesc_pseudo_register_type (gdbarch, amd64_x32_pseudo_register_type); + + set_gdbarch_long_bit (gdbarch, 32); + set_gdbarch_ptr_bit (gdbarch, 32); +} /* Provide a prototype to silence -Wmissing-prototypes. */ void _initialize_amd64_tdep (void); diff --git a/gdb/amd64-tdep.h b/gdb/amd64-tdep.h index 1ed109c..cb901cc 100644 --- a/gdb/amd64-tdep.h +++ b/gdb/amd64-tdep.h @@ -80,6 +80,8 @@ extern void amd64_displaced_step_fixup (struct gdbarch *gdbarch, struct regcache *regs); extern void amd64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch); +extern void amd64_x32_init_abi (struct gdbarch_info info, + struct gdbarch *gdbarch); /* Fill register REGNUM in REGCACHE with the appropriate floating-point or SSE register value from *FXSAVE. If REGNUM is diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 9c4348f..82265cc 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -947,6 +947,62 @@ set_breakpoint_condition (struct breakpoint *b, char *exp, observer_notify_breakpoint_modified (b); } +/* Completion for the "condition" command. */ + +static VEC (char_ptr) * +condition_completer (struct cmd_list_element *cmd, char *text, char *word) +{ + char *space; + + text = skip_spaces (text); + space = skip_to_space (text); + if (*space == '\0') + { + int len; + struct breakpoint *b; + VEC (char_ptr) *result = NULL; + + if (text[0] == '$') + { + /* We don't support completion of history indices. */ + if (isdigit (text[1])) + return NULL; + return complete_internalvar (&text[1]); + } + + /* We're completing the breakpoint number. */ + len = strlen (text); + + ALL_BREAKPOINTS (b) + { + int single = b->loc->next == NULL; + struct bp_location *loc; + int count = 1; + + for (loc = b->loc; loc; loc = loc->next) + { + char location[50]; + + if (single) + sprintf (location, "%d", b->number); + else + sprintf (location, "%d.%d", b->number, count); + + if (strncmp (location, text, len) == 0) + VEC_safe_push (char_ptr, result, xstrdup (location)); + + ++count; + } + } + + return result; + } + + /* We're completing the expression part. */ + text = skip_spaces (space); + return expression_completer (cmd, text, word); +} + /* condition N EXP -- set break condition of breakpoint N to EXP. */ static void @@ -14578,12 +14634,12 @@ catching_syscall_number (int syscall_number) } /* Complete syscall names. Used by "catch syscall". */ -static char ** +static VEC (char_ptr) * catch_syscall_completer (struct cmd_list_element *cmd, char *text, char *word) { const char **list = get_syscall_names (); - char **retlist + VEC (char_ptr) *retlist = (list == NULL) ? NULL : complete_on_enum (list, text, word); xfree (list); @@ -15200,8 +15256,7 @@ void add_catch_command (char *name, char *docstring, void (*sfunc) (char *args, int from_tty, struct cmd_list_element *command), - char **(*completer) (struct cmd_list_element *cmd, - char *text, char *word), + completer_ftype *completer, void *user_data_catch, void *user_data_tcatch) { @@ -15529,10 +15584,11 @@ Type a line containing \"end\" to indicate the end of them.\n\ hooks/post-receive -- Repository for Project Archer.