glibc function to retrieve current executable name?
问题 i'm wondering if there is a glibc function that i can use from gcc/g++ that will retrieve the current executable. The purpose of this is to provide the -e argument to addr2line as shown in this answer 回答1: In standard C and glibc, you have argv[0]: int main (int argc, char *argv[]) the first element of the argv array is the program name. However it's not necessarily enough on its own to determine where exactly the executable is. The argument is actually set by the program that ran your