linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] Add -*- gdb-script -*- to the top of gdbhelpers, for Emacs
@ 2009-05-31 15:44 Samuel Bronson
  2009-05-31 15:44 ` [PATCH 2/3] Replace SYM_ and MOD_ #defines with enums in symbol.h Samuel Bronson
  2009-06-01  6:21 ` [PATCH 1/3] Add -*- gdb-script -*- to the top of gdbhelpers, for Emacs Alexey Zaytsev
  0 siblings, 2 replies; 11+ messages in thread
From: Samuel Bronson @ 2009-05-31 15:44 UTC (permalink / raw)
  To: linux-sparse; +Cc: Samuel Bronson

Changes-licensed-under: ISC license
Signed-off-by: Samuel Bronson <naesten@gmail.com>
---
 gdbhelpers |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/gdbhelpers b/gdbhelpers
index 7223ffd..34407d6 100644
--- a/gdbhelpers
+++ b/gdbhelpers
@@ -1,3 +1,4 @@
+# For emacs: -*- gdb-script -*- 
 
 # Don't forget to rebuild sparse with uncommented debug options
 # in the Makefile. Also, gcc 3 is known to screw up with the
-- 
1.6.3.1.169.g33fd.dirty


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

* [PATCH 2/3] Replace SYM_ and MOD_ #defines with enums in symbol.h.
  2009-05-31 15:44 [PATCH 1/3] Add -*- gdb-script -*- to the top of gdbhelpers, for Emacs Samuel Bronson
@ 2009-05-31 15:44 ` Samuel Bronson
  2009-05-31 15:44   ` [PATCH 3/3] Whitespace tweaks " Samuel Bronson
  2009-05-31 16:03   ` [PATCH 2/3] Replace SYM_ and MOD_ #defines with enums " Samuel Bronson
  2009-06-01  6:21 ` [PATCH 1/3] Add -*- gdb-script -*- to the top of gdbhelpers, for Emacs Alexey Zaytsev
  1 sibling, 2 replies; 11+ messages in thread
From: Samuel Bronson @ 2009-05-31 15:44 UTC (permalink / raw)
  To: linux-sparse; +Cc: Samuel Bronson

Adjust the associated fields to match. While we're here, change
some nearby bitfields from "char" to "int" so GDB doesn't bother
showing character literals for them.

This should allow the gdbhelpers script to work with more versions of
GDB and/or build configurations.

Changes-licensed-under: ISC license
Signed-off-by: Samuel Bronson <naesten@gmail.com>
---
 symbol.h |  106 ++++++++++++++++++++++++++++++++-----------------------------
 1 files changed, 56 insertions(+), 50 deletions(-)

