Map file specification?

Create a debugger tool. I need a MAP file structure specification for the GCC compiler. To find a way to display memory for different variables of different data types (class, inner class, static, static const, extern, template, typedef Variables Specification in the MAP file). And also I want to know how characters are added to another variable in order to distinguish in a MAP file. Tell me how to move on.

+3
source share
1 answer

Do not think that you need to understand the detailed format of the MAP file, -Wl and -print-map should be enough to get readable textual map data from the compiler.

$ cat x.c | grep alpha
int alpha = one;
  int c = do_operation(alpha, b);
  printf( "%d op %d = %d\n", alpha, b, c);

$ g++ -Wl,--print-map ./x.c  | grep -P "(alpha|printf)"
                0x00000000080483f0                printf@@GLIBC_2.0
                0x000000000804a018                alpha

, x.c "alpha", "printf". , , -print-map paramater

, .

0

Source: https://habr.com/ru/post/1749367/


All Articles