<div dir="ltr">Is this supposed to work?<div><br></div><div><div>(lldb) target modules lookup -Av -s argc</div><div><br></div><div>It does nothing. Looking up the address of argc and using it also does nothing.</div><div><br>
</div><div>(lldb) p &argc<br></div><div>(int *) $3 = 0x00007fff506c9458<br></div><div>(lldb) target modules lookup -Av -a 0x00007fff506c9458</div><div><br></div><div>It does work with the function "main":</div>
<div><br></div><div>(lldb) target modules lookup -Av -F main</div><div>1 match found in /home/mikesart/data/src/blah/build/blah:</div><div> Address: blah[0x0000000000409970] (blah..text + 368)</div><div> Summary: blah`main at blah.cpp:160</div>
<div> Module: file = "/home/mikesart/data/src/blah/build/blah", arch = "x86_64"</div><div> CompileUnit: id = {0x00000000}, file = "/home/mikesart/data/src/blah/blah.cpp", language = "ISO C++:1998"</div>
<div> Function: id = {0x000003c9}, name = "main", range = [0x0000000000409970-0x000000000040a275)</div><div> FuncType: id = {0x000003c9}, decl = blah.cpp:159, clang_type = "int (int, char **)"</div>
<div> Blocks: id = {0x000003c9}, range = [0x00409970-0x0040a275)</div><div> LineEntry: [0x0000000000409970-0x0000000000409991): /home/mikesart/data/src/blah/blah.cpp:160</div><div> Symbol: id = {0x00000076}, range = [0x0000000000409970-0x000000000040a275), name="main"</div>
<div> Variable: id = {0x000003e6}, name = "argc", type= "int", location = DW_OP_fbreg(-8), decl = blah.cpp:159</div><div> Variable: id = {0x000003f4}, name = "argv", type= "char **", location = DW_OP_fbreg(-16), decl = blah.cpp:159</div>
<div> Variable: id = {0x00000402}, name = "msg", type= "Person", location = DW_OP_fbreg(-248), decl = blah.cpp:297</div><div><br></div><div>As does using the address for "main".</div><div>
<br></div><div>(lldb) p main</div><div>(int (*)(int, char **)) $4 = 0x0000000000409970 (blah`main at blah.cpp:160)<br></div><div>(lldb) target modules lookup -Av -a 0x0000000000409970</div><div> Address: blah[0x0000000000409970] (blah..text + 368)</div>
<div> Summary: blah`main at blah.cpp:160</div><div> Module: file = "/home/mikesart/data/src/blah/build/blah", arch = "x86_64"</div><div> CompileUnit: id = {0x00000000}, file = "/home/mikesart/data/src/blah/blah.cpp", language = "ISO C++:1998"</div>
<div> Function: id = {0x000003c9}, name = "main", range = [0x0000000000409970-0x000000000040a275)</div><div> FuncType: id = {0x000003c9}, decl = blah.cpp:159, clang_type = "int (int, char **)"</div>
<div> Blocks: id = {0x000003c9}, range = [0x00409970-0x0040a275)</div><div> LineEntry: [0x0000000000409970-0x0000000000409991): /home/mikesart/data/src/blah/blah.cpp:160</div><div> Symbol: id = {0x00000076}, range = [0x0000000000409970-0x000000000040a275), name="main"</div>
<div> Variable: id = {0x000003e6}, name = "argc", type= "int", location = DW_OP_fbreg(-8), decl = blah.cpp:159</div><div> Variable: id = {0x000003f4}, name = "argv", type= "char **", location = DW_OP_fbreg(-16), decl = blah.cpp:159</div>
<div> Variable: id = {0x00000402}, name = "msg", type= "Person", location = DW_OP_fbreg(-248), decl = blah.cpp:297</div></div><div><br></div></div>