diff --git a/symbol.h b/symbol.h
index c4d7f28..4a16f0d 100644
--- a/symbol.h
+++ b/symbol.h
@@ -80,7 +80,7 @@ extern struct context *alloc_context(void);
 DECLARE_PTR_LIST(context_list, struct context);
 
 struct ctype {
-	unsigned long modifiers;
+	enum modifier modifiers;
 	unsigned long alignment;
 	struct context_list *contexts;
 	unsigned int as;
@@ -103,14 +103,19 @@ struct symbol_op {
 extern int expand_safe_p(struct expression *expr, int cost);
 extern int expand_constant_p(struct expression *expr, int cost);
 
-#define SYM_ATTR_WEAK		0
-#define SYM_ATTR_NORMAL		1
-#define SYM_ATTR_STRONG		2
+enum sym_attr {
+	SYM_ATTR_WEAK	= 0,
+	SYM_ATTR_NORMAL	= 1,
+	SYM_ATTR_STRONG	= 2,
+};
 
 struct symbol {
 	enum type type:8;
 	enum namespace namespace:9;
-	unsigned char used:1, attr:2, enum_member:1, bound:1;
+	unsigned int used:1;
+	enum sym_attr attr:2;
+	unsigned int enum_member:1;
+	unsigned int bound:1;
 	struct position pos;		/* Where this symbol was declared */
 	struct position endpos;		/* Where this symbol ends*/
 	struct ident *ident;		/* What identifier this symbol is associated with */
@@ -162,57 +167,58 @@ struct symbol {
 		void *aux;			/* Auxiliary info, e.g. backend information */
 		struct {			/* sparse ctags */
 			char kind;
-			unsigned char visited:1;
+			unsigned int visited:1;
 		};
 	};
 	pseudo_t pseudo;
 };
 
 /* Modifiers */
-#define MOD_AUTO	0x0001
-#define MOD_REGISTER	0x0002
-#define MOD_STATIC	0x0004
-#define MOD_EXTERN	0x0008
-
-#define MOD_CONST	0x0010
-#define MOD_VOLATILE	0x0020
-#define MOD_SIGNED	0x0040
-#define MOD_UNSIGNED	0x0080
-
-#define MOD_CHAR	0x0100
-#define MOD_SHORT	0x0200
-#define MOD_LONG	0x0400
-#define MOD_LONGLONG	0x0800
-
-#define MOD_TYPEDEF	0x1000
-
-#define MOD_INLINE	0x40000
-#define MOD_ADDRESSABLE	0x80000
-
-#define MOD_NOCAST	0x100000
-#define MOD_NODEREF	0x200000
-#define MOD_ACCESSED	0x400000
-#define MOD_TOPLEVEL	0x800000	// scoping..
-
-#define MOD_LABEL	0x1000000
-#define MOD_ASSIGNED	0x2000000
-#define MOD_TYPE	0x4000000
-#define MOD_SAFE	0x8000000	// non-null/non-trapping pointer
-
-#define MOD_USERTYPE	0x10000000
-#define MOD_FORCE	0x20000000
-#define MOD_EXPLICITLY_SIGNED	0x40000000
-#define MOD_BITWISE	0x80000000
-
-#define MOD_NONLOCAL	(MOD_EXTERN | MOD_TOPLEVEL)
-#define MOD_STORAGE	(MOD_AUTO | MOD_REGISTER | MOD_STATIC | MOD_EXTERN | MOD_INLINE | MOD_TOPLEVEL | MOD_FORCE)
-#define MOD_SIGNEDNESS	(MOD_SIGNED | MOD_UNSIGNED | MOD_EXPLICITLY_SIGNED)
-#define MOD_SPECIFIER	(MOD_CHAR | MOD_SHORT | MOD_LONG | MOD_LONGLONG | MOD_SIGNEDNESS)
-#define MOD_SIZE	(MOD_CHAR | MOD_SHORT | MOD_LONG | MOD_LONGLONG)
-#define MOD_IGNORE (MOD_TOPLEVEL | MOD_STORAGE | MOD_ADDRESSABLE |	\
-	MOD_ASSIGNED | MOD_USERTYPE | MOD_ACCESSED | MOD_EXPLICITLY_SIGNED)
-#define MOD_PTRINHERIT (MOD_VOLATILE | MOD_CONST | MOD_NODEREF | MOD_STORAGE)
-
+enum modifier {
+	MOD_AUTO	= 1 << 0,
+	MOD_REGISTER	= 1 << 1,
+	MOD_STATIC	= 1 << 2,
+	MOD_EXTERN	= 1 << 3,
+
+	MOD_CONST	= 1 << 4,
+	MOD_VOLATILE	= 1 << 5,
+	MOD_SIGNED	= 1 << 6,
+	MOD_UNSIGNED	= 1 << 7,
+
+	MOD_CHAR	= 1 << 8,
+	MOD_SHORT	= 1 << 9,
+	MOD_LONG	= 1 << 10,
+	MOD_LONGLONG	= 1 << 11,
+
+	MOD_TYPEDEF	= 1 << 12,
+
+	MOD_INLINE	= 1 << 18,
+	MOD_ADDRESSABLE	= 1 << 19,
+
+	MOD_NOCAST	= 1 << 20,
+	MOD_NODEREF	= 1 << 21,
+	MOD_ACCESSED	= 1 << 22,
+	MOD_TOPLEVEL	= 1 << 23,	// scoping..
+
+	MOD_LABEL	= 1 << 24,
+	MOD_ASSIGNED	= 1 << 25,
+	MOD_TYPE	= 1 << 26,
+	MOD_SAFE	= 1 << 27,	// non-null/non-trapping pointer
+
+	MOD_USERTYPE	= 1 << 28,
+	MOD_FORCE       = 1 << 29,
+	MOD_EXPLICITLY_SIGNED	= 1 << 30,
+	MOD_BITWISE	= 1 << 31,
+
+	MOD_NONLOCAL	= (MOD_EXTERN | MOD_TOPLEVEL),
+	MOD_STORAGE	= (MOD_AUTO | MOD_REGISTER | MOD_STATIC | MOD_EXTERN | MOD_INLINE | MOD_TOPLEVEL | MOD_FORCE),
+	MOD_SIGNEDNESS	= (MOD_SIGNED | MOD_UNSIGNED | MOD_EXPLICITLY_SIGNED),
+	MOD_SPECIFIER	= (MOD_CHAR | MOD_SHORT | MOD_LONG | MOD_LONGLONG | MOD_SIGNEDNESS),
+	MOD_SIZE	= (MOD_CHAR | MOD_SHORT | MOD_LONG | MOD_LONGLONG),
+	MOD_IGNORE	= (MOD_TOPLEVEL | MOD_STORAGE | MOD_ADDRESSABLE |
+			   MOD_ASSIGNED | MOD_USERTYPE | MOD_ACCESSED | MOD_EXPLICITLY_SIGNED),
+	MOD_PTRINHERIT	= (MOD_VOLATILE | MOD_CONST | MOD_NODEREF | MOD_STORAGE),
+};
 
 /* Current parsing/evaluation function */
 extern struct symbol *current_fn;
-- 
1.6.3.1.169.g33fd.dirty


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

* [PATCH 3/3] Whitespace tweaks in symbol.h
  2009-05-31 15:44 ` [PATCH 2/3] Replace SYM_ and MOD_ #defines with enums in symbol.h Samuel Bronson
@ 2009-05-31 15:44   ` Samuel Bronson
  2009-05-31 16:03   ` [PATCH 2/3] Replace SYM_ and MOD_ #defines with enums " Samuel Bronson
  1 sibling, 0 replies; 11+ messages in thread
From: Samuel Bronson @ 2009-05-31 15:44 UTC (permalink / raw)
  To: linux-sparse; +Cc: Samuel Bronson

Changes-licensed-under: ISC license
Signed-off-by: Samuel Bronson <naesten@gmail.com>
---
 symbol.h |   22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/symbol.h b/symbol.h
index 4a16f0d..3dd4531 100644
--- a/symbol.h
+++ b/symbol.h
@@ -24,16 +24,16 @@
  * declared.
  */
 enum namespace {
-	NS_NONE = 0,
-	NS_MACRO = 1,
-	NS_TYPEDEF = 2,
-	NS_STRUCT = 4,  // Also used for unions and enums.
-	NS_LABEL = 8,
-	NS_SYMBOL = 16,
-	NS_ITERATOR = 32,
-	NS_PREPROCESSOR = 64,
-	NS_UNDEF = 128,
-	NS_KEYWORD = 256,
+	NS_NONE		= 0,
+	NS_MACRO	= 1,
+	NS_TYPEDEF	= 2,
+	NS_STRUCT	= 4,  // Also used for unions and enums.
+	NS_LABEL	= 8,
+	NS_SYMBOL	= 16,
+	NS_ITERATOR	= 32,
+	NS_PREPROCESSOR	= 64,
+	NS_UNDEF	= 128,
+	NS_KEYWORD	= 256,
 };
 
 enum type {
@@ -59,7 +59,7 @@ enum type {
 };
 
 enum keyword {
-	KW_SPECIFIER 	= 1 << 0,
+	KW_SPECIFIER	= 1 << 0,
 	KW_MODIFIER	= 1 << 1,
 	KW_QUALIFIER	= 1 << 2,
 	KW_ATTRIBUTE	= 1 << 3,
-- 
1.6.3.1.169.g33fd.dirty


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

* Re: [PATCH 2/3] Replace SYM_ and MOD_ #defines with enums in symbol.h.
  2009-05-31 15:44 ` [PATCH 2/3] Replace SYM_ and MOD_ #defines with enums in symbol.h Samuel Bronson
  2009-05-31 15:44   ` [PATCH 3/3] Whitespace tweaks " Samuel Bronson
@ 2009-05-31 16:03   ` Samuel Bronson
  1 sibling, 0 replies; 11+ messages in thread
From: Samuel Bronson @ 2009-05-31 16:03 UTC (permalink / raw)
  To: linux-sparse; +Cc: Samuel Bronson

On Sun, May 31, 2009 at 11:44 AM, Samuel Bronson <naesten@gmail.com> wrote:
> Adjust the associated fields to match.

Dang it, I seem to have somehow forgotten to test after this step ... whoops!

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

* Re: [PATCH 1/3] Add -*- gdb-script -*- to the top of gdbhelpers, for Emacs
  2009-05-31 15:44 [PATCH 1/3] Add -*- gdb-script -*- to the top of gdbhelpers, for Emacs Samuel Bronson
  2009-05-31 15:44 ` [PATCH 2/3] Replace SYM_ and MOD_ #defines with enums in symbol.h Samuel Bronson
@ 2009-06-01  6:21 ` Alexey Zaytsev
  2009-06-01 16:06   ` Samuel Bronson
  1 sibling, 1 reply; 11+ messages in thread
From: Alexey Zaytsev @ 2009-06-01  6:21 UTC (permalink / raw)
  To: Samuel Bronson; +Cc: linux-sparse

On Sun, May 31, 2009 at 19:44, Samuel Bronson <naesten@gmail.com> wrote:
> Changes-licensed-under: ISC license

I don't think it works that way.

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

* Re: [PATCH 1/3] Add -*- gdb-script -*- to the top of gdbhelpers, for Emacs
  2009-06-01  6:21 ` [PATCH 1/3] Add -*- gdb-script -*- to the top of gdbhelpers, for Emacs Alexey Zaytsev
@ 2009-06-01 16:06   ` Samuel Bronson
  2009-06-01 17:26     ` Anderson Lizardo
  2009-06-01 17:26     ` Alexey Zaytsev
  0 siblings, 2 replies; 11+ messages in thread
From: Samuel Bronson @ 2009-06-01 16:06 UTC (permalink / raw)
  To: Alexey Zaytsev; +Cc: linux-sparse

On Mon, Jun 1, 2009 at 2:21 AM, Alexey Zaytsev <alexey.zaytsev@gmail.com> wrote:
> On Sun, May 31, 2009 at 19:44, Samuel Bronson <naesten@gmail.com> wrote:
>> Changes-licensed-under: ISC license
>
> I don't think it works that way.

Yeah, yeah, well it's a simple permissive license, so even if the
patch introduced anything copyrightable -- which it presumably doesn't
-- you could use it anyway.

I just don't feel comfortable contributing under the OSL 1.1, for some
reason -- possibly because it's considered non-DFSG, possibly because
it's even more restrictive than the GPL ...

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

* Re: [PATCH 1/3] Add -*- gdb-script -*- to the top of gdbhelpers, for Emacs
  2009-06-01 16:06   ` Samuel Bronson
@ 2009-06-01 17:26     ` Anderson Lizardo
  2009-06-01 17:36       ` Samuel Bronson
  2009-06-01 17:26     ` Alexey Zaytsev
  1 sibling, 1 reply; 11+ messages in thread
From: Anderson Lizardo @ 2009-06-01 17:26 UTC (permalink / raw)
  To: Samuel Bronson; +Cc: Alexey Zaytsev, linux-sparse

On Mon, Jun 1, 2009 at 12:06 PM, Samuel Bronson <naesten@gmail.com> wrote:
> I just don't feel comfortable contributing under the OSL 1.1, for some
> reason -- possibly because it's considered non-DFSG, possibly because
> it's even more restrictive than the GPL ...

If you look at the recent mailing list archives, you will find that a
particular snapshot of the git tree was relicensed by the original
copyright holder (Transmeta?) under the MIT license. It seems the
current developers intend to check with the other copyright holders
(for code commited after the particular relicensed snapshot) for a
license change.

So I would you suggest at least using the MIT license to not "pollute"
the code with yet another license...

The developers might need to confirm this, I'm just on "monitoring
mode" here currently :)

Regards,
-- 
Anderson Lizardo
Instituto Nokia de Tecnologia (INdT)
Manaus - Brazil

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

* Re: [PATCH 1/3] Add -*- gdb-script -*- to the top of gdbhelpers, for Emacs
  2009-06-01 16:06   ` Samuel Bronson
  2009-06-01 17:26     ` Anderson Lizardo
@ 2009-06-01 17:26     ` Alexey Zaytsev
  1 sibling, 0 replies; 11+ messages in thread
From: Alexey Zaytsev @ 2009-06-01 17:26 UTC (permalink / raw)
  To: Samuel Bronson; +Cc: linux-sparse

On Mon, Jun 1, 2009 at 20:06, Samuel Bronson <naesten@gmail.com> wrote:
> On Mon, Jun 1, 2009 at 2:21 AM, Alexey Zaytsev <alexey.zaytsev@gmail.com> wrote:
>> On Sun, May 31, 2009 at 19:44, Samuel Bronson <naesten@gmail.com> wrote:
>>> Changes-licensed-under: ISC license
>>
>> I don't think it works that way.
>
> Yeah, yeah, well it's a simple permissive license, so even if the
> patch introduced anything copyrightable -- which it presumably doesn't
> -- you could use it anyway.
>
> I just don't feel comfortable contributing under the OSL 1.1, for some
> reason -- possibly because it's considered non-DFSG, possibly because
> it's even more restrictive than the GPL ...
>

I'm not your lawyer, and not the sparse maintainer, but I strongly suspect
that that means that you can't contribute to sparse. And I'm not sure if you
could distribute the patches you sent at all, since they are derivative work,
and should be covered with the same license as sparse itself.

  c) to distribute copies of the Original Work and Derivative Works to
     the public, with the proviso that copies of Original Work or
     Derivative Works that You distribute shall be licensed under the
     Open Software License;

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

