-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libdwarf is slow -- use libdw instead #12
Comments
To remove the dependency on libdwarf entirely, while still generating header files as at present, a cute trick would be to bootstrap the header file generation using libdw itself. From the DWARF info of libdw, we can get at its enum definitions in a structured way, e.g. by dwarfdumping it and lightly sedding the output. |
I have done some work on the use-libdw branch, although it does not work yet. Note also that that branch replaces libdwarf with libdw, but in hindsight it should be a configure-time choice. I will go back and parameterise that once the main body of the work is done. |
I've resumed work on this and hopefully will actually get it working soon. |
Reading DIEs through libdwarf is a bit of a performance bottleneck, because it does memory allocation very frequently.
It would be better to use libdw (from elfutils), which more sensibly just memory-maps the file and issues DIEs as pointers/offsets into it. To do so, some cleanup is necessary to remove the last vestiges of libdwarf-specific code.
(Note that we still expect to depend on libdwarf's libdwarf.h -- it has a nice structure where the DW_* constants are #define'd, each on one line. This is used for generating specialised header files that omit certain vendor extensions. The dwarf.h in libdw uses enums, which are much less convenient for this. Of course the definitions are equivalent, so we can include libdw's dwarf.h internally from our code, but use libdwarf's for our generation purposes.)
The text was updated successfully, but these errors were encountered: