大家都知道,在GDB下,用p可以查看变量的值, 如可以查看一个字符串。但大家应该注意到,查看字符串的时候默认显示是截断的,
(gdb) p strCase
$2 = {static npos = 18446744073709551615,
_M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>},
_M_p = 0x680328 "<?xml version=\"1.0\"?>\n<req action=\"get\" msg=\"1\" rank=\"1\" rnklst=\"1\" runuf=\"0\" status=\"1\" subtype=\"investmentlist\" type=\"60\" univ=\"IL\" version=\"AWD3.12.000.00\" lang=\"ENU\" chunklimit=\"1000\" Times=\"1\">\n "...}}
我们可以通过以下命令查看完整的字符串,
(gdb)set print element 0
(gdb) p strCase
$4 = {static npos = 18446744073709551615,
_M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>},
_M_p = 0x680328 "<?xml version=\"1.0\"?>\n<req action=\"get\" msg=\"1\" rank=\"1\" rnklst=\"1\" runuf=\"0\" status=\"1\" subtype=\"investmentlist\" type=\"60\" univ=\"IL\" version=\"AWD3.12.000.00\" lang=\"ENU\" chunklimit=\"1000\" Times=\"1\">\n <flds>\n <f i=\"YOS05M\" sid=\"OS05M\"/>\n <f i=\"AA03K\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"AA03K\" start=\"06/30/2012\"/>\n <f i=\"AA03L\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"AA03L\" start=\"06/30/2012\"/>\n <f i=\"AA03M\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"AA03M\" start=\"06/30/2012\"/>\n <f i=\"AA03N\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"AA03N\" start=\"06/30/2012\"/>\n <f i=\"AA03O\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"AA03O\" start=\"06/30/2012\"/>\n <f i=\"AA03P\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"AA03P\" start=\"06/30/2012\"/>\n <f i=\"AA03Q\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"AA03Q\" start=\"06/30/2012\"/>\n <f i=\"AA03R\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"AA03R\" start=\"06/30/2012\"/>\n <f i=\"AA03S\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"AA03S\" start=\"06/30/2012\"/>\n <f i=\"AA03T\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"AA03T\" start=\"06/30/2012\"/>\n <f i=\"AA03U\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"AA03U\" start=\"06/30/2012\"/>\n <f i=\"AA03W\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"AA03W\" start=\"06/30/2012\"/>\n <f i=\"AA06P\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"AA06P\" start=\"06/30/2012\"/>\n <f i=\"AA06Q\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"AA06Q\" start=\"06/30/2012\"/>\n <f i=\"HS002\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS002\" start=\"06/30/2012\"/>\n <f i=\"HS003\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS003\" start=\"06/30/2012\"/>\n <f i=\"HS004\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS004\" start=\"06/30/2012\"/>\n <f i=\"HS00C\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS00C\" start=\"06/30/2012\"/>\n <f i=\"HS00E\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS00E\" start=\"06/30/2012\"/>\n <f i=\"HS00F\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS00F\" start=\"06/30/2012\"/>\n <f i=\"HS00G\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS00G\" start=\"06/30/2012\"/>\n <f i=\"HS00H\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS00H\" start=\"06/30/2012\"/>\n <f i=\"HS02A\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS02A\" start=\"06/30/2012\"/>\n <f i=\"HS02F\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS02F\" start=\"06/30/2012\"/>\n <f i=\"HS02N\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS02N\" start=\"06/30/2012\"/>\n <f i=\"HS03W\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS03W\" start=\"06/30/2012\"/>\n <f i=\"HS05B\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS05B\" start=\"06/30/2012\"/>\n <f i=\"HS05D\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS05D\" start=\"06/30/2012\"/>\n <f i=\"HS05E\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS05E\" start=\"06/30/2012\"/>\n <f i=\"HS05U\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS05U\" start=\"06/30/2012\"/>\n <f i=\"HS05V\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS05V\" start=\"06/30/2012\"/>\n <f i=\"HS05W\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS05W\" start=\"06/30/2012\"/>\n <f i=\"HS05X\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS05X\" start=\"06/30/2012\"/>\n <f i=\"HS06D\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS06D\" start=\"06/30/2012\"/>\n <f i=\"HS06E\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS06E\" start=\"06/30/2012\"/>\n <f i=\"HS06F\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS06F\" start=\"06/30/2012\"/>\n <f i=\"HS06G\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS06G\" start=\"06/30/2012\"/>\n <f i=\"HS06H\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS06H\" start=\"06/30/2012\"/>\n <f i=\"HS06I\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS06I\" start=\"06/30/2012\"/>\n <f i=\"HS06J\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS06J\" start=\"06/30/2012\"/>\n <f i=\"HS06K\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS06K\" start=\"06/30/2012\"/>\n <f i=\"HS06L\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS06L\" start=\"06/30/2012\"/>\n <f i=\"HS06M\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS06M\" start=\"06/30/2012\"/>\n <f i=\"HS06N\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS06N\" start=\"06/30/2012\"/>\n <f i=\"HS06U\" cur=\"BASE\" end=\"12/31/2011\" freq=\"m\" sid=\"HS06U\" start=\"12/31/2011\"/>\n <f i=\"HS06U_PRE\" cur=\"BASE\" end=\"12/31/2010\" freq=\"m\" sid=\"HS06U\" start=\"12/31/2010\"/>\n <f i=\"HS06X\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS06X\" start=\"06/30/2012\"/>\n <f i=\"HS06Y\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS06Y\" start=\"06/30/2012\"/>\n <f i=\"HS076\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS076\" start=\"06/30/2012\"/>\n <f i=\"HS077\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS077\" start=\"06/30/2012\"/>\n <f i=\"HS078\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS078\" start=\"06/30/2012\"/>\n <f i=\"HS079\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS079\" start=\"06/30/2012\"/>\n <f i=\"HS07A\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS07A\" start=\"06/30/2012\"/>\n <f i=\"HS07B\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS07B\" start=\"06/30/2012\"/>\n <f i=\"HS07C\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS07C\" start=\"06/30/2012\"/>\n <f i=\"HS07D\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS07D\" start=\"06/30/2012\"/>\n <f i=\"HS07E\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS07E\" start=\"06/30/2012\"/>\n <f i=\"HS08D\" cur=\"BASE\" end=\"12/31/2011\" freq=\"m\" sid=\"HS08D\" start=\"12/31/2011\"/>\n <f i=\"HS08D_PRE\" cur=\"BASE\" end=\"12/31/2010\" freq=\"m\" sid=\"HS08D\" start=\"12/31/2010\"/>\n <f i=\"HS08E\" cur=\"BASE\" end=\"12/31/2011\" freq=\"m\" sid=\"HS08E\" start=\"12/31/2011\"/>\n <f i=\"HS08E_PRE\" cur=\"BASE\" end=\"12/31/2010\" freq=\"m\" sid=\"HS08E\" start=\"12/31/2010\"/>\n <f i=\"HS08F\" cur=\"BASE\" end=\"12/31/2011\" freq=\"m\" sid=\"HS08F\" start=\"12/31/2011\"/>\n <f i=\"HS08F_PRE\" cur=\"BASE\" end=\"12/31/2010\" freq=\"m\" sid=\"HS08F\" start=\"12/31/2010\"/>\n <f i=\"HS11A\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS11A\" start=\"06/30/2012\"/>\n <f i=\"HS11B\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS11B\" start=\"06/30/2012\"/>\n <f i=\"HS11D\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS11D\" start=\"06/30/2012\"/>\n <f i=\"HS11E\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS11E\" start=\"06/30/2012\"/>\n <f i=\"HS11F\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS11F\" start=\"06/30/2012\"/>\n <f i=\"HS11I\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS11I\" start=\"06/30/2012\"/>\n <f i=\"HS11J\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS11J\" start=\"06/30/2012\"/>\n <f i=\"HS11L\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS11L\" start=\"06/30/2012\"/>\n <f i=\"HS11M\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS11M\" start=\"06/30/2012\"/>\n <f i=\"HS11N\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS11N\" start=\"06/30/2012\"/>\n <f i=\"HS11Q\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS11Q\" start=\"06/30/2012\"/>\n <f i=\"HS11R\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS11R\" start=\"06/30/2012\"/>\n <f i=\"HS11T\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS11T\" start=\"06/30/2012\"/>\n <f i=\"HS11U\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS11U\" start=\"06/30/2012\"/>\n <f i=\"HS11V\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS11V\" start=\"06/30/2012\"/>\n <f i=\"HS11Y\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS11Y\" start=\"06/30/2012\"/>\n <f i=\"HS185\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS185\" start=\"06/30/2012\"/>\n <f i=\"HS186\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS186\" start=\"06/30/2012\"/>\n <f i=\"HS187\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS187\" start=\"06/30/2012\"/>\n <f i=\"HS188\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS188\" start=\"06/30/2012\"/>\n <f i=\"HS189\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS189\" start=\"06/30/2012\"/>\n <f i=\"HS190\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS190\" start=\"06/30/2012\"/>\n <f i=\"HS191\" cur=\"BASE\" end=\"06/30/2012\" freq=\"m\" sid=\"HS191\" start=\"06/30/2012\"/>\n <f i=\"HS192\" cur=\"BASE\" end=---Type <return> to continue, or q <return> to quit---