* Re: [PATCH 1/3] Add -*- gdb-script -*- to the top of gdbhelpers, for Emacs
  2009-06-01 17:26     ` Anderson Lizardo
@ 2009-06-01 17:36       ` Samuel Bronson
  2009-06-01 17:44         ` Alexey Zaytsev
  0 siblings, 1 reply; 11+ messages in thread
From: Samuel Bronson @ 2009-06-01 17:36 UTC (permalink / raw)
  To: Anderson Lizardo; +Cc: Alexey Zaytsev, linux-sparse

On Mon, Jun 1, 2009 at 1:26 PM, Anderson Lizardo
<anderson.lizardo@gmail.com> wrote:
> On Mon, Jun 1, 2009 at 12:06 PM, Samuel Bronson <naesten@gmail.com> wrote:
>> I just don't feel comfortable contributing under the OSL 1.1, for some
>> reason -- possibly because it's considered non-DFSG, possibly because
>> it's even more restrictive than the GPL ...
>
> If you look at the recent mailing list archives, you will find that a
> particular snapshot of the git tree was relicensed by the original
> copyright holder (Transmeta?) under the MIT license. It seems the
> current developers intend to check with the other copyright holders
> (for code commited after the particular relicensed snapshot) for a
> license change.
>
> So I would you suggest at least using the MIT license to not "pollute"
> the code with yet another license...

Oh, sure, that's fine with me! Hadn't heard about that. The MIT/X11
license is almost the same as the ISC license. Go ahead and s/ISC
license/MIT license/ in these patches, though I don't think either of
the patches that actually work (1/3 and 3/3) give me copyright on any
code anyway.

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

* Re: [PATCH 1/3] Add -*- gdb-script -*- to the top of gdbhelpers, for Emacs
  2009-06-01 17:36       ` Samuel Bronson
@ 2009-06-01 17:44         ` Alexey Zaytsev
  2009-06-01 17:50           ` Samuel Bronson
  0 siblings, 1 reply; 11+ messages in thread
From: Alexey Zaytsev @ 2009-06-01 17:44 UTC (permalink / raw)
  To: Samuel Bronson; +Cc: Anderson Lizardo, linux-sparse

On Mon, Jun 1, 2009 at 21:36, Samuel Bronson <naesten@gmail.com> wrote:
> On Mon, Jun 1, 2009 at 1:26 PM, Anderson Lizardo
> <anderson.lizardo@gmail.com> wrote:
>> On Mon, Jun 1, 2009 at 12:06 PM, Samuel Bronson <naesten@gmail.com> wrote:
>>> I just don't feel comfortable contributing under the OSL 1.1, for some
>>> reason -- possibly because it's considered non-DFSG, possibly because
>>> it's even more restrictive than the GPL ...
>>
>> If you look at the recent mailing list archives, you will find that a
>> particular snapshot of the git tree was relicensed by the original
>> copyright holder (Transmeta?) under the MIT license. It seems the
>> current developers intend to check with the other copyright holders
>> (for code commited after the particular relicensed snapshot) for a
>> license change.
>>
>> So I would you suggest at least using the MIT license to not "pollute"
>> the code with yet another license...
>
> Oh, sure, that's fine with me! Hadn't heard about that. The MIT/X11
> license is almost the same as the ISC license. Go ahead and s/ISC
> license/MIT license/ in these patches, though I don't think either of
> the patches that actually work (1/3 and 3/3) give me copyright on any
> code anyway.
>

