Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Gerhard Gappmeier <gerhard.gappmeier@ascolab.com>
To: gdb-patches@sourceware.org
Subject: Re: New feature "source-id"
Date: Mon, 17 Mar 2014 19:01:00 -0000	[thread overview]
Message-ID: <2739108.yJ4Vgng9gv@ws-gergap> (raw)
In-Reply-To: <CACTLOFqU9nyQqvc43LnGdULMg+WLxhJ-6O+neUT-DPNezqO5uA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2537 bytes --]

On Monday, March 17, 2014 05:25:45 AM you wrote:
> On Mon, Mar 17, 2014 at 1:49 AM, Gerhard Gappmeier
> 
> <gerhard.gappmeier@ascolab.com> wrote:
> > On Sunday, March 16, 2014 09:22:17 AM Doug Evans wrote:
> >> On Sat, Mar 15, 2014 at 7:34 PM, Doug Evans <dje@google.com> wrote:
> >> > Note that one concern I have is that it may be that some sites will
> >> > want to have some of gdb's state updated when source files are
> >> > automagically fetched.  E.g., maybe one would want to update the
> >> > source search path.  Maybe not, but at any rate I don't want this
> >> > feature to preclude doing things like that, and one can't do that if
> >> > the feature works by running an external program via popen.
> >> 
> >> As a data point,
> >> another way to go is to just have a convention for some global
> >> variables in the binary.
> >> With the debug info gdb can access them, and they could contain
> >> everything that would be in the .note section.
> >> 
> >> I don't have a preference, per se.
> >> I just mention it as a possibility, and if one went that route then
> >> doing this in Python/Guile would be while perhaps not required
> >> certainly easy.
> > 
> > That's an interesting idea. When I first read this comment I thought it
> > would require code changes what would not be what I want. But indeed we
> > can simply generate an own 'vcsinfo.c' file which gets compiled and
> > linked with the executable. I think its even simpler to add a new C file
> > than requiring GNU as to generate a new section.
> > 
> > example vcsinfo.c:
> > /* this file was genarated, bla bla, don't modifiy */
> > static const char vcs_type[] = "git";
> > static const char vcs_url[] = "git@github.com:gergap/source-id.git"
> > static const char vcs_version[] =
> > "c2ec66e6a36451ba47422d186fd97311989ef278"
> I think its weird to store this in .rodata instead of somewhere it can
> be easily stripped, especially if you plan on adding the sha1 file
> hashes through this same mechanism, since that is a less constant
> size, though you did mention adding that to the debug info
> specifically.
I agree. That's a good point. I think we should stay with the original idea of 
having a .note section. It is also more consistent with the build-id feature.

Another argument against adding this to the source might be code size. For 
small programs on embedded devices memory matters, so saving these strings 
would be a benefit. The .note section can be stripped and the feature would 
still work with the "separate-debug-info" approach.

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2014-03-17 19:01 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-15 10:49 Gerhard Gappmeier
2014-03-15 17:32 ` Doug Evans
2014-03-15 20:06   ` Eli Zaretskii
2014-03-16  2:34     ` Doug Evans
2014-03-16  9:43       ` Gerhard Gappmeier
2014-03-16 16:22       ` Doug Evans
2014-03-16 16:34         ` Eli Zaretskii
2014-03-17  8:49         ` Gerhard Gappmeier
2014-03-17 12:25           ` Matt Rice
2014-03-17 19:01             ` Gerhard Gappmeier [this message]
2014-03-18  0:25               ` Doug Evans
2014-03-18  0:48                 ` Bruce Dawson
2014-03-18  1:39                   ` Doug Evans
2014-03-18 17:44                     ` Bruce Dawson
2014-03-18 17:57                       ` Doug Evans
2014-03-18 13:22 ` Mark Wielaard
2014-03-18 14:00   ` Gerhard Gappmeier
2014-03-18 15:03     ` Mark Wielaard
2014-03-18 16:40       ` Gerhard Gappmeier
2014-03-18 17:56         ` Bruce Dawson
2014-05-21 19:30           ` Tom Tromey
2014-05-21 20:42             ` Bruce Dawson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2739108.yJ4Vgng9gv@ws-gergap \
    --to=gerhard.gappmeier@ascolab.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox