📄 demangle.exp
字号:
# Copyright (C) 1992, 1997, 1999, 2003, 2004 Free Software Foundation, Inc.# This program is free software; you can redistribute it and/or modify# it under the terms of the GNU General Public License as published by# the Free Software Foundation; either version 2 of the License, or# (at your option) any later version.# # This program is distributed in the hope that it will be useful,# but WITHOUT ANY WARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the# GNU General Public License for more details.# # You should have received a copy of the GNU General Public License# along with this program; if not, write to the Free Software# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # This file was written by Fred Fish. (fnf@cygnus.com)if $tracelevel then { strace $tracelevel}if { [skip_cplus_tests] } { continue }### The demangling style we last sent to GDB.set current_demangling_style none### Set GDB's current demangling style to STYLE. Subsequent calls to### test_demangle will include STYLE in the test name when reporting### passes and failures.proc set_demangling_style {style} { global gdb_prompt global current_demangling_style send_gdb "set demangle-style $style\n" gdb_expect { -re "set demangle-style $style\[\r\n\]+$gdb_prompt $" { pass "$style: set demangle-style" } -re ".*$gdb_prompt $" { fail "$style: set demangle-style" error "set_demangling_style: set style" } timeout { fail "$style: set demangle-style (timeout)" error "set_demangling_style: set style" } } send_gdb "show demangle-style\n" gdb_expect { -re "The current C\[+\]+ demangling style is \"$style\".\r\n$gdb_prompt $" { pass "$style: check demangling style" } -re ".*$gdb_prompt $" { fail "$style: check demangling style" error "set_demangling_style: check style" } timeout { fail "$style: check demangling style (timeout)" error "set_demangling_style: check style" } } set current_demangling_style $style}### Utility function for test_demangling and test_demangling_exact.proc test_demangling_core {tester test result} { global current_demangling_style if {! [regexp {^([^ ]+): (.+)$} $test dummy style name]} { error "bad test name passed to test_demangling" } if {[string compare $style $current_demangling_style]} { set_demangling_style $style } $tester "maintenance demangle $name" $result $test}### Demangle an identifier, and check that the result matches a pattern.###### TEST should be of the form "STYLE: NAME", where STYLE is the name### of a demangling style (like "gnu" or "arm"), and NAME is a mangled### identifier to demangle. Pass when the result matches the regular### expression RESULT. Report passes and fails using TEST as the name### of the test.###### Why don't we just pass the STYLE and NAME as two separate### arguments, or let the style be a global variable? That would be### cleaner. However, doing it this way means that:### ### 1) the name of the test, as recorded in the summary and log,### appears verbatim in the script, and### ### 2) that test names are unique, even though we try to demangle the same### identifiers using several different mangling styles.### ### This makes it a lot easier for people tracking down failures to### find the one they care about.proc test_demangling {test result} { test_demangling_core gdb_test $test $result}### Like test_demangling, above, except that RESULT is not a regexp,### but a string that must match exactly.proc test_demangling_exact {test result} { test_demangling_core gdb_test_exact $test $result}## Test gnu style name demangling#proc test_gnu_style_demangling {} { global gdb_prompt test_demangling "gnu: Abort__FP6EditoriPCc" \ "Abort\[(\]+Editor \[*\]+, int, (const char|char const) \[*\]+\[)\]+" test_demangling_exact "gnu: AddAlignment__9ivTSolverUiP12ivInteractorP7ivTGlue" "ivTSolver::AddAlignment(unsigned int, ivInteractor *, ivTGlue *)" test_demangling "gnu: Append__15NameChooserViewPCc" \ "NameChooserView::Append\[(\]+(const char|char const) \[*\]+\[)\]+" test_demangling_exact "gnu: ArrowheadIntersects__9ArrowLineP9ArrowheadR6BoxObjP7Graphic" "ArrowLine::ArrowheadIntersects(Arrowhead *, BoxObj &, Graphic *)" test_demangling_exact "gnu: AtEnd__13ivRubberGroup" "ivRubberGroup::AtEnd(void)" test_demangling_exact "gnu: BgFilter__9ivTSolverP12ivInteractor" "ivTSolver::BgFilter(ivInteractor *)" test_demangling "gnu: BitPatterntoa__FRC10BitPatternccc" \ "BitPatterntoa\[(\]+(const BitPattern|BitPattern const) &, char, char, char\[)\]+" test_demangling_exact "gnu: Check__6UArrayi" "UArray::Check(int)" test_demangling_exact "gnu: CoreConstDecls__8TextCodeR7ostream" "TextCode::CoreConstDecls(ostream &)" test_demangling_exact "gnu: Detach__8StateVarP12StateVarView" "StateVar::Detach(StateVarView *)" test_demangling_exact "gnu: Done__9ComponentG8Iterator" "Component::Done(Iterator)" test_demangling "gnu: DrawDestinationTransformedImage__FP7_XImageiiT0iiUlUiiiUiUlUlP4_XGCRC13ivTransformeriiii" \ "DrawDestinationTransformedImage\[(\]+_XImage \[*\]+, int, int, _XImage \[*\]+, int, int, unsigned long, unsigned int, int, int, unsigned int, unsigned long, unsigned long, _XGC \[*\]+, (const ivTransformer|ivTransformer const) &, int, int, int, int\[)\]+" test_demangling "gnu: Edit__12StringEditorPCcii" \ "StringEditor::Edit\[(\]+(const char|char const) \[*\]+, int, int\[)\]+" test_demangling_exact "gnu: Effect__11RelateManipR7ivEvent" "RelateManip::Effect(ivEvent &)" test_demangling "gnu: FilterName__FPCc" \ "FilterName\[(\]+(const char|char const) \[*\]+\[)\]+" test_demangling "gnu: Filter__6PSTextPCci" \ "PSText::Filter\[(\]+(const char|char const) \[*\]+, int\[)\]+" test_demangling "gnu: FindColor__7CatalogPCciii" \ "Catalog::FindColor\[(\]+(const char|char const) \[*\]+, int, int, int\[)\]+" test_demangling_exact "gnu: FindFixed__FRP4CNetP4CNet" "FindFixed(CNet *&, CNet *)" test_demangling "gnu: FindFont__7CatalogPCcN21" \ "Catalog::FindFont\[(\]+(const char|char const) \[*\]+, (const char|char const) \[*\]+, (const char|char const) \[*\]+\[)\]+" test_demangling_exact "gnu: Fix48_abort__FR8twolongs" "Fix48_abort(twolongs &)" test_demangling_exact "gnu: GetBarInfo__15iv2_6_VScrollerP13ivPerspectiveRiT2" "iv2_6_VScroller::GetBarInfo(ivPerspective *, int &, int &)" test_demangling_exact "gnu: GetBgColor__C9ivPainter" "ivPainter::GetBgColor(void) const" test_demangling "gnu: Iisdouble__FPC6IntRep" \ "Iisdouble\[(\]+(const IntRep|IntRep const) \[*\]+\[)\]+" test_demangling_exact "gnu: InsertBody__15H_PullrightMenuii" "H_PullrightMenu::InsertBody(int, int)" test_demangling_exact "gnu: InsertCharacter__9TextManipc" "TextManip::InsertCharacter(char)" test_demangling_exact "gnu: InsertToplevel__7ivWorldP12ivInteractorT1" "ivWorld::InsertToplevel(ivInteractor *, ivInteractor *)" test_demangling_exact "gnu: InsertToplevel__7ivWorldP12ivInteractorT1iiUi" "ivWorld::InsertToplevel(ivInteractor *, ivInteractor *, int, int, unsigned int)" test_demangling "gnu: IsADirectory__FPCcR4stat" \ "IsADirectory\[(\]+(const char|char const) \[*\]+, stat &\[)\]+" test_demangling_exact "gnu: IsAGroup__FP11GraphicViewP11GraphicComp" "IsAGroup(GraphicView *, GraphicComp *)" test_demangling_exact "gnu: IsA__10ButtonCodeUl" "ButtonCode::IsA(unsigned long)" test_demangling_exact "gnu: ReadName__FR7istreamPc" "ReadName(istream &, char *)" test_demangling_exact "gnu: Redraw__13StringBrowseriiii" "StringBrowser::Redraw(int, int, int, int)" test_demangling_exact "gnu: Rotate__13ivTransformerf" "ivTransformer::Rotate(float)" test_demangling_exact "gnu: Rotated__C13ivTransformerf" "ivTransformer::Rotated(float) const" test_demangling_exact "gnu: Round__Ff" "Round(float)" test_demangling_exact "gnu: SetExport__16MemberSharedNameUi" "MemberSharedName::SetExport(unsigned int)" test_demangling_exact "gnu: Set__14ivControlState13ControlStatusUi" "ivControlState::Set(ControlStatus, unsigned int)" test_demangling_exact "gnu: Set__5DFacePcii" "DFace::Set(char *, int, int)" test_demangling_exact "gnu: VConvert__9ivTSolverP12ivInteractorRP8TElementT2" "ivTSolver::VConvert(ivInteractor *, TElement *&, TElement *&)" test_demangling_exact "gnu: VConvert__9ivTSolverP7ivTGlueRP8TElement" "ivTSolver::VConvert(ivTGlue *, TElement *&)" test_demangling_exact "gnu: VOrder__9ivTSolverUiRP12ivInteractorT2" "ivTSolver::VOrder(unsigned int, ivInteractor *&, ivInteractor *&)" test_demangling "gnu: Valid__7CatalogPCcRP4Tool" \ "Catalog::Valid\[(\]+(const char|char const) \[*\]+, Tool \[*\]+&\[)\]+" test_demangling_exact "gnu: _10PageButton\$__both" "PageButton::__both" test_demangling_exact "gnu: _3RNG\$singleMantissa" "RNG::singleMantissa" test_demangling_exact "gnu: _5IComp\$_release" "IComp::_release" test_demangling_exact "gnu: _\$_10BitmapComp" "BitmapComp::~BitmapComp(void)" test_demangling_exact "gnu: _\$_9__io_defs" "__io_defs::~__io_defs(void)" test_demangling_exact "gnu: _\$_Q23foo3bar" "foo::bar::~bar(void)" test_demangling_exact "gnu: _\$_Q33foo3bar4bell" "foo::bar::bell::~bell(void)" test_demangling_exact "gnu: __10ivTelltaleiP7ivGlyph" "ivTelltale::ivTelltale(int, ivGlyph *)" test_demangling_exact "gnu: __10ivViewportiP12ivInteractorUi" "ivViewport::ivViewport(int, ivInteractor *, unsigned int)" test_demangling_exact "gnu: __10ostrstream" "ostrstream::ostrstream(void)" test_demangling_exact "gnu: __10ostrstreamPcii" "ostrstream::ostrstream(char *, int, int)" test_demangling "gnu: __11BasicDialogiPCcP13ivButtonStateN22Ui" \ "BasicDialog::BasicDialog\[(\]+int, (const char|char const) \[*\]+, ivButtonState \[*\]+, (const char|char const) \[*\]+, (const char|char const) \[*\]+, unsigned int\[)\]+" test_demangling_exact "gnu: __11BitmapTablei" "BitmapTable::BitmapTable(int)" test_demangling_exact "gnu: __12ViewportCodeP12ViewportComp" "ViewportCode::ViewportCode(ViewportComp *)" test_demangling "gnu: __12iv2_6_BorderiPCci" \ "iv2_6_Border::iv2_6_Border\[(\]+int, (const char|char const) \[*\]+, int\[)\]+" test_demangling_exact "gnu: __12iv2_6_Borderii" "iv2_6_Border::iv2_6_Border(int, int)" test_demangling "gnu: __12ivBackgroundiP7ivGlyphPC7ivColor" \ "ivBackground::ivBackground\[(\]+int, ivGlyph \[*\]+, (const ivColor|ivColor const) \[*\]+\[)\]+"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -