Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* GDB transition to GPLv3 should now be complete
@ 2007-08-24 15:08 Joel Brobecker
  2007-08-24 15:28 ` Mark Kettenis
  0 siblings, 1 reply; 10+ messages in thread
From: Joel Brobecker @ 2007-08-24 15:08 UTC (permalink / raw)
  To: gdb

GDB is now licensed under the terms of GPLv3.

There is one issue identified left before the release: printing of
signed and unsigned characters and strings. I found the patch
submission, but it looks like it never went in (for lack of agreement
on it?).

I would like to give a week to any dust that might have been created by
the switch to GPLv3 to settle. Let's take a decision about the issue
above (either fix, defer, or leave as is). I'm targetting a branch
creation date around Aug 31st (I'm actually flying again the next day,
so the actual creation might happen a few days after).

-- 
Joel


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: GDB transition to GPLv3 should now be complete
  2007-08-24 15:08 GDB transition to GPLv3 should now be complete Joel Brobecker
@ 2007-08-24 15:28 ` Mark Kettenis
  2007-08-24 15:33   ` Daniel Jacobowitz
  0 siblings, 1 reply; 10+ messages in thread
From: Mark Kettenis @ 2007-08-24 15:28 UTC (permalink / raw)
  To: brobecker; +Cc: gdb

> Date: Fri, 24 Aug 2007 11:12:51 -0400
> From: Joel Brobecker <brobecker@adacore.com>
> 
> GDB is now licensed under the terms of GPLv3.
> 
> There is one issue identified left before the release: printing of
> signed and unsigned characters and strings. I found the patch
> submission, but it looks like it never went in (for lack of agreement
> on it?).

Yes, and I think the only reasonable thing to do in this case is to
stick with historical behaviour.

> I would like to give a week to any dust that might have been created by
> the switch to GPLv3 to settle. Let's take a decision about the issue
> above (either fix, defer, or leave as is). I'm targetting a branch
> creation date around Aug 31st (I'm actually flying again the next day,
> so the actual creation might happen a few days after).

Good!  I'll try to give it a spin on several of my OpenBSD boxes.
Hopefully people will be a bit conservative with checking stuff in
before the branch is created.

Mark


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: GDB transition to GPLv3 should now be complete
  2007-08-24 15:28 ` Mark Kettenis
@ 2007-08-24 15:33   ` Daniel Jacobowitz
  2007-08-24 16:16     ` Mark Kettenis
  0 siblings, 1 reply; 10+ messages in thread
From: Daniel Jacobowitz @ 2007-08-24 15:33 UTC (permalink / raw)
  To: gdb

On Fri, Aug 24, 2007 at 05:28:42PM +0200, Mark Kettenis wrote:
> > Date: Fri, 24 Aug 2007 11:12:51 -0400
> > From: Joel Brobecker <brobecker@adacore.com>
> > 
> > GDB is now licensed under the terms of GPLv3.
> > 
> > There is one issue identified left before the release: printing of
> > signed and unsigned characters and strings. I found the patch
> > submission, but it looks like it never went in (for lack of agreement
> > on it?).
> 
> Yes, and I think the only reasonable thing to do in this case is to
> stick with historical behaviour.

I posted a patch for what I believe is a better reasonable choice, on
July 5th.  If you don't think it is acceptable, could you respond to
it, please?

  http://sourceware.org/ml/gdb-patches/2007-07/msg00101.html

-- 
Daniel Jacobowitz
CodeSourcery


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: GDB transition to GPLv3 should now be complete
  2007-08-24 15:33   ` Daniel Jacobowitz
@ 2007-08-24 16:16     ` Mark Kettenis
  2007-08-24 16:54       ` Daniel Jacobowitz
  0 siblings, 1 reply; 10+ messages in thread
From: Mark Kettenis @ 2007-08-24 16:16 UTC (permalink / raw)
  To: drow; +Cc: gdb

> Date: Fri, 24 Aug 2007 11:33:33 -0400
> From: Daniel Jacobowitz <drow@false.org>
> 
> On Fri, Aug 24, 2007 at 05:28:42PM +0200, Mark Kettenis wrote:
> > > Date: Fri, 24 Aug 2007 11:12:51 -0400
> > > From: Joel Brobecker <brobecker@adacore.com>
> > > 
> > > GDB is now licensed under the terms of GPLv3.
> > > 
> > > There is one issue identified left before the release: printing of
> > > signed and unsigned characters and strings. I found the patch
> > > submission, but it looks like it never went in (for lack of agreement
> > > on it?).
> > 
> > Yes, and I think the only reasonable thing to do in this case is to
> > stick with historical behaviour.
> 
> I posted a patch for what I believe is a better reasonable choice, on
> July 5th.  If you don't think it is acceptable, could you respond to
> it, please?
> 
>   http://sourceware.org/ml/gdb-patches/2007-07/msg00101.html

I thought I did.  Anyway, the arguments have been given before:

1. There is quite a bit of code that uses "unsigned char *" for
   strings, to avoid unwanted sign extension.

2. Not all debug formats (most notably stabs) do not make the
   distinction between unqualified "char" and "(un)signed char".

Mark


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: GDB transition to GPLv3 should now be complete
  2007-08-24 16:16     ` Mark Kettenis
