Questions tagged [symbol-table]

A `symbol table` is a data structure that maps each identifier in a program's source code to information relating to its declaration or appearance in the source.

A symbol table is used by a language translator (compiler, interpreter...) for associating each identifier in a program's source code with information relating to its declaration or appearance in the source (type, scope level, sometimes location...).

A common implementation technique is to use a hash table implementation. A compiler may use one large symbol table for all symbols or use separated, hierarchical symbol tables for different scopes.

187 questions
7
votes
2 answers

Print the symbol table of an ELF file

I have a program which uses the mmap system call: map_start = mmap(0, fd_stat.st_size, PROT_READ | PROT_WRITE , MAP_SHARED, fd, 0) and a header variable: header = (Elf32_Ehdr *) map_start; How can I access the symbol table and print its whole…
kitsuneFox
  • 1,093
  • 3
  • 14
  • 30
7
votes
2 answers

gdb no symbol table loaded for core file

There was a core dump produced at the customer end for my application and while looking at the backtrace I don't have the symbols loaded... (gdb) where #0 0x000000364c032885 in ?? () #1 0x000000364c034065 in ?? () #2 0x0000000000000000 in ??…
S Raju
  • 71
  • 1
  • 1
  • 2
6
votes
2 answers

Get a symbol's value by its name in a sub

I'm making a package, where I have to get a symbol's value by its name in a sub, while the symbol is defined outside the sub. Here is the simplified code, it works as expected: #! /usr/bin/env perl6 sub dump_value($symbol) { say…
lovetomato
  • 861
  • 3
  • 11
6
votes
3 answers

Does Symbol table for C++ code contain function names along with class names?

I have been searching through various posts regarding whether symbol table for a C++ code contains functions' name along with the class name. Something which i could find on a post is that it depends on the type of compiler, if it compiles code in…
6
votes
1 answer

Debugging with GDB Cannot Lookup D Program symbols

I have successfully built and installed Ian Buclaw's (ibuclaw) GDB branch on github on my Ubuntu 13.10 x86_64 with its default compiler GCC 4.8.1. I had to remove the file ld from the bin sub-directory otherwise DMD complains about a sysroot thing…
Nordlöw
  • 11,017
  • 6
  • 50
  • 92
6
votes
5 answers

Is it possible to determine if a symbol is a variable or function in C?

I am implementing some limited remote debugging functionality for an application written in C running on a Linux box. The goal is to communicate with the application and lookup the value of an arbitrary variable or run an arbitrary function. I am…
dykeag
  • 554
  • 2
  • 9
6
votes
2 answers

What does (.eh) mean in nm output?

When I look at the symbols in my library, nm mylib.a, I see some duplicate entries that look like this: 000000000002d130 S __ZN7quadmat11SpAddLeavesC1EPNS_14BlockContainerEPy 00000000000628a8 S…
Adam
  • 15,548
  • 4
  • 47
  • 89
6
votes
4 answers

What is the internal identification of a Java method?

As we know, in Java, method name is not sufficient to distinguish different methods. I think (may be wrong), to distinguish a method, it needs the following info: (className, methodName, methodParameters) Further, how to identify a method more…
JackWM
  • 8,835
  • 18
  • 58
  • 90
5
votes
1 answer

How to rename perl __ANON__ sub without disabling strict 'refs'?

I found a solution to renaming anonymous subs in Perl here. It involves temporarily mangling the symbol table to insert the desired name. This solution uses a hard-coded symbol table name to be replaced. My problem is that I would like to…
5
votes
1 answer

A Symbol Table in C

I am currently developing a kind of static analysis tool that performs pattern matching. I am using Flex to generate lexical analyzer, and I wrote code to manage the symbol table. I am not very experienced with C, so I decided to implement the…
Melvin Smiley
  • 99
  • 2
  • 8
5
votes
1 answer

Does a Symbol Table store AST (Declaration)Nodes or are the "Symbols" different objects/classes?

I have a few things about the AST / Symbol Table relation that i don't understand. I currently have a AST implemented in C# which has nodes for variable declarations (these contain informations about the name, type, source position, a possible…
5
votes
0 answers

Eclipse complains "No symbol table is loaded" while elf file contains debug info

I am working on an STM32 processor. Using readelf -w, tons of debug information could be extracted from my elf file. A short piece of the output is shown below: <1><3faf>: Abbrev Number: 30 (DW_TAG_variable) <3fb0> DW_AT_name :…
Chris Xia
  • 51
  • 2
4
votes
1 answer

GDB Objective-c debugging (no symbol table)

I have an executable and I am debugging it using gdb. This is my first time using gdb so bear with me please. I want to set a breakpoint at a function and I know the name of the function using class dump. Now it won't let me add breakpoint to that…
user635064
  • 6,059
  • 12
  • 52
  • 98
4
votes
0 answers

Symbol Resolution and Dynamic Linking

I have been reading about the relocation and symbol resolution process and I have a few questions on the same. So the whole process(of loading the exec) starts with exec(BA_OS) command. During exec(BA_OS), the system retrieves a path name from the…
nitin
  • 902
  • 1
  • 13
  • 31
4
votes
1 answer

lex and yacc (symbol table generation)

I am new to lex and yacc and compiler design. I would like to know at which phase(lexical, syntactical or any other phase) and how the symbol table is generated? Can I have a brief description of y.output file which is generated by giving -v option…
Tech Freak
  • 43
  • 1
  • 3
1
2
3
12 13