LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 15854 - lldb is unable to call/print c++ demangled functions in the global namespace
Summary: lldb is unable to call/print c++ demangled functions in the global namespace
Status: RESOLVED FIXED
Alias: None
Product: lldb
Classification: Unclassified
Component: All Bugs (show other bugs)
Version: unspecified
Hardware: PC Linux
: P normal
Assignee: LLDB commit list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-26 14:50 PDT by Matt Kopec
Modified: 2015-09-03 18:32 PDT (History)
2 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Kopec 2013-04-26 14:50:28 PDT
Example program:

static int static_value = 0;

int
a_function_to_call()
{
    static_value++;
    return static_value;
}

int main (int argc, char const *argv[])
{   
    a_function_to_call();
    return 0;
}

Compiling this as a c++ program with -O0 and -g and trying to call or print the function pointer 'a_function_to_call' fails.

Output:

(lldb) b main
(lldb) r
...
(lldb) expression a_function_to_call                                 
error: use of undeclared identifier 'a_function_to_call'
error: 1 errors parsing expression
(lldb) expression a_function_to_call()
error: use of undeclared identifier 'a_function_to_call'
error: 1 errors parsing expression
Comment 1 Matt Kopec 2013-05-10 17:00:06 PDT
Committed a temporary workaround in r181613 that fixes the issue. It also fixed the same problem for anonymous namespace functions.
Comment 2 emaste 2013-09-09 13:01:05 PDT
This issue also affects FreeBSD.  The temporary workaround in r181613 has been extended to apply to FreeBSD as well (r190319)
Comment 3 Siva Chandra 2015-09-03 18:32:18 PDT
Unable to reproduce. Marking it as RESOLVED.