No, that is not expected to work.  "target modules lookup" only looks up 
globally visible symbols and functions.  argc is a function argument, and not 
the sort of thing "target modules lookup" looks for.  If it did look for 
arguments (and locals???) it would be really really slow and probably produce 
way more output than you want.

Jim
On Jul 10, 2013, at 10:56 AM, Michael Sartain <[email protected]> wrote:

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

_______________________________________________
lldb-dev mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev

Reply via email to