This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RE: New feature "source-id"
- From: Bruce Dawson <bruced at valvesoftware dot com>
- To: 'Doug Evans' <dje at google dot com>
- Cc: Gerhard Gappmeier <gerhard dot gappmeier at ascolab dot com>, gdb-patches <gdb-patches at sourceware dot org>
- Date: Tue, 18 Mar 2014 17:44:34 +0000
- Subject: RE: New feature "source-id"
- Authentication-results: sourceware.org; auth=none
- References: <7365721 dot BnaR1nHazz at lt-gergap> <10414444 dot 6eOdp1cvY6 at ws-gergap> <CACTLOFqU9nyQqvc43LnGdULMg+WLxhJ-6O+neUT-DPNezqO5uA at mail dot gmail dot com> <2739108 dot yJ4Vgng9gv at ws-gergap> <CADPb22ShBWC=VSSiyWzNcb++tZwCKaNidKqb74gbmNn3W839sQ at mail dot gmail dot com> <2AC155A009400B4C8B05D518E4819AEF1A347889 at exchange10 dot valvesoftware dot com> <CADPb22QJ7bQdn+0hHYLw_f-wkTOzjFykBHuHRf9DKOrPDu1OrA at mail dot gmail dot com>
I better understand what you are doing now with the .c file now. Previously I had assumed that you would be compiling it and then linking the .o file along with all of the others.
Now I am confused about *why* you are compiling it. If you have a text file that has the source information then why not just add it as a custom section directly? What is the value in compiling it into a .o file first?
> I can imagine generating a .c file (say, could even be .S) from the post-link binary that contains source information
Don't forget that this text file is generated from both the source files listed in the post-link binary *and* from the version control information for these files.
-----Original Message-----
From: Doug Evans [mailto:dje@google.com]
Sent: Monday, March 17, 2014 6:39 PM
To: Bruce Dawson
Cc: Gerhard Gappmeier; gdb-patches
Subject: Re: New feature "source-id"
...
I can imagine generating a .c file (say, could even be .S) from the post-link binary that contains source information, compile it, and then using objcopy to add the resultant section with the source information into the resultant binary. The key here being that source file information gets put in a specific section so it's easy to do this. If one is splitting the debug information into a separate file, one could objcopy --add-section the source-file-section there instead.
There's no real "relinking" here. I don't see the difference with what you're doing now.
...