public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: Doug Evans <xdje42@gmail.com>,
	       "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: time to workaround libc/13097 in fsf gdb?
Date: Tue, 23 Sep 2014 11:49:00 -0000	[thread overview]
Message-ID: <54215E55.5000408@redhat.com> (raw)
In-Reply-To: <20140922183505.GA21660@host2.jankratochvil.net>

On 09/22/2014 07:35 PM, Jan Kratochvil wrote:
> On Sun, 21 Sep 2014 21:12:17 +0200, Pedro Alves wrote:
>> Is it really a pain though?
> 
> 95 lines of gdbarch.* patch + its ChangeLog is really a pain compared to 1 line of C++ virtual override.

That is a different complain from the original "That's the
pain of solib-svr4.c which is OS-agnostic and so it cannot find out start
of the ELF file just from link map.  gdbserver can find it as it can
depend on /proc/PID/{s,}maps as its linux-low.c is Linux-specific."

But still, well, that's a bogus comparison and you know that.  You wouldn't
get very far with just a 1 line...   Even if GDB was written in C++, I'd
probably still want to hook this through the gdbarch object, as it's
a lower level thing than target_so_ops, which is consumed by
add_vsyscall_table too.  Most of those 95 lines include generated
boilerplace that you'd need in C++ too.  You'd need to count debug
dump code, validation code, and the new entry point in the base object,
and both the declaration and the definition of the override in the
new class.

It's actually quite possible to add a linux-specific target_so_ops that
inherits svr4_so_ops, and we even do that for a few targets/archs).
That's very much like the C++ virtual override, but even if we did
that, istm we'd still make the new "class" use the new gdbarch method in
its current_sos() method.  I didn't do that as it doesn't seem worth it
to add a new class for this, given that the gdbarch method returns false
on the exact same set of targets that wouldn't use the new class, and
then again, at some point, we may actually want to move the filtering
of the vdso out close to where we already filter out a dso whose name
is the same as of the executable, assuming it's the vdso.

Yes, I know that C++ makes writing some of these things easier.
No need to keep repeating it to me.  The thing is that most of
the design issues here are orthogonal to the C/C++ axis.  And that
shouldn't surprise, exactly because GDB is written in what some would
call poor-man's C++-in-C style.

Thanks,
Pedro Alves

  reply	other threads:[~2014-09-23 11:49 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-11 16:25 Doug Evans
2014-09-11 16:37 ` Pedro Alves
2014-09-12 11:55   ` Jan Kratochvil
2014-09-12 12:14     ` Pedro Alves
2014-09-12 12:33       ` Jan Kratochvil
2014-09-12 12:46         ` Pedro Alves
2014-09-17 20:10           ` Jan Kratochvil
2014-09-19 14:38             ` Pedro Alves
2014-09-19 14:41               ` Pedro Alves
2014-09-20 21:30                 ` Jan Kratochvil
2014-09-21 19:12                   ` Pedro Alves
2014-09-21 19:46                     ` Pedro Alves
2014-09-23 23:05                       ` Doug Evans
2014-09-26 12:09                         ` Pedro Alves
2014-09-22 18:35                     ` Jan Kratochvil
2014-09-23 11:49                       ` Pedro Alves [this message]
2014-09-28 13:41                         ` Jan Kratochvil
2014-09-29 10:36                           ` Pedro Alves
2014-10-03 13:09                             ` Gary Benson
2014-10-07 23:16                             ` Doug Evans
2014-09-23 12:05                       ` Pedro Alves
2014-09-26 12:05                       ` Pedro Alves
2014-09-23 10:59                     ` automated testing comment [Re: time to workaround libc/13097 in fsf gdb?] Jan Kratochvil
2014-09-23 12:32                       ` Pedro Alves
2014-09-23 12:45                         ` Jan Kratochvil
2014-09-23 13:30                           ` Pedro Alves
2014-09-23 13:57                             ` Jan Kratochvil
2014-09-23 14:48                               ` Pedro Alves
2014-09-23 15:53                                 ` Jan Kratochvil
2014-09-23 15:56                                   ` Pedro Alves
2014-09-24 13:22                                 ` Andreas Arnez
2014-09-24 15:23                                   ` Ulrich Weigand
2014-09-25  7:11                                     ` Andreas Arnez
2014-09-25  8:20                                     ` Pedro Alves
2014-09-25 10:52                                       ` Jan Kratochvil
2014-09-23 14:54                           ` Doug Evans
2014-09-23 15:16                         ` Simon Marchi
2014-09-23 14:48                       ` Doug Evans
2014-09-23 14:59                         ` Pedro Alves
2014-09-20 19:50               ` time to workaround libc/13097 in fsf gdb? Jan Kratochvil
2014-09-23 11:18                 ` Pedro Alves
2014-09-23 13:16                   ` Gary Benson
2014-10-09 20:09                   ` Jan Kratochvil
2014-10-09 22:07                     ` Pedro Alves
2014-09-13  1:06       ` Doug Evans
2014-09-17 20:13         ` Jan Kratochvil
2014-09-23 21:35         ` Doug Evans

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=54215E55.5000408@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    --cc=xdje42@gmail.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).