gdb/python: allow to instantiate gdb.LineTableEntry objects
This commit allows users to instantiate gdb.LineTableEntry objects. This
feature will be used later to allow Python code to build and set a symtab
linetable.
gdb: use std::vector<> to hold on blocks in struct blockvector
This commit changes internal implementation of struct blockvector to use
std::vector<> rather than flexible array.
The main motivation for this change is to simplify adding blocks to
existing symtab. This feature will be used later by Python API to build
objfiles and symtabs dynamically (similarly to JIT reader API).
To do so, this commit
1. introduces obstack_allocator, an implementation of Allocator
concept that allocates memory on obstack.
2. uses std::vector<> with the above allocator to hold on blocks
3. updates users.
As a side-effect of this change, blockvectors allocated in mdebugread.c
are obstack-allocated rather than xzalloc()ated which seems to be the
correct thing to do. Also, code got simpler.
The downside might be higher memory consumption. The memory overhead
of std::vector should be small enough not to be of a concern. More
concerning is fact then one may leak obstack memory when excessively
adding blocks. However, blockvectors are not added blocks after initial
allocation at the moment (except in mdebugread.c) so this is not a
problem for existing code.