Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 8228 Details for
Bug 53323
Make implementations of Addr2Line and CPPFile extendable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Synchronize implementations of Addr2line/CPPFilt/Objdump to be extendable
PR53323.patch (text/plain), 4.28 KB, created by
uwe
on 2004-02-27 16:47:59 EST
(
hide
)
Description:
Synchronize implementations of Addr2line/CPPFilt/Objdump to be extendable
Filename:
MIME Type:
Creator:
uwe
Created:
2004-02-27 16:47:59 EST
Size:
4.28 KB
patch
obsolete
>Index: Addr2line.java >=================================================================== >retrieving revision 1.5 >diff -u -r1.5 Addr2line.java >--- Addr2line.java 26 Feb 2004 23:10:24 -0000 1.5 >+++ Addr2line.java 27 Feb 2004 21:44:22 -0000 >@@ -14,23 +14,38 @@ > import org.eclipse.cdt.utils.spawner.ProcessFactory; > > public class Addr2line { >+ private String[] args; > private Process addr2line; > private BufferedReader stdout; > private BufferedWriter stdin; > private String lastaddr, lastsymbol, lastline; > >- public Addr2line(String command, String file) throws IOException { >- String[] args = {command, "-C", "-f", "-e", file}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ >- addr2line = ProcessFactory.getFactory().exec(args); >- stdin = new BufferedWriter(new OutputStreamWriter(addr2line.getOutputStream())); >- stdout = new BufferedReader(new InputStreamReader(addr2line.getInputStream())); >+ public Addr2line(String command, String[] params, String file) throws IOException { >+ init(command, params, file); > } > >+ public Addr2line(String command, String file) throws IOException { >+ this(command, new String[0], file); >+ } >+ > public Addr2line(String file) throws IOException { > this("addr2line", file); //$NON-NLS-1$ > } > >- private void getOutput(String address) throws IOException { >+ protected void init(String command, String[] params, String file) throws IOException { >+ if (params == null || params.length == 0) { >+ args = new String[] {command, "-C", "-f", "-e", file}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ >+ } else { >+ args = new String[params.length + 1]; >+ args[0] = command; >+ System.arraycopy(params, 0, args, 1, params.length); >+ } >+ addr2line = ProcessFactory.getFactory().exec(args); >+ stdin = new BufferedWriter(new OutputStreamWriter(addr2line.getOutputStream())); >+ stdout = new BufferedReader(new InputStreamReader(addr2line.getInputStream())); >+ } >+ >+ protected void getOutput(String address) throws IOException { > if ( address.equals(lastaddr) == false ) { > stdin.write(address + "\n"); //$NON-NLS-1$ > stdin.flush(); >Index: CPPFilt.java >=================================================================== >retrieving revision 1.4 >diff -u -r1.4 CPPFilt.java >--- CPPFilt.java 26 Feb 2004 23:10:24 -0000 1.4 >+++ CPPFilt.java 27 Feb 2004 21:44:22 -0000 >@@ -14,20 +14,34 @@ > import org.eclipse.cdt.utils.spawner.ProcessFactory; > > public class CPPFilt { >+ private String[] args; > private Process cppfilt; > private BufferedReader stdout; > private BufferedWriter stdin; > >- public CPPFilt(String command) throws IOException { >- String[] args = {command}; >- cppfilt = ProcessFactory.getFactory().exec(args); >- //cppfilt = new Spawner(args); >- stdin = new BufferedWriter(new OutputStreamWriter(cppfilt.getOutputStream())); >- stdout = new BufferedReader(new InputStreamReader(cppfilt.getInputStream())); >+ public CPPFilt(String command, String[] params) throws IOException { >+ init(command, params); > } >- >+ >+ public CPPFilt(String command) throws IOException { >+ this(command, new String[0]); >+ } >+ > public CPPFilt() throws IOException { > this("c++filt"); //$NON-NLS-1$ >+ } >+ >+ protected void init(String command, String[] params) throws IOException { >+ if (params == null || params.length == 0) { >+ args = new String[] {command}; >+ } else { >+ args = new String[params.length + 1]; >+ args[0] = command; >+ System.arraycopy(params, 0, args, 1, params.length); >+ } >+ cppfilt = ProcessFactory.getFactory().exec(args); >+ stdin = new BufferedWriter(new OutputStreamWriter(cppfilt.getOutputStream())); >+ stdout = new BufferedReader(new InputStreamReader(cppfilt.getInputStream())); > } > > public String getFunction(String symbol) throws IOException { >Index: Objdump.java >=================================================================== >retrieving revision 1.2 >diff -u -r1.2 Objdump.java >--- Objdump.java 26 Feb 2004 23:10:24 -0000 1.2 >+++ Objdump.java 27 Feb 2004 21:44:23 -0000 >@@ -50,7 +50,7 @@ > this("objdump", new String[0], file); //$NON-NLS-1$ > } > >- void init(String command, String[] params, String file) throws IOException { >+ protected void init(String command, String[] params, String file) throws IOException { > if (params == null || params.length == 0) { > args = new String[] { command, "-C", "-x", "-S", file }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ > } else {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
bjorn.freeman-benson
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 53323
: 8228