@ 2007-08-24 16:54       ` Daniel Jacobowitz
  2007-08-24 18:11         ` Mark Kettenis
  0 siblings, 1 reply; 10+ messages in thread
From: Daniel Jacobowitz @ 2007-08-24 16:54 UTC (permalink / raw)
  To: gdb

On Fri, Aug 24, 2007 at 06:16:25PM +0200, Mark Kettenis wrote:
> 1. There is quite a bit of code that uses "unsigned char *" for
>    strings, to avoid unwanted sign extension.

This is the real question, yes.  I've made it even easier to view
these as strings if desired.  I've asked several times if the changes
were good enough.  I think I got a generally affirmative reaction, but
it's hard to tell.

We can't be right by default all the time, since there just isn't
enough information.  What I'm suggesting is that the new behavior will
be right more often than the old behavior.  I have worked with a
variety of high performance computing and signal processing
developers who are interested in unsigned single-byte data.

If you're already using user-defined commands to print data, by the
way, the difference is a non-issue.  I believe that covers much of
the Emacs case.

> 2. Not all debug formats (most notably stabs) do not make the
>    distinction between unqualified "char" and "(un)signed char".

That does not seem to be correct, at least in the case of stabs.  Even
with -gstabs (i.e. without GNU extensions to stabs), GDB correctly
sets the NOSIGN and UNSIGNED flags for char variants (example below).
I also checked the "maint print type" output and NOSIGN is set where
I'd expect.  And it already gets set for types whose name is char in
init_type; this also handles all typedefs to char, et cetera, as long
as your debug format represents typedefs.  I admit it will leave
"typedef char char_t" users having to type a couple extra characters
to get a string if they're using mdebug...

I did find a bug in the stabs reader testing this, though.  It
bypasses the NOSIGN check because it creates the type and then sets
TYPE_NAME later.  Easy to fix.

drow@caradoc:~% cat foo.c
char c;
signed char d;
unsigned char e;
int main(){}

drow@caradoc:~% gcc -gstabs foo.c
drow@caradoc:~% gdb ./a.out
GNU gdb 6.6-debian
...
(gdb) ptype c
type = char
(gdb) ptype d
type = signed char
(gdb) ptype e
type = unsigned char

-- 
Daniel Jacobowitz
CodeSourcery


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: GDB transition to GPLv3 should now be complete
  2007-08-24 16:54       ` Daniel Jacobowitz
@ 2007-08-24 18:11         ` Mark Kettenis
  2007-08-24 18:40           ` Daniel Jacobowitz
  0 siblings, 1 reply; 10+ messages in thread
From: Mark Kettenis @ 2007-08-24 18:11 UTC (permalink / raw)
  To: drow; +Cc: gdb

> Date: Fri, 24 Aug 2007 12:54:39 -0400
> From: Daniel Jacobowitz <drow@false.org>
> 
> On Fri, Aug 24, 2007 at 06:16:25PM +0200, Mark Kettenis wrote:
> > 1. There is quite a bit of code that uses "unsigned char *" for
> >    strings, to avoid unwanted sign extension.
> 
> This is the real question, yes.  I've made it even easier to view
> these as strings if desired.  I've asked several times if the changes
> were good enough.  I think I got a generally affirmative reaction, but
> it's hard to tell.

Well, the problem with this diff is that it actually seems to be a
good idea until you actually start to use it.  I thought it was a good
idea, so I put it in my tree.  And I threw it out again after a few
days because I was annoyed by the fact that it didn't print strings as
strings in many cases where I was sure it did before.  As I said, the
use of "unsigned char *" is very common in string manipulation code.

> We can't be right by default all the time, since there just isn't
> enough information.  What I'm suggesting is that the new behavior will
> be right more often than the old behavior.  I have worked with a
> variety of high performance computing and signal processing
> developers who are interested in unsigned single-byte data.

Yes, I can imagine that, but these people are working in fairly
specialized areas with specific requirements.

> If you're already using user-defined commands to print data, by the
> way, the difference is a non-issue.  I believe that covers much of
> the Emacs case.

But the developers you talk about above can easily do the same.  And
when I'm not specifically talking about Emacs when I talk about code
that does string manipulations.

> > 2. Not all debug formats (most notably stabs) do not make the
> >    distinction between unqualified "char" and "(un)signed char".
> 
> That does not seem to be correct, at least in the case of stabs.  Even
> with -gstabs (i.e. without GNU extensions to stabs), GDB correctly
> sets the NOSIGN and UNSIGNED flags for char variants (example below).
> I also checked the "maint print type" output and NOSIGN is set where
> I'd expect.  And it already gets set for types whose name is char in
> init_type; this also handles all typedefs to char, et cetera, as long
> as your debug format represents typedefs.  I admit it will leave
> "typedef char char_t" users having to type a couple extra characters
> to get a string if they're using mdebug...
> 
> I did find a bug in the stabs reader testing this, though.  It
> bypasses the NOSIGN check because it creates the type and then sets
> TYPE_NAME later.  Easy to fix.
> 
> drow@caradoc:~% cat foo.c
> char c;
> signed char d;
> unsigned char e;
> int main(){}
> 
> drow@caradoc:~% gcc -gstabs foo.c
> drow@caradoc:~% gdb ./a.out
> GNU gdb 6.6-debian
> ...
> (gdb) ptype c
> type = char
> (gdb) ptype d
> type = signed char
> (gdb) ptype e
> type = unsigned char

Ah, that fix would be very welcome.  Need to verify this with GCC
2.95.3 though.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: GDB transition to GPLv3 should now be complete
  2007-08-24 18:11         ` Mark Kettenis
