diff options
author | Doug Evans <xdje42@gmail.com> | 2015-01-11 14:06:34 -0800 |
---|---|---|
committer | Doug Evans <xdje42@gmail.com> | 2015-01-11 14:06:34 -0800 |
commit | 439250fbacfc212a5959b4b5a53ecfee91dfb866 (patch) | |
tree | d8ca359220a4a15371412276967646212eb490f9 /gdb/testsuite | |
parent | ebf3aa72243fec4bc02617673b243a63050e6127 (diff) | |
download | gdb-439250fbacfc212a5959b4b5a53ecfee91dfb866.zip gdb-439250fbacfc212a5959b4b5a53ecfee91dfb866.tar.gz gdb-439250fbacfc212a5959b4b5a53ecfee91dfb866.tar.bz2 |
PR gdb/15830
gdb/ChangeLog:
PR gdb/15830
* NEWS: The "maint demangle" command is renamed as "demangle".
* demangle.c: #include cli/cli-utils.h, language.h.
(demangle_command): New function.
(_initialize_demangle): Add new command "demangle".
* maint.c (maintenance_demangle): Stub out.
(_initialize_maint_cmds): Update help text for "maint demangle",
and mark as deprecated.
gdb/doc/ChangeLog:
* gdb.texinfo (Debugging C Plus Plus): Mention "demangle".
(Symbols): Ditto.
(Maintenance Commands): Delete docs for "maint demangle".
gdb/testsuite/ChangeLog:
* gdb.base/maint.exp: Remove references to "maint demangle".
* gdb.cp/demangle.exp: Update. "maint demangle" -> "demangle".
Add tests for explicitly specifying language to demangle.
* gdb.dlang/demangle.exp: Ditto.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 8 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/maint.exp | 13 | ||||
-rw-r--r-- | gdb/testsuite/gdb.cp/demangle.exp | 12 | ||||
-rw-r--r-- | gdb/testsuite/gdb.dlang/demangle.exp | 5 |
4 files changed, 24 insertions, 14 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index d3dacf1..4bcd4f5 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2015-01-11 Doug Evans <xdje42@gmail.com> + + PR gdb/15830 + * gdb.base/maint.exp: Remove references to "maint demangle". + * gdb.cp/demangle.exp: Update. "maint demangle" -> "demangle". + Add tests for explicitly specifying language to demangle. + * gdb.dlang/demangle.exp: Ditto. + 2015-01-09 Pedro Alves <palves@redhat.com> * gdb.threads/non-stop-fair-events.c: New file. diff --git a/gdb/testsuite/gdb.base/maint.exp b/gdb/testsuite/gdb.base/maint.exp index 1573710..e203207 100644 --- a/gdb/testsuite/gdb.base/maint.exp +++ b/gdb/testsuite/gdb.base/maint.exp @@ -25,7 +25,6 @@ #maintenance expand-symtabs -- Expand symtabs matching a file regexp #maintenance set -- Set GDB internal variables used by the GDB maintainer #maintenance show -- Show GDB internal variables used by the GDB maintainer -#maintenance demangle -- Demangle a C++ mangled name #maintenance dump-me -- Get fatal error; make debugger dump its core #maintenance print -- Maintenance command for printing GDB internal state #maintenance info -- Commands for showing internal info about the program being debugged @@ -136,13 +135,6 @@ gdb_test "pwd" \ "Command execution time: \[0-9.\]+ \\(cpu\\), \[0-9.\]+ \\(wall\\)\[\r\n\]+Space used: $decimal \\(\\+$decimal for this command\\)\[\r\n\]+#symtabs: $decimal \\(\\+$decimal\\), #compunits: $decimal \\(\\+$decimal\\), #blocks: $decimal \\(\\+$decimal\\)" gdb_test_no_output "maint set per-command off" -gdb_test "maint demangle" \ - "\"maintenance demangle\" takes an argument to demangle\\." - -gdb_test "maint demangle main" "Can't demangle \"main\"" - - - # The timeout value is raised, because printing all the symbols and # statistical information about Cygwin and Windows libraries takes a lot # of time. @@ -484,7 +476,7 @@ set timeout $oldtimeout #============test help on maint commands gdb_test "help maint" \ - "Commands for use by GDB maintainers\\..*Includes commands to dump specific internal GDB structures in.*a human readable form, to cause GDB to deliberately dump core,.*to test internal functions such as the C../ObjC demangler, etc\\..*List of maintenance subcommands:.*maintenance info.*maintenance internal-error.*maintenance print.*maintenance set.*maintenance show.*Type.*help maintenance.*followed by maintenance subcommand name for full documentation\\..*Command name abbreviations are allowed if unambiguous\\..*" + "Commands for use by GDB maintainers\\..*Includes commands to dump specific internal GDB structures in.*a human readable form, to cause GDB to deliberately dump core, etc\\..*List of maintenance subcommands:.*maintenance info.*maintenance internal-error.*maintenance print.*maintenance set.*maintenance show.*Type.*help maintenance.*followed by maintenance subcommand name for full documentation\\..*Command name abbreviations are allowed if unambiguous\\..*" gdb_test "help maint info" \ "Commands for showing internal info about the program being debugged.*unambiguous\\..*" @@ -496,8 +488,7 @@ test_prefix_command_help {"maint print" "maintenance print"} { test_prefix_command_help {"maint" "maintenance"} { "Commands for use by GDB maintainers\\.\[\r\n\]+" "Includes commands to dump specific internal GDB structures in\[\r\n\]+" - "a human readable form, to cause GDB to deliberately dump core,\[\r\n\]+" - "to test internal functions such as the C\\+\\+/ObjC demangler, etc\\.\[\r\n\]+" + "a human readable form, to cause GDB to deliberately dump core, etc\\.\[\r\n\]+" } #set oldtimeout $timeout diff --git a/gdb/testsuite/gdb.cp/demangle.exp b/gdb/testsuite/gdb.cp/demangle.exp index 0ac855b..078f4b4 100644 --- a/gdb/testsuite/gdb.cp/demangle.exp +++ b/gdb/testsuite/gdb.cp/demangle.exp @@ -73,7 +73,7 @@ proc test_demangling_core {tester test result} { set_demangling_style $style } - $tester "maintenance demangle $name" $result $test + $tester "demangle $name" $result $test } ### Demangle an identifier, and check that the result matches a pattern. @@ -527,7 +527,7 @@ proc test_gnu_style_demangling {} { ## 1999-04-19: "Fix from Dale Hawkins". Shouldn't segfault. # Accept even a dubious demangling; the string is ambiguous. - gdb_test_multiple "maintenance demangle __thunk_64__0RL__list__Q29CosNaming20_proxy_NamingContextUlRPt25_CORBA_Unbounded_Sequence1ZQ29CosNaming7BindingRPQ29CosNaming15BindingIterator" "gnu: __thunk_64__0RL__list__Q29CosNaming20_proxy_NamingContextUlRPt25_CORBA_Unbounded_Sequence1ZQ29CosNaming7BindingRPQ29CosNaming15BindingIterator" { + gdb_test_multiple "demangle __thunk_64__0RL__list__Q29CosNaming20_proxy_NamingContextUlRPt25_CORBA_Unbounded_Sequence1ZQ29CosNaming7BindingRPQ29CosNaming15BindingIterator" "gnu: __thunk_64__0RL__list__Q29CosNaming20_proxy_NamingContextUlRPt25_CORBA_Unbounded_Sequence1ZQ29CosNaming7BindingRPQ29CosNaming15BindingIterator" { -re "virtual function thunk \\(delta:-64\\) for CosNaming::_proxy_NamingContext::_0RL__list\\(unsigned long, _CORBA_Unbounded_Sequence<CosNaming::Binding> \\*\\&, CosNaming::BindingIterator \\*\\&\\)\r\n$gdb_prompt $" { pass "gnu: __thunk_64__0RL__list__Q29CosNaming20_proxy_NamingContextUlRPt25_CORBA_Unbounded_Sequence1ZQ29CosNaming7BindingRPQ29CosNaming15BindingIterator" } @@ -1557,6 +1557,14 @@ proc do_tests {} { catch_demangling_errors test_gnu_style_demangling catch_demangling_errors test_arm_style_demangling catch_demangling_errors test_hp_style_demangling + + # Verify specifying demangle language. + gdb_test_no_output "set language unknown" + set_demangling_style "auto" + gdb_test_exact "demangle -l c++ -- _ZSt4cout" "std::cout" + gdb_test_exact "demangle -l c++ _ZSt4cout" "std::cout" + gdb_test_exact "demangle -l c -- _ZSt4cout" "Can't demangle \"_ZSt4cout\"" + gdb_test_exact "demangle -l garbage xyzdje" "Unknown language \"garbage\"" } do_tests diff --git a/gdb/testsuite/gdb.dlang/demangle.exp b/gdb/testsuite/gdb.dlang/demangle.exp index 5a9d9a4..9eb6054 100644 --- a/gdb/testsuite/gdb.dlang/demangle.exp +++ b/gdb/testsuite/gdb.dlang/demangle.exp @@ -23,7 +23,7 @@ if { [skip_d_tests] } { continue } ### Utility function for test_demangling and test_demangling_exact. proc test_demangling {test result} { - gdb_test_exact "maintenance demangle $test" $result $test + gdb_test_exact "demangle $test" $result $test } proc test_d_demangling {} { @@ -201,6 +201,9 @@ if [set_lang_d] { gdb_test_no_output "set width 0" test_d_demangling + + # Verify we can specify the d language to demangle. + gdb_test_exact "demangle -l d -- _Dmain" "D main" } else { warning "D demangling tests suppressed." } |