Won't work that easily. Only an early sparse version, owned exclusively
by transmeta may be alternatively distribute under the MIT license. To
convert the current sparse version to MIT, we need to get all the
contributors to agree to this. Not impossible, but someone needs to
send lots of emails. ;)

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

* Re: [PATCH 1/3] Add -*- gdb-script -*- to the top of gdbhelpers, for Emacs
  2009-06-01 17:44         ` Alexey Zaytsev
@ 2009-06-01 17:50           ` Samuel Bronson
  0 siblings, 0 replies; 11+ messages in thread
From: Samuel Bronson @ 2009-06-01 17:50 UTC (permalink / raw)
  To: Alexey Zaytsev; +Cc: Anderson Lizardo, linux-sparse

On Mon, Jun 1, 2009 at 1:44 PM, Alexey Zaytsev <alexey.zaytsev@gmail.com> wrote:

> Won't work that easily. Only an early sparse version, owned exclusively
> by transmeta may be alternatively distribute under the MIT license. To
> convert the current sparse version to MIT, we need to get all the
> contributors to agree to this. Not impossible, but someone needs to
> send lots of emails. ;)

Yes, well, count me in -- now all I have to do is actually contribute
something copyrightable ;-)

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

end of thread, other threads:[~2009-06-01 17:50 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-31 15:44 [PATCH 1/3] Add -*- gdb-script -*- to the top of gdbhelpers, for Emacs Samuel Bronson
2009-05-31 15:44 ` [PATCH 2/3] Replace SYM_ and MOD_ #defines with enums in symbol.h Samuel Bronson
2009-05-31 15:44   ` [PATCH 3/3] Whitespace tweaks " Samuel Bronson
2009-05-31 16:03   ` [PATCH 2/3] Replace SYM_ and MOD_ #defines with enums " Samuel Bronson
2009-06-01  6:21 ` [PATCH 1/3] Add -*- gdb-script -*- to the top of gdbhelpers, for Emacs Alexey Zaytsev
2009-06-01 16:06   ` Samuel Bronson
2009-06-01 17:26     ` Anderson Lizardo
2009-06-01 17:36       ` Samuel Bronson
2009-06-01 17:44         ` Alexey Zaytsev
2009-06-01 17:50           ` Samuel Bronson
2009-06-01 17:26     ` Alexey Zaytsev

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 NNTP newsgroup(s).