@ 2007-08-24 18:40           ` Daniel Jacobowitz
  2007-08-24 22:17             ` Daniel Jacobowitz
  0 siblings, 1 reply; 10+ messages in thread
From: Daniel Jacobowitz @ 2007-08-24 18:40 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: gdb

On Fri, Aug 24, 2007 at 08:11:17PM +0200, Mark Kettenis wrote:
> Well, the problem with this diff is that it actually seems to be a
> good idea until you actually start to use it.  I thought it was a good
> idea, so I put it in my tree.  And I threw it out again after a few
> days because I was annoyed by the fact that it didn't print strings as
> strings in many cases where I was sure it did before.  As I said, the
> use of "unsigned char *" is very common in string manipulation code.

The diff from July, right?  I wish you'd mentioned that you'd tried
it, back after I posted it - I would have been glad to see specific
examples.  I still would, if you remember any of them.

There are at least three classes of code affected by this:

  - uses MMX, SSE, or AltiVec
  - uses unsigned char * for numerical data
  - uses unsigned char * for strings

I've spent hours searching through different bodies of code trying to
come up with comparisons here (which I posted during the last
discussion).  I believe that the first is rapidly increasingly and the
other two are about even.  I don't want to drop what I believe to be a
very useful change without at least finding some compromise.

By the way, Jan's patch (which only applies to unsigned char[] and not
unsigned char *, leaving GDB in my opinion inconsistent) is in Fedora
7.  That's relatively recent but has a lot of users; I don't see any
complaints about it in their bugzilla.

-- 
Daniel Jacobowitz
CodeSourcery


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: GDB transition to GPLv3 should now be complete
  2007-08-24 18:40           ` Daniel Jacobowitz
@ 2007-08-24 22:17             ` Daniel Jacobowitz
  2007-08-25  9:36               ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Daniel Jacobowitz @ 2007-08-24 22:17 UTC (permalink / raw)
  To: gdb

On Fri, Aug 24, 2007 at 02:40:12PM -0400, Daniel Jacobowitz wrote:
> I've spent

... enough time having polite differences of opinion with Mark to
recognize when I'm not likely to change his mind :-)

In the interests of fixing the inconsistency, releasing GDB 6.7,
ending this discussion, making everyone happy, and world peace, I'm
working on a patch which only changes the behavior for vector types.
I still think changing unsigned char's behavior is the right choice,
but I can try to persuade folks of that again some more appropriate
time.

-- 
Daniel Jacobowitz
CodeSourcery


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: GDB transition to GPLv3 should now be complete
  2007-08-24 22:17             ` Daniel Jacobowitz
@ 2007-08-25  9:36               ` Eli Zaretskii
  2007-08-25 13:39                 ` Daniel Jacobowitz
  0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2007-08-25  9:36 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb

> Date: Fri, 24 Aug 2007 18:17:41 -0400
> From: Daniel Jacobowitz <drow@false.org>
> 
> I still think changing unsigned char's behavior is the right choice,
> but I can try to persuade folks of that again some more appropriate
> time.

How about a user option, by default off, that will cause GDB to use
your modified behavior with unisgned char * ?


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: GDB transition to GPLv3 should now be complete
  2007-08-25  9:36               ` Eli Zaretskii
@ 2007-08-25 13:39                 ` Daniel Jacobowitz
  0 siblings, 0 replies; 10+ messages in thread
From: Daniel Jacobowitz @ 2007-08-25 13:39 UTC (permalink / raw)
  To: gdb

On Sat, Aug 25, 2007 at 12:36:12PM +0300, Eli Zaretskii wrote:
> How about a user option, by default off, that will cause GDB to use
> your modified behavior with unisgned char * ?

Yes, maybe we should try that.

-- 
Daniel Jacobowitz
CodeSourcery


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2007-08-25 13:39 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-24 15:08 GDB transition to GPLv3 should now be complete Joel Brobecker
2007-08-24 15:28 ` Mark Kettenis
2007-08-24 15:33   ` Daniel Jacobowitz
2007-08-24 16:16     ` Mark Kettenis
2007-08-24 16:54       ` Daniel Jacobowitz
2007-08-24 18:11         ` Mark Kettenis
2007-08-24 18:40           ` Daniel Jacobowitz
2007-08-24 22:17             ` Daniel Jacobowitz
2007-08-25  9:36               ` Eli Zaretskii
2007-08-25 13:39                 ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox