public inbox for frysk@sourceware.org
 help / color / mirror / Atom feed
* Disassembly source buffer and libopcodes
@ 2007-08-22 12:26 Mark Wielaard
  2007-08-22 14:27 ` Elena Zannoni
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Wielaard @ 2007-08-22 12:26 UTC (permalink / raw)
  To: frysk

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

Hi,

Since Fedora did a license audit and found we were linking in libopcodes
from binutils which is under GPL, but we distribute Frysk under GPL +
Exception, automatic libopcode usage has been disabled (you need to
configure --with-libopcodes to get it). But this exposed a bug in
SourceBuffer which didn't handle not getting any disassembly. This patch
fixes that (and makes the method slightly more efficient by using only
one StringBuilder and appending the chars individually, not as String
objects). And it fixes a typo in Disassembler.cxx which prevented
disassembly even when --with-libopcodes was given.

frysk-gui/frysk/gui/srcwin/ChangeLog
2007-08-22  Mark Wielaard  <mwielaard@redhat.com>

    * SourceBuffer.java (disassembleFrame): Use one StringBuffer,
    only call Iterator.next() when hasNext() returns true, append
    chars individually, not as String objects.

frysk-sys/lib/opcodes/ChangeLog
2007-08-22  Mark Wielaard  <mwielaard@redhat.com>

    * cni/Disassembler.cxx (disassemble): Use WITH_LIBOPCODES, not
    HAVE_LIPOPCODES.

This fixes bug #4948. Tested with and without --with-libopcodes.

Cheers,

Mark

[-- Attachment #2: Disassembler.patch --]
[-- Type: text/x-patch, Size: 2230 bytes --]

Index: frysk-gui/frysk/gui/srcwin/SourceBuffer.java
===================================================================
RCS file: /cvs/frysk/frysk-gui/frysk/gui/srcwin/SourceBuffer.java,v
retrieving revision 1.137
diff -u -r1.137 SourceBuffer.java
--- frysk-gui/frysk/gui/srcwin/SourceBuffer.java	13 Aug 2007 13:06:46 -0000	1.137
+++ frysk-gui/frysk/gui/srcwin/SourceBuffer.java	22 Aug 2007 11:44:14 -0000
@@ -870,7 +870,7 @@
 
 	this.firstLoad = false;
 
-	StringBuffer buffer = new StringBuffer();
+	StringBuilder buf = new StringBuilder();
 	Disassembler diss = new Disassembler(task.getMemory());
 
 	long address = frame.getAddress();
@@ -879,27 +879,23 @@
 
 	List instructionsList = diss.disassembleInstructions(address, 40);
 	Iterator iter = instructionsList.iterator();
-	Instruction ins = (Instruction) iter.next();
 
 	while (iter.hasNext()) {
-	    StringBuffer buf = new StringBuffer();
-	    buf.append("<");
+	    Instruction ins = (Instruction) iter.next();
+	    buf.append('<');
 	    buf.append(frame.getSymbol().getDemangledName());
 	    buf.append(" pc");
-	    buf.append("+");
+	    buf.append('+');
 	    buf.append(ins.address - address);
 	    buf.append(">: ");
 	    buf.append("0x");
 	    buf.append(Long.toHexString(ins.address));
-	    buf.append(" ");
+	    buf.append(' ');
 	    buf.append(ins.instruction);
-	    buf.append("\n");
-
-	    buffer.append(buf.toString());
-	    ins = (Instruction) iter.next();
+	    buf.append('\n');
 	}
 
-	this.insertText(buffer.toString());
+	this.insertText(buf.toString());
     }
 
     /**
Index: frysk-sys/lib/opcodes/cni/Disassembler.cxx
===================================================================
RCS file: /cvs/frysk/frysk-sys/lib/opcodes/cni/Disassembler.cxx,v
retrieving revision 1.3
diff -u -r1.3 Disassembler.cxx
--- frysk-sys/lib/opcodes/cni/Disassembler.cxx	16 Aug 2007 19:22:34 -0000	1.3
+++ frysk-sys/lib/opcodes/cni/Disassembler.cxx	22 Aug 2007 12:22:19 -0000
@@ -195,7 +195,7 @@
 void
 lib::opcodes::Disassembler::disassemble (jlong address, jlong instructions)
 {
-#ifdef HAVE_LIPOPCODES
+#ifdef WITH_LIBOPCODES
   disassemble_info disasm_info;
   int instr_length = 0;
   int (*disasm_func) (bfd_vma, disassemble_info*) = NULL;

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

* Re: Disassembly source buffer and libopcodes
  2007-08-22 12:26 Disassembly source buffer and libopcodes Mark Wielaard
@ 2007-08-22 14:27 ` Elena Zannoni
  2007-08-22 14:51   ` Mark Wielaard
  0 siblings, 1 reply; 5+ messages in thread
From: Elena Zannoni @ 2007-08-22 14:27 UTC (permalink / raw)
  To: Mark Wielaard; +Cc: frysk

Mark Wielaard wrote:
> Hi,
>
> Since Fedora did a license audit and found we were linking in libopcodes
> from binutils which is under GPL, but we distribute Frysk under GPL +
> Exception, automatic libopcode usage has been disabled (you need to
> configure --with-libopcodes to get it). 

Thanks for discussing this on the mailing list, can you explain a bit 
more about it?
I wasn't aware of the audit, is this a RH thing? or a fedora thing? Does 
it impact
frysk in other ways? I assume this is reason for the change Andrew made on
August 16?
http://sourceware.org/ml/frysk-cvs/2007-q3/msg00648.html

Is there any public discussion of the audit?

thanks
elena

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

* Re: Disassembly source buffer and libopcodes
  2007-08-22 14:27 ` Elena Zannoni
@ 2007-08-22 14:51   ` Mark Wielaard
  2007-08-22 16:02     ` Elena Zannoni
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Wielaard @ 2007-08-22 14:51 UTC (permalink / raw)
  To: Elena Zannoni; +Cc: frysk

Hi Elena,

On Wed, 2007-08-22 at 10:25 -0400, Elena Zannoni wrote:
> > Since Fedora did a license audit and found we were linking in libopcodes
> > from binutils which is under GPL, but we distribute Frysk under GPL +
> > Exception, automatic libopcode usage has been disabled (you need to
> > configure --with-libopcodes to get it). 
> 
> Thanks for discussing this on the mailing list, can you explain a bit 
> more about it?
> I wasn't aware of the audit, is this a RH thing? or a fedora thing? Does 
> it impact frysk in other ways?

It is a Fedora thing. They are cleaning up the package license tags:
http://fedoraproject.org/wiki/PackagingDrafts/LicenseTag
This means all packages are audited now. The main Frysk license is GPL +
Exception so we can link with non-gpl compatible code like eclipse. One
of the maintainers noticed that we were using binutils (libopcodes)
which is GPL-only though, so cannot be used in a larger work with EPL
code.

> I assume this is reason for the change Andrew made on
> August 16?
> http://sourceware.org/ml/frysk-cvs/2007-q3/msg00648.html
> 
> Is there any public discussion of the audit?

fedora-devel and fedora-maintainers has lots, but those are super busy
lists: http://www.redhat.com/mailman/listinfo/fedora-devel-list
https://www.redhat.com/archives/fedora-maintainers/

This particular issue came up here first I believe:
https://www.redhat.com/archives/fedora-maintainers/2007-August/msg00264.html

Cheers,

Mark

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

* Re: Disassembly source buffer and libopcodes
  2007-08-22 14:51   ` Mark Wielaard
@ 2007-08-22 16:02     ` Elena Zannoni
  2007-08-22 18:13       ` Mark Wielaard
  0 siblings, 1 reply; 5+ messages in thread
From: Elena Zannoni @ 2007-08-22 16:02 UTC (permalink / raw)
  To: Mark Wielaard; +Cc: frysk

Mark Wielaard wrote:
> Hi Elena,
>
> On Wed, 2007-08-22 at 10:25 -0400, Elena Zannoni wrote:
>   
>>> Since Fedora did a license audit and found we were linking in libopcodes
>>> from binutils which is under GPL, but we distribute Frysk under GPL +
>>> Exception, automatic libopcode usage has been disabled (you need to
>>> configure --with-libopcodes to get it). 
>>>       
>> Thanks for discussing this on the mailing list, can you explain a bit 
>> more about it?
>> I wasn't aware of the audit, is this a RH thing? or a fedora thing? Does 
>> it impact frysk in other ways?
>>     
>
> It is a Fedora thing. They are cleaning up the package license tags:
> http://fedoraproject.org/wiki/PackagingDrafts/LicenseTag
> This means all packages are audited now. The main Frysk license is GPL +
> Exception so we can link with non-gpl compatible code like eclipse. One
> of the maintainers noticed that we were using binutils (libopcodes)
> which is GPL-only though, so cannot be used in a larger work with EPL
> code.
>
>   
>> I assume this is reason for the change Andrew made on
>> August 16?
>> http://sourceware.org/ml/frysk-cvs/2007-q3/msg00648.html
>>
>> Is there any public discussion of the audit?
>>     
>
> fedora-devel and fedora-maintainers has lots, but those are super busy
> lists: http://www.redhat.com/mailman/listinfo/fedora-devel-list
> https://www.redhat.com/archives/fedora-maintainers/
>
> This particular issue came up here first I believe:
> https://www.redhat.com/archives/fedora-maintainers/2007-August/msg00264.html
>
> Cheers,
>
> Mark
>
>   

Thanks, I see Andrew replied to that thread, so what is the impact on 
frysk?
Do we switch to GPLv3 or just ignore since we have our copy of 
libopcodes (and keep that at GPLv2?)



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

* Re: Disassembly source buffer and libopcodes
  2007-08-22 16:02     ` Elena Zannoni
@ 2007-08-22 18:13       ` Mark Wielaard
  0 siblings, 0 replies; 5+ messages in thread
From: Mark Wielaard @ 2007-08-22 18:13 UTC (permalink / raw)
  To: Elena Zannoni; +Cc: frysk

Hi Elena,

On Wed, 2007-08-22 at 12:01 -0400, Elena Zannoni wrote:
> Thanks, I see Andrew replied to that thread, so what is the impact on 
> frysk?
> Do we switch to GPLv3 or just ignore since we have our copy of 
> libopcodes (and keep that at GPLv2?)

Unfortunately neither is an option atm :{

We have one other GPLv2-only dependency elfutils. elfutils does have the
same special exception for linking it with eclipse code into a larger
work as frysk has, but binutils/libopcodes is GPL-only and unfortunately
the EPL isn't GPL compatible (neither with version 2 nor version 3).

So we have to either ditch the EPL eclipse code (so the exception isn't
needed and we can just use pure GPL), ask the Eclipse people to dual
license under the GPL, or find an disassembler that is compatible with
both the GPL and EPL code.

Cheers,

Mark

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

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

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-22 12:26 Disassembly source buffer and libopcodes Mark Wielaard
2007-08-22 14:27 ` Elena Zannoni
2007-08-22 14:51   ` Mark Wielaard
2007-08-22 16:02     ` Elena Zannoni
2007-08-22 18:13       ` Mark Wielaard

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).