From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2116 invoked by alias); 5 Apr 2012 20:55:59 -0000 Mailing-List: contact archer-commits-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: Received: (qmail 2061 invoked by uid 9674); 5 Apr 2012 20:55:58 -0000 Date: Thu, 05 Apr 2012 20:55:00 -0000 Message-ID: <20120405205557.2046.qmail@sourceware.org> From: jkratoch@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] archer-jankratochvil-autoload: Merge branch 'pathvec0-1-secmove-misc2-safepath-debug-warn' into pathvec0-1-secmove-misc2-safepath-debug-warn-warnlocal X-Git-Refname: refs/heads/archer-jankratochvil-autoload X-Git-Reftype: branch X-Git-Oldrev: 110ae17b1e9a3803811ad5c97955d4348565a1fe X-Git-Newrev: 2884fa97422df6e212a20600049aafa5d2c44fce X-SW-Source: 2012-q2/txt/msg00014.txt.bz2 List-Id: The branch, archer-jankratochvil-autoload has been updated via 2884fa97422df6e212a20600049aafa5d2c44fce (commit) via 56ccc939673934166c51511609c423469569f98b (commit) via 0781baeb2b9116361ee880c32c8df5fecc145991 (commit) via e77eb0e8c3c9345418c51d8b1f4ac7aabec0b5a2 (commit) via b1ff8e085bc019f7baf267ae6e31cb7957375a9d (commit) via a9bf39b303e4a777fcab2e14f3c8d8924ec5dd9e (commit) via e66584fa39bd0f2bc298d6ffb586ea212aa93765 (commit) via 1cf6927fa932c708e3e98cdf4e4aec9bbed6ffa7 (commit) via 56f7621909c1248705575c903c4901185c8aa349 (commit) via f535f02ff5da2fd2106314ada112c5252afb5f64 (commit) via b1ffbb32847f7ac37ae3ae63e67fc73d4dcb98fa (commit) via b6cd7d23c61d0ae128f062a9a3805d59b4e6de6c (commit) via 7858ec7d59cb5e54745a4dbf2a533d30ccba8e98 (commit) via 1a8d461500b062ba185b1bb548d24a0f666ae26b (commit) via bce6bb3911069cb5cf3c1af43e8301980e8f9877 (commit) via 1d2d7a0bbdb7cff65dc19285a0d52f04c6b7224f (commit) via 4ffac4d4c5fd86244b492b3fe08ff3b8fa5c93df (commit) via c5396af1a8133fc8ea0d067a2243803a8988eb20 (commit) via cd44fce9613686ec4041a89e1638a081b465b159 (commit) via 09253d1f17f2ccb48450bbe51f898ba7c2bfce73 (commit) via bf95c3f974bed4fdf06ed7a8ce70a4f88f7f95d7 (commit) via edb062cb924ca8031eac65e27af7acc38f93dfc5 (commit) via 6fca6e215aeaee41a56411f67695fa201e3f6232 (commit) via 202dc2a265837b7beb22fde70eb981e1a8148df6 (commit) via 501a9ff7887f91881f25cc1342a6ce3089fbc034 (commit) from 110ae17b1e9a3803811ad5c97955d4348565a1fe (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 2884fa97422df6e212a20600049aafa5d2c44fce Merge: a9bf39b 56ccc93 Author: Jan Kratochvil Date: Thu Apr 5 22:55:45 2012 +0200 Merge branch 'pathvec0-1-secmove-misc2-safepath-debug-warn' into pathvec0-1-secmove-misc2-safepath-debug-warn-warnlocal commit 56ccc939673934166c51511609c423469569f98b Merge: e66584f 0781bae Author: Jan Kratochvil Date: Thu Apr 5 22:54:21 2012 +0200 Merge branch 'pathvec0-1-secmove-misc2-safepath-debug' into pathvec0-1-secmove-misc2-safepath-debug-warn Conflicts: gdb/doc/gdb.texinfo commit 0781baeb2b9116361ee880c32c8df5fecc145991 Merge: 1cf6927 e77eb0e Author: Jan Kratochvil Date: Thu Apr 5 22:53:58 2012 +0200 Merge branch 'pathvec0-1-secmove-misc2-safepath' into pathvec0-1-secmove-misc2-safepath-debug commit e77eb0e8c3c9345418c51d8b1f4ac7aabec0b5a2 Merge: 56f7621 b1ff8e0 Author: Jan Kratochvil Date: Thu Apr 5 22:53:32 2012 +0200 Merge branch 'pathvec0-1-secmove-misc2' into pathvec0-1-secmove-misc2-safepath commit b1ff8e085bc019f7baf267ae6e31cb7957375a9d Author: Jan Kratochvil Date: Thu Apr 5 22:53:28 2012 +0200 . commit a9bf39b303e4a777fcab2e14f3c8d8924ec5dd9e Merge: 1a8d461 e66584f Author: Jan Kratochvil Date: Thu Apr 5 22:33:33 2012 +0200 Merge branch 'pathvec0-1-secmove-misc2-safepath-debug-warn' into pathvec0-1-secmove-misc2-safepath-debug-warn-warnlocal commit e66584fa39bd0f2bc298d6ffb586ea212aa93765 Merge: 1d2d7a0 1cf6927 Author: Jan Kratochvil Date: Thu Apr 5 22:33:33 2012 +0200 Merge branch 'pathvec0-1-secmove-misc2-safepath-debug' into pathvec0-1-secmove-misc2-safepath-debug-warn commit 1cf6927fa932c708e3e98cdf4e4aec9bbed6ffa7 Merge: cd44fce 56f7621 Author: Jan Kratochvil Date: Thu Apr 5 22:33:33 2012 +0200 Merge branch 'pathvec0-1-secmove-misc2-safepath' into pathvec0-1-secmove-misc2-safepath-debug commit 56f7621909c1248705575c903c4901185c8aa349 Merge: 09253d1 f535f02 Author: Jan Kratochvil Date: Thu Apr 5 22:33:33 2012 +0200 Merge branch 'pathvec0-1-secmove-misc2' into pathvec0-1-secmove-misc2-safepath commit f535f02ff5da2fd2106314ada112c5252afb5f64 Merge: 6fca6e2 b1ffbb3 Author: Jan Kratochvil Date: Thu Apr 5 22:33:32 2012 +0200 Merge branch 'pathvec0-1-secmove' into pathvec0-1-secmove-misc2 commit b1ffbb32847f7ac37ae3ae63e67fc73d4dcb98fa Merge: 27c28fe b6cd7d2 Author: Jan Kratochvil Date: Thu Apr 5 22:33:32 2012 +0200 Merge branch 'pathvec0-1' into pathvec0-1-secmove commit b6cd7d23c61d0ae128f062a9a3805d59b4e6de6c Merge: 9059d37 7858ec7 Author: Jan Kratochvil Date: Thu Apr 5 22:33:32 2012 +0200 Merge branch 'pathvec0' into pathvec0-1 commit 7858ec7d59cb5e54745a4dbf2a533d30ccba8e98 Merge: a79ab0d 501a9ff Author: Jan Kratochvil Date: Thu Apr 5 22:33:32 2012 +0200 Merge remote-tracking branch 'gdb/master' into pathvec0 commit 1a8d461500b062ba185b1bb548d24a0f666ae26b Author: Jan Kratochvil Date: Thu Apr 5 21:17:58 2012 +0200 . commit bce6bb3911069cb5cf3c1af43e8301980e8f9877 Merge: 4ffac4d 1d2d7a0 Author: Jan Kratochvil Date: Thu Apr 5 21:17:51 2012 +0200 Merge branch 'pathvec0-1-secmove-misc2-safepath-debug-warn' into pathvec0-1-secmove-misc2-safepath-debug-warn-warnlocal commit 1d2d7a0bbdb7cff65dc19285a0d52f04c6b7224f Author: Jan Kratochvil Date: Thu Apr 5 21:15:48 2012 +0200 . commit 4ffac4d4c5fd86244b492b3fe08ff3b8fa5c93df Merge: 110ae17 c5396af Author: Jan Kratochvil Date: Thu Apr 5 21:14:59 2012 +0200 . commit c5396af1a8133fc8ea0d067a2243803a8988eb20 Merge: bf95c3f cd44fce Author: Jan Kratochvil Date: Thu Apr 5 21:13:32 2012 +0200 Merge branch 'pathvec0-1-secmove-misc2-safepath-debug' into pathvec0-1-secmove-misc2-safepath-debug-warn commit cd44fce9613686ec4041a89e1638a081b465b159 Author: Jan Kratochvil Date: Thu Apr 5 21:13:01 2012 +0200 . commit 09253d1f17f2ccb48450bbe51f898ba7c2bfce73 Merge: f1a415a 6fca6e2 Author: Jan Kratochvil Date: Thu Apr 5 21:12:30 2012 +0200 Merge branch 'pathvec0-1-secmove-misc2' into pathvec0-1-secmove-misc2-safepath commit bf95c3f974bed4fdf06ed7a8ce70a4f88f7f95d7 Merge: 202dc2a edb062c Author: Jan Kratochvil Date: Thu Apr 5 21:12:30 2012 +0200 Merge branch 'pathvec0-1-secmove-misc2-safepath-debug' into pathvec0-1-secmove-misc2-safepath-debug-warn commit edb062cb924ca8031eac65e27af7acc38f93dfc5 Merge: 6cff2a1 09253d1 Author: Jan Kratochvil Date: Thu Apr 5 21:12:30 2012 +0200 Merge branch 'pathvec0-1-secmove-misc2-safepath' into pathvec0-1-secmove-misc2-safepath-debug commit 6fca6e215aeaee41a56411f67695fa201e3f6232 Author: Jan Kratochvil Date: Thu Apr 5 21:12:23 2012 +0200 . commit 202dc2a265837b7beb22fde70eb981e1a8148df6 Author: Jan Kratochvil Date: Thu Apr 5 21:10:41 2012 +0200 . commit 501a9ff7887f91881f25cc1342a6ce3089fbc034 Author: Keith Seitz Date: Thu Apr 5 18:50:24 2012 +0000 linespec rewrite: * linespec.c (decode_compound): Remove. (enum offset_relative_sign): New enum. (struct line_offset): New struct. (struct linespec): New struct. (struct linespec_state): Move file_symtabs, user_filename, and user_function into struct linespec. Make result an anonymous struct holding vectors of symbolp and minsym_and_objfile_d. Add language member. (enum ls_token_type): New enum. (linespec_keywords): New array. (struct ls_token): New struct. (struct ls_parser): New struct. (linespec_lexer_lex_number): New function. (linespec_lexer_lex_keyword): New function. (is_ada_operator): New function. (skip_quote_char): New function. (copy_token_string): New function. (is_closing_quote_enclosed): New function. (find_parameter_list_end): New function. (linespec_lexer_lex_string): New function. (linespec_lexer_lex_one): New function. (linespec_lexer_consume_token): New function. (linespec_lexer_peek_token): New function. (cplusplus_error): Remove unused function. (find_methods): Update comment. (find_toplevel_char): Return const. (is_objc_method_format): Remove unused function. (find_toplevel_string): New function. (is_linespec_boundary): Remove. (symbol_not_found_error): New function. (find_method_overload_end): Remove function. (unexpected_linespec_error): New function. (keep_name_info): Remove. (linespec_parse_line_offset): New function. (linespec_parse_basic): New function. (canonicalize_linespec): New function. (decode_line_internal): Remove. (create_sals_line_offset): New function adapted from decode_all_digits. (convert_linespec_to_sals): New function. (parse_linespec): New function. (linespec_parser_new): New function. (linespec_state_destructor): Change parameter type to struct linespec_state *. Add language parameter. Remove freeing of moved members. (linespec_parser_delete): New function. (decode_line_full): Use parse_linespec and linespec_parser_new. (decode_line_1): Likewise. (decode_indirect): Rename to ... (linespec_expression_to_pc): ... this and rewrite to simply find CORE_ADDR, storing this result for later conversion to SALs. (locate_first_half): Remove. (deocde_objc): Add parameter LS. Initialize new struct collect_info members. Handle minimal symbols, too. (decode_compound): Delete. (lookup_prefix_sym): Rewrite. (compare_msymbols): New function. (find_method): Rewrite. Do not call cplusplus_error. (symtabs_from_filename): Rewrite. (collect_function_symbols): Delete. (find_function_symbols): Rewrite without ARGPTR-style processing. (decode_all_digits): Delete. (Rewritten as create_sals_line_offset.) (decode_dollar): Adapted and renamed to ... (linespec_parse_variable): ... this. (find_linespec_symbols): New function. (decode_label): Adapted and renamed to ... (find_label_symbols): ... this. (decode_digits_list_mode): Add and use LS argument. (decode_digits_ordinary): Likewise. (collect_symbols): Do not collect SALs, just symbols and msymbols. If in list mode, allow any symbol class. Otherwise, only permit LOC_BLOCK symbols. (minsym_found): Update comments. (search_minsyms_for_name): Do not convert the matching symbol into a SAL. Simply push the symbol and objfile into the result vector. (decode_variable): Delete. Contents adapted into find_linespec_symbols. * cp-support.c (SKIP_SPACE): Remove. (operator_tokens): Remove unused global. (cp_validate_operator): Remove. * cp-support.h (cp_validate_operator): Remove declaration. * gdb.base/advance.exp: Update error message for "advance malformed" test. * gdb.base/break.exp: Likewise for "breakpoint with trailing garbage" test. * gdb.base/hbreak2.exp: Likewise for "hardware breakpoint with trailing garbage" test. * gdb.base/jump.exp: Likewise for "jump with trailing argument junk" test. * gdb.base/sepdebug.exp: Likewise for "breakpoint with trailng garbage" test. * gdb.base/until.exp: Likewise for "malformed until" test. * gdb.cp/ovldbreak.exp: Create the breakpoint table for "breakpoint info (after setting on all)". * gdb.cp/userdef.exp: Remove quoting for "break A2::operator+" tests. * gdb.cp/cplabel.cc: New file. * gdb.cp/cplabel.exp: New test. * gdb.linespec/ls-errs.c: New file. * gdb.linespec/ls-errs.exp: New test. ----------------------------------------------------------------------- Summary of changes: gdb/ChangeLog | 92 + gdb/NEWS | 7 +- gdb/auto-load.c | 69 +- gdb/auto-load.h | 7 +- gdb/cp-support.c | 117 - gdb/cp-support.h | 2 - gdb/doc/gdb.texinfo | 74 +- gdb/linespec.c | 3657 +++++++++++++++++--------------- gdb/main.c | 17 +- gdb/testsuite/ChangeLog | 20 + gdb/testsuite/gdb.base/advance.exp | 3 +- gdb/testsuite/gdb.base/break.exp | 2 +- gdb/testsuite/gdb.base/hbreak2.exp | 2 +- gdb/testsuite/gdb.base/jump.exp | 2 +- gdb/testsuite/gdb.base/sepdebug.exp | 2 +- gdb/testsuite/gdb.base/until.exp | 3 +- gdb/testsuite/gdb.cp/cplabel.cc | 80 + gdb/testsuite/gdb.cp/cplabel.exp | 40 + gdb/testsuite/gdb.cp/ovldbreak.exp | 26 +- gdb/testsuite/gdb.cp/userdef.exp | 4 +- gdb/testsuite/gdb.linespec/ls-errs.c | 29 + gdb/testsuite/gdb.linespec/ls-errs.exp | 189 ++ 22 files changed, 2567 insertions(+), 1877 deletions(-) create mode 100644 gdb/testsuite/gdb.cp/cplabel.cc create mode 100644 gdb/testsuite/gdb.cp/cplabel.exp create mode 100644 gdb/testsuite/gdb.linespec/ls-errs.c create mode 100644 gdb/testsuite/gdb.linespec/ls-errs.exp First 500 lines of diff: diff --git a/gdb/ChangeLog b/gdb/ChangeLog index bdfd9b7..4900388 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,95 @@ +2012-04-05 Keith Seitz + + * linespec.c (decode_compound): Remove. + (enum offset_relative_sign): New enum. + (struct line_offset): New struct. + (struct linespec): New struct. + (struct linespec_state): Move file_symtabs, + user_filename, and user_function into struct linespec. + Make result an anonymous struct holding vectors of + symbolp and minsym_and_objfile_d. + Add language member. + (enum ls_token_type): New enum. + (linespec_keywords): New array. + (struct ls_token): New struct. + (struct ls_parser): New struct. + (linespec_lexer_lex_number): New function. + (linespec_lexer_lex_keyword): New function. + (is_ada_operator): New function. + (skip_quote_char): New function. + (copy_token_string): New function. + (is_closing_quote_enclosed): New function. + (find_parameter_list_end): New function. + (linespec_lexer_lex_string): New function. + (linespec_lexer_lex_one): New function. + (linespec_lexer_consume_token): New function. + (linespec_lexer_peek_token): New function. + (cplusplus_error): Remove unused function. + (find_methods): Update comment. + (find_toplevel_char): Return const. + (is_objc_method_format): Remove unused function. + (find_toplevel_string): New function. + (is_linespec_boundary): Remove. + (symbol_not_found_error): New function. + (find_method_overload_end): Remove function. + (unexpected_linespec_error): New function. + (keep_name_info): Remove. + (linespec_parse_line_offset): New function. + (linespec_parse_basic): New function. + (canonicalize_linespec): New function. + (decode_line_internal): Remove. + (create_sals_line_offset): New function adapted from + decode_all_digits. + (convert_linespec_to_sals): New function. + (parse_linespec): New function. + (linespec_parser_new): New function. + (linespec_state_destructor): Change parameter type to + struct linespec_state *. + Add language parameter. + Remove freeing of moved members. + (linespec_parser_delete): New function. + (decode_line_full): Use parse_linespec and linespec_parser_new. + (decode_line_1): Likewise. + (decode_indirect): Rename to ... + (linespec_expression_to_pc): ... this and rewrite + to simply find CORE_ADDR, storing this result for later + conversion to SALs. + (locate_first_half): Remove. + (deocde_objc): Add parameter LS. + Initialize new struct collect_info members. + Handle minimal symbols, too. + (decode_compound): Delete. + (lookup_prefix_sym): Rewrite. + (compare_msymbols): New function. + (find_method): Rewrite. + Do not call cplusplus_error. + (symtabs_from_filename): Rewrite. + (collect_function_symbols): Delete. + (find_function_symbols): Rewrite without ARGPTR-style + processing. + (decode_all_digits): Delete. (Rewritten as create_sals_line_offset.) + (decode_dollar): Adapted and renamed to ... + (linespec_parse_variable): ... this. + (find_linespec_symbols): New function. + (decode_label): Adapted and renamed to ... + (find_label_symbols): ... this. + (decode_digits_list_mode): Add and use LS argument. + (decode_digits_ordinary): Likewise. + (collect_symbols): Do not collect SALs, just symbols and msymbols. + If in list mode, allow any symbol class. Otherwise, only + permit LOC_BLOCK symbols. + (minsym_found): Update comments. + (search_minsyms_for_name): Do not convert the matching symbol + into a SAL. Simply push the symbol and objfile into the + result vector. + (decode_variable): Delete. Contents adapted into + find_linespec_symbols. + + * cp-support.c (SKIP_SPACE): Remove. + (operator_tokens): Remove unused global. + (cp_validate_operator): Remove. + * cp-support.h (cp_validate_operator): Remove declaration. + 2012-04-03 Jan Kratochvil * cp-valprint.c (cp_print_value_fields): Check valprint_check_validity diff --git a/gdb/NEWS b/gdb/NEWS index b93384a..79f6264 100644 --- a/gdb/NEWS +++ b/gdb/NEWS @@ -141,10 +141,15 @@ set auto-load python-scripts on|off show auto-load python-scripts Control auto-loading of Python script files. -set auto-load local-gdbinit on|off|warn-and-on|warn-and-off +set auto-load local-gdbinit on|off show auto-load local-gdbinit Control loading of init file (.gdbinit) from current directory. +set auto-load local-gdbinit-warning on|off +show auto-load local-gdbinit-warning + Control printing deprecation warning for loading of init file (.gdbinit) from + current directory. + set auto-load libthread-db on|off show auto-load libthread-db Control auto-loading of inferior specific thread debugging shared library. diff --git a/gdb/auto-load.c b/gdb/auto-load.c index 0acc21c..67df718 100644 --- a/gdb/auto-load.c +++ b/gdb/auto-load.c @@ -87,31 +87,12 @@ show_auto_load_gdb_scripts (struct ui_file *file, int from_tty, used to find the scripts. */ int global_auto_load = 1; -/* Load current directory .gdbinit file automatically. */ -const char auto_load_local_gdbinit_yes[] = "yes"; - -/* Never load current directory .gdbinit file. */ -const char auto_load_local_gdbinit_no[] = "no"; - -/* Give deprecation warning and load current directory .gdbinit file - automatically. */ -const char auto_load_local_gdbinit_warn_and_yes[] = "warn-and-yes"; - -/* Give deprecation warning and do not load current directory .gdbinit file. */ -const char auto_load_local_gdbinit_warn_and_no[] = "warn-and-no"; - -/* Options for auto_load_local_gdbinit. */ -static const char *const auto_load_local_gdbinit_enum[] = -{ - auto_load_local_gdbinit_yes, - auto_load_local_gdbinit_no, - auto_load_local_gdbinit_warn_and_yes, - auto_load_local_gdbinit_warn_and_no, - NULL -}; - /* Auto-load .gdbinit file from the current directory? */ -const char *auto_load_local_gdbinit = auto_load_local_gdbinit_warn_and_yes; +int auto_load_local_gdbinit = 1; + +/* Print warning on attempted auto-load of .gdbinit file from the current + directory? */ +int auto_load_local_gdbinit_warning = 1; /* Absolute pathname to the current directory .gdbinit, if it exists. */ char *auto_load_local_gdbinit_pathname = NULL; @@ -130,6 +111,20 @@ show_auto_load_local_gdbinit (struct ui_file *file, int from_tty, value); } +/* "show" command for the auto_load_local_gdbinit_warning configuration + variable. */ + +static void +show_auto_load_local_gdbinit_warning (struct ui_file *file, int from_tty, + struct cmd_list_element *c, + const char *value) +{ + fprintf_filtered (file, _("Printing deprecation warning for attempted " + "auto-loading of .gdbinit script from current " + "directory is %s.\n"), + value); +} + /* Directory list safe to hold auto-loaded files. It is not checked for absolute paths but they are strongly recommended. It is initialized by _initialize_auto_load. */ @@ -1020,26 +1015,38 @@ This options has security implications for untrusted inferiors."), Usage: info auto-load gdb-scripts [REGEXP]"), auto_load_info_cmdlist_get ()); - add_setshow_enum_cmd ("local-gdbinit", class_support, - auto_load_local_gdbinit_enum, - &auto_load_local_gdbinit, _("\ + add_setshow_boolean_cmd ("local-gdbinit", class_support, + &auto_load_local_gdbinit, _("\ Enable or disable auto-loading of .gdbinit script in current directory."), _("\ Show whether auto-loading .gdbinit script in current directory is enabled."), _("\ If enabled, canned sequences of commands are loaded when debugger starts\n\ from .gdbinit file in current directory. Such files are deprecated,\n\ use a script associated with inferior executable file instead.\n\ -You can optionally display a warning when such file is found.\n\ This options has security implications for untrusted inferiors."), - NULL, show_auto_load_local_gdbinit, - auto_load_set_cmdlist_get (), - auto_load_show_cmdlist_get ()); + NULL, show_auto_load_local_gdbinit, + auto_load_set_cmdlist_get (), + auto_load_show_cmdlist_get ()); add_cmd ("local-gdbinit", class_info, info_auto_load_local_gdbinit, _("Print whether current directory .gdbinit file has been loaded.\n\ Usage: info auto-load local-gdbinit"), auto_load_info_cmdlist_get ()); + add_setshow_boolean_cmd ("local-gdbinit-warning", class_support, + &auto_load_local_gdbinit_warning, _("\ +Enable or disable printing warnings for .gdbinit script in current directory."), + _("\ +Show whether printing warnings for .gdbinit script in current directory \ +is enabled."), + _("\ +GDB prints a warning when it finds .gdbinit script in current directory\n\ +as these files have been deprecated. Whether it is loaded or not depends\n\ +on 'set auto-load local-gdbinit'."), + NULL, show_auto_load_local_gdbinit_warning, + auto_load_set_cmdlist_get (), + auto_load_show_cmdlist_get ()); + auto_load_safe_path = xstrdup (DEFAULT_AUTO_LOAD_SAFE_PATH); auto_load_safe_path_vec_update (); add_setshow_optional_filename_cmd ("safe-path", class_support, diff --git a/gdb/auto-load.h b/gdb/auto-load.h index 4958baf..11cee0d 100644 --- a/gdb/auto-load.h +++ b/gdb/auto-load.h @@ -32,11 +32,8 @@ struct script_language extern int global_auto_load; -extern const char auto_load_local_gdbinit_yes[]; -extern const char auto_load_local_gdbinit_no[]; -extern const char auto_load_local_gdbinit_warn_and_yes[]; -extern const char auto_load_local_gdbinit_warn_and_no[]; -extern const char *auto_load_local_gdbinit; +extern int auto_load_local_gdbinit; +extern int auto_load_local_gdbinit_warning; extern char *auto_load_local_gdbinit_pathname; extern int auto_load_local_gdbinit_loaded; diff --git a/gdb/cp-support.c b/gdb/cp-support.c index a41bcec..025b4de 100644 --- a/gdb/cp-support.c +++ b/gdb/cp-support.c @@ -73,19 +73,6 @@ struct cmd_list_element *maint_cplus_cmd_list = NULL; static void maint_cplus_command (char *arg, int from_tty); static void first_component_command (char *arg, int from_tty); -/* Operator validation. - NOTE: Multi-byte operators (usually the assignment variety - operator) must appear before the single byte version, i.e., "+=" - before "+". */ -static const char *operator_tokens[] = - { - "++", "+=", "+", "->*", "->", "--", "-=", "-", "*=", "*", - "/=", "/", "%=", "%", "!=", "==", "!", "&&", "<<=", "<<", - ">>=", ">>", "<=", "<", ">=", ">", "~", "&=", "&", "|=", - "||", "|", "^=", "^", "=", "()", "[]", ",", "new", "delete" - /* new[] and delete[] require special whitespace handling */ - }; - /* A list of typedefs which should not be substituted by replace_typedefs. */ static const char * const ignore_typedefs[] = { @@ -1459,110 +1446,6 @@ first_component_command (char *arg, int from_tty) extern initialize_file_ftype _initialize_cp_support; /* -Wmissing-prototypes */ -#define SKIP_SPACE(P) \ - do \ - { \ - while (*(P) == ' ' || *(P) == '\t') \ - ++(P); \ - } \ - while (0) - -/* Returns the length of the operator name or 0 if INPUT does not - point to a valid C++ operator. INPUT should start with - "operator". */ -int -cp_validate_operator (const char *input) -{ - int i; - char *copy; - const char *p; - struct expression *expr; - struct value *val; - volatile struct gdb_exception except; - - p = input; - - if (strncmp (p, "operator", 8) == 0) - { - int valid = 0; - - p += 8; - SKIP_SPACE (p); - for (i = 0; - i < sizeof (operator_tokens) / sizeof (operator_tokens[0]); - ++i) - { - int length = strlen (operator_tokens[i]); - - /* By using strncmp here, we MUST have operator_tokens - ordered! See additional notes where operator_tokens is - defined above. */ - if (strncmp (p, operator_tokens[i], length) == 0) - { - const char *op = p; - - valid = 1; - p += length; - - if (strncmp (op, "new", 3) == 0 - || strncmp (op, "delete", 6) == 0) - { - - /* Special case: new[] and delete[]. We must be - careful to swallow whitespace before/in "[]". */ - SKIP_SPACE (p); - - if (*p == '[') - { - ++p; - SKIP_SPACE (p); - if (*p == ']') - ++p; - else - valid = 0; - } - } - - if (valid) - return (p - input); - } - } - - /* Check input for a conversion operator. */ - - /* Skip past base typename. */ - while (*p != '*' && *p != '&' && *p != 0 && *p != ' ') - ++p; - SKIP_SPACE (p); - - /* Add modifiers '*' / '&'. */ - while (*p == '*' || *p == '&') - { - ++p; - SKIP_SPACE (p); - } - - /* Check for valid type. [Remember: input starts with - "operator".] */ - copy = savestring (input + 8, p - input - 8); - expr = NULL; - val = NULL; - TRY_CATCH (except, RETURN_MASK_ALL) - { - expr = parse_expression (copy); - val = evaluate_type (expr); - } - - xfree (copy); - if (expr) - xfree (expr); - - if (val != NULL && value_type (val) != NULL) - return (p - input); - } - - return 0; -} /* Implement "info vtbl". */ diff --git a/gdb/cp-support.h b/gdb/cp-support.h index 8898807..5988418 100644 --- a/gdb/cp-support.h +++ b/gdb/cp-support.h @@ -170,8 +170,6 @@ extern struct symbol **make_symbol_overload_list_adl (struct type **arg_types, extern struct type *cp_lookup_rtti_type (const char *name, struct block *block); -extern int cp_validate_operator (const char *input); - /* Functions/variables from cp-namespace.c. */ extern int cp_is_anonymous (const char *namespace); diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 2959310..34af8c5 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -1287,7 +1287,7 @@ Processes command line options and operands. @item Reads and executes the commands from init file (if any) in the current working directory as long as @samp{set auto-load local-gdbinit} is set to -@samp{yes} or @samp{warn-and-yes} (@pxref{Init File in the Current Directory}). +@samp{on} (@pxref{Init File in the Current Directory}). This is only done if the current directory is different from your home directory. Thus, you can have more than one init file, one generic in your home directory, and another, specific @@ -20746,9 +20746,10 @@ or disabled. (gdb) show auto-load gdb-scripts: Auto-loading of canned sequences of commands scripts is on. libthread-db: Auto-loading of inferior specific libthread_db is on. -local-gdbinit: Auto-loading of .gdbinit script - from current directory is warn-and-yes. +local-gdbinit: Auto-loading of .gdbinit script from current directory is on. python-scripts: Auto-loading of Python scripts is on. +local-gdbinit-warning: Printing deprecation warning for attempted auto-loading + of .gdbinit script from current directory is on. safe-path: List of directories from which it is safe to auto-load files is /usr/local. @end smallexample @@ -20774,22 +20775,24 @@ Yes /home/user/gdb/gdb-gdb.py These are various kinds of files @value{GDBN} can automatically load: -@multitable {@xref{dotdebug_gdb_scripts section}.} {See @ref{set auto-load python-scripts}} -@item @xref{objfile-gdb.py file}. -@tab See @ref{set auto-load python-scripts}. -@item @xref{objfile-gdb.gdb file}. -@tab See @ref{set auto-load gdb-scripts}. -@item @xref{dotdebug_gdb_scripts section}. -@tab See @ref{set auto-load python-scripts}. -@item @xref{Init File in the Current Directory}. -@tab See @ref{set auto-load local-gdbinit}. -@item @xref{libthread_db.so.1 file}. -@tab See @ref{set auto-load libthread-db}. -@end multitable +@itemize @bullet +@item +@xref{objfile-gdb.py file}, controlled by @ref{set auto-load python-scripts}. +@item +@xref{objfile-gdb.gdb file}, controlled by @ref{set auto-load gdb-scripts}. +@item +@xref{dotdebug_gdb_scripts section}, +controlled by @ref{set auto-load python-scripts}. +@item +@xref{Init File in the Current Directory}, +controlled by @ref{set auto-load local-gdbinit}. +@item +@xref{libthread_db.so.1 file}, controlled by @ref{set auto-load libthread-db}. +@end itemize These are @value{GDBN} control commands for the auto-loading: -@multitable {@xref{show auto-load python-scripts}.} {Show setting of @value{GDBN} command scripts.} +@multitable @columnfractions .5 .5 @item @xref{set auto-load off}. @tab Disable auto-loading globally. @item @xref{show auto-load}. @@ -20814,6 +20817,10 @@ These are @value{GDBN} control commands for the auto-loading: @tab Show setting of init file in the current directory. @item @xref{info auto-load local-gdbinit}. @tab Show state of init file in the current directory. +@item @xref{set auto-load local-gdbinit-warning}. +@tab Control warning for init file in the current directory. +@item @xref{show auto-load local-gdbinit-warning}. +@tab Show setting of warning for init file in the current directory. @item @xref{set auto-load libthread-db}. @tab Control for thread debugging library. @item @xref{show auto-load libthread-db}. @@ -20848,26 +20855,37 @@ see @ref{Init File in the Current Directory during Startup}. @table @code @anchor{set auto-load local-gdbinit} @kindex set auto-load local-gdbinit -@item set auto-load local-gdbinit [yes|no|warn-and-yes|warn-and-no] +@item set auto-load local-gdbinit [on|off] Enable or disable the auto-loading of canned sequences of commands (@pxref{Sequences}) found in init file in the current directory. -The options @samp{warn-and-X} give warning before loading -(@samp{warn-and-yes}) or when declining to load (@samp{warn-and-no}) the file -as the @samp{local-gdbinit} feature is deprecated in favor -of @xref{objfile-gdb.gdb file}. @anchor{show auto-load local-gdbinit} @kindex show auto-load local-gdbinit @item show auto-load local-gdbinit Show whether auto-loading of canned sequences of commands from init file in the -current directory is enabled or disabled and whether warnings are printed -during its load. +current directory is enabled or disabled. @anchor{info auto-load local-gdbinit} @kindex info auto-load local-gdbinit @item info auto-load local-gdbinit Print whether canned sequences of commands from init file in the current directory have been auto-loaded. + +@anchor{set auto-load local-gdbinit-warning} +@kindex set auto-load local-gdbinit-warning +@item set auto-load local-gdbinit-warning [on|off] hooks/post-receive -- Repository for Project Archer.