This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

p 'CV::m(int)' vs p CV::m(int)


Hi,
I just notice that p 'CV::m(int)' is different p CV::m(int), (with and
without single quote).  Where do we document p 'CV::m(int)'?  I see
https://sourceware.org/gdb/onlinedocs/gdb/Variables.html
but it is about using single quote before "::".   However, the usage
like 'CV::m(int)' isn't documented there.

‘scope1::scope2::name’ is mentioned in
https://sourceware.org/gdb/onlinedocs/gdb/C-Plus-Plus-Expressions.html,
but it is about ::, not about the single quote usage.

I set debug expression 1, and it shows me more,

(gdb) p 'CV::m(int)'
Dump of expression @ 0x60b00005cd40, before conversion to prefix form:
Language c++, 4 elements, 16 bytes each.
Index                Opcode         Hex Value  String Value
   0          OP_VAR_VALUE  40  (...............
   1     <unknown 4164576>  107820863163360  ..?..b..........
   2     <unknown 3897520>  107820862896304  .x;..b..........
   3          OP_VAR_VALUE  40  (...............
Dump of expression @ 0x60b00005cd40, after conversion to prefix form:
Expression: `CV::m(int)'
Language c++, 4 elements, 16 bytes each.


   0  OP_VAR_VALUE          Block @0x6210003f8be0, symbol
@0x6210003b78b0 (CV::m(int))

(gdb) p CV::m(int)
Dump of expression @ 0x6110002177c0, before conversion to prefix form:
Language c++, 11 elements, 16 bytes each.
Index                Opcode         Hex Value  String Value
   0              OP_SCOPE  86  V...............
   1     <unknown 3743424>  107820862742208  ..9..b..........
   2             BINOP_ADD  1  ................
   3  <unknown -1094844307>  -4702111234475032467  m...............
   4             BINOP_ADD  1  ................
   5              OP_SCOPE  86  V...............
   6         TYPE_INSTANCE  29  ................
   7             BINOP_ADD  1  ................
   8     <unknown 4384096>  107820863382880  `.B..b..........
   9             BINOP_ADD  1  ................
  10         TYPE_INSTANCE  29  ................
Dump of expression @ 0x6110002177c0, after conversion to prefix form:
Expression: `TypesInstance(int,CV::m)'
Language c++, 11 elements, 16 bytes each.


   0  TYPE_INSTANCE         1 TypeInstance: Type @0x62100042e560 (int)
   5    OP_SCOPE              Type @0x621000391ec0 (CV) Field name: `m'

-- 
Yao (齐尧)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]