Re: V2 Add DWARF support to the rtemstoolkit and put it to use.

2018-05-12 Thread Vijay Kumar Banerjee
On 11 May 2018 at 11:50, Cillian O'Donnell  wrote:

> At the moment when the tester runs covoar the error messages generated are
> a clear indicator of what is wrong, so task list is dictated by what
> they're saying at the moment. Fixing the mismatch between exe.cov and .cov
> is the next thing. The name is given as an argument to the -exec option of
> the qemu cmd and is picked up from leon3-qemu-cov. Have a look at that and
> see can you fix it.
>

The attached diff fixes the mismatch.
shall we start a new thread for tester support ?
diff --git a/tester/covoar/covoar.cc b/tester/covoar/covoar.cc
index 5bed98f..95dc990 100644
--- a/tester/covoar/covoar.cc
+++ b/tester/covoar/covoar.cc
@@ -185,7 +185,7 @@ int main(
   Executables   executablesToAnalyze;
   Coverage::ExecutableInfo* executableInfo = NULL;
   std::string   executableExtension = "exe";
-  std::string   coverageExtension = "cov";
+  std::string   coverageExtension = ".cov";
   Coverage::CoverageFormats_t   coverageFormat = Coverage::COVERAGE_FORMAT_QEMU;
   Coverage::CoverageReaderBase* coverageReader = NULL;
   char* executable = NULL;
@@ -317,11 +317,12 @@ int main(
 std::cerr << "warning: Unable to read executable: " << argv[i] << std::endl;
   } else {
 coverageFileName = argv[i];
-coverageFileName.replace(
+	coverageFileName.append(coverageExtension);
+ /* coverageFileName.replace(
   coverageFileName.length() - executableExtension.size(),
   executableExtension.size(),
   coverageExtension
-);
+); */
 
 if (!FileIsReadable( coverageFileName.c_str() )) {
   std::cerr << "warning: Unable to read coverage file: " << coverageFileName
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: Errors returned while building a SPARC tool set

2018-05-12 Thread Joel Sherrill
On Sat, May 12, 2018 at 1:42 AM, Amaan Cheval 
wrote:

> On Sat, May 12, 2018 at 2:48 AM, Chris Johns  wrote:
> > On 11/5/18 3:02 am, Joel Sherrill wrote:
> >>
> >> https://ftp.rtems.org/pub/rtems/people/chrisj/doc-
> online/4.11/rsb/hosts.html#xubuntu
> >>
> >
> > Where is this link being found?
>
> I've seen the link a few times through Google.
>
> The one mentioned above shows a 404 now, but another one I've seen is
> still active:
> https://ftp.rtems.org/pub/rtems/people/chrisj/source-
> builder/source-builder.html
>
>
That has links to two non-doc items in his ftp tree. They may also be wrong
at this point.


> >
> > The permanent link for the documentation is here:
> >
> >  https://docs.rtems.org/branches/master/rsb/hosts.html#xubuntu
> >
> > I have moved that personal directory off the ftp server. I am not sure
> why it is
> > there.
> >
> > Chris
> > ___
> > devel mailing list
> > devel@rtems.org
> > http://lists.rtems.org/mailman/listinfo/devel
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: V2 Add DWARF support to the rtemstoolkit and put it to use.

2018-05-12 Thread Joel Sherrill
Please start a new thread with the patch in "git format-patch" format.
Keeping
a long thread going makes it hard to distinguish issues.

On Sat, May 12, 2018 at 2:14 PM, Vijay Kumar Banerjee <
vijaykumar9...@gmail.com> wrote:

>
> On 11 May 2018 at 11:50, Cillian O'Donnell  wrote:
>
>> At the moment when the tester runs covoar the error messages generated
>> are a clear indicator of what is wrong, so task list is dictated by what
>> they're saying at the moment. Fixing the mismatch between exe.cov and .cov
>> is the next thing. The name is given as an argument to the -exec option of
>> the qemu cmd and is picked up from leon3-qemu-cov. Have a look at that and
>> see can you fix it.
>>
>
> The attached diff fixes the mismatch.
> shall we start a new thread for tester support ?
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

[PATCH] covoar: fixing the extension mismatch in trace file

2018-05-12 Thread thelunatic
---
 tester/covoar/covoar.cc | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/tester/covoar/covoar.cc b/tester/covoar/covoar.cc
index 5bed98f..95dc990 100644
--- a/tester/covoar/covoar.cc
+++ b/tester/covoar/covoar.cc
@@ -185,7 +185,7 @@ int main(
   Executables   executablesToAnalyze;
   Coverage::ExecutableInfo* executableInfo = NULL;
   std::string   executableExtension = "exe";
-  std::string   coverageExtension = "cov";
+  std::string   coverageExtension = ".cov";
   Coverage::CoverageFormats_t   coverageFormat = 
Coverage::COVERAGE_FORMAT_QEMU;
   Coverage::CoverageReaderBase* coverageReader = NULL;
   char* executable = NULL;
@@ -317,11 +317,12 @@ int main(
 std::cerr << "warning: Unable to read executable: " << argv[i] << 
std::endl;
   } else {
 coverageFileName = argv[i];
-coverageFileName.replace(
+   coverageFileName.append(coverageExtension);
+ /* coverageFileName.replace(
   coverageFileName.length() - executableExtension.size(),
   executableExtension.size(),
   coverageExtension
-);
+); */
 
 if (!FileIsReadable( coverageFileName.c_str() )) {
   std::cerr << "warning: Unable to read coverage file: " << 
coverageFileName
-- 
2.14.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH] covoar: fixing the extension mismatch in trace file

2018-05-12 Thread Joel Sherrill
On Sat, May 12, 2018 at 2:42 PM, thelunatic 
wrote:

> ---
>

Every patch needs an explanation/log message.  Look back through
"git log" for examples.


>  tester/covoar/covoar.cc | 7 ---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/tester/covoar/covoar.cc b/tester/covoar/covoar.cc
> index 5bed98f..95dc990 100644
> --- a/tester/covoar/covoar.cc
> +++ b/tester/covoar/covoar.cc
> @@ -185,7 +185,7 @@ int main(
>Executables   executablesToAnalyze;
>Coverage::ExecutableInfo* executableInfo = NULL;
>std::string   executableExtension = "exe";
> -  std::string   coverageExtension = "cov";
> +  std::string   coverageExtension = ".cov";
>

Why did this need a "." but the "exe" one didn't?


>Coverage::CoverageFormats_t   coverageFormat =
> Coverage::COVERAGE_FORMAT_QEMU;
>Coverage::CoverageReaderBase* coverageReader = NULL;
>char* executable = NULL;
> @@ -317,11 +317,12 @@ int main(
>  std::cerr << "warning: Unable to read executable: " << argv[i] <<
> std::endl;
>} else {
>  coverageFileName = argv[i];
> -coverageFileName.replace(
> +   coverageFileName.append(coverageExtension);
> + /* coverageFileName.replace(
>coverageFileName.length() - executableExtension.size(),
>executableExtension.size(),
>coverageExtension
> -);
> +); */
>


If you are replacing this call, then just delete it -- don't comment it out.


>  if (!FileIsReadable( coverageFileName.c_str() )) {
>std::cerr << "warning: Unable to read coverage file: " <<
> coverageFileName
> --
> 2.14.3
>
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: How do I convert a C program to an .exe file?

2018-05-12 Thread Danxue Huang
Hey Amaan,

Thank you so much for your detailed answer! I have figured it out following
the instructions. Since I read various versions of staring instructions,
files are kind of messed up in my machine, I just redo everything from the
beginning and then it works. I really appreciate your help!

Best,
Dannie

On Sat, May 12, 2018 at 1:40 AM Amaan Cheval  wrote:

> Hey!
>
> It looks like you're trying to compile the testsuite within the core
> repository itself. This isn't how it's done because the core repo
> provides the basis for specific BSP targets - for eg. how would the
> Makefile for the core repo know which cross-compiler to use, with
> which configure options you provided, etc.? This is generally called
> an in-tree build (i.e. within the source-tree itself). My
> understanding is that RTEMS does not do any in-tree builds whatsoever.
>
> You need an out-of-tree build (i.e. where you have "build-dir-sparc"
> and "rtems-kernel" directories as siblings, for eg.). This is
> described as a quickstart in the docs here:
> https://docs.rtems.org/branches/master/user/start/index.html
>
> Since you want to also build the testsuite, i.e. an ".exe", you need
> to also supply the "--enable-tests" option to the "configure" command.
>
> This is the procedure for the testsuite, which is what you seem to
> want. For compiling with RTEMS _in general_, for eg. with the
> examples-v2 repo:
> https://git.rtems.org/examples-v2/
>
> You need to use the RTEMS_MAKEFILE_PATH variable. For eg.
>
> make RTEMS_MAKEFILE_PATH=~/repos/rtems/b-i386/i386-rtems5/c/pc386/make
>
> Where b-i386 is the name of my build-directory, i386-rtems5 is the
> name of the target architecture (same as the "--target" option to the
> configure command earlier), and "pc386" is the name of the BSP (same
> as the "--enable-rtemsbsp" option in the configure command earlier).
>
> What I've listed above is the "developer" method. For most users, the
> RSB will be used to install both the target tools (for eg.
> i386-rtems5-gcc) _and_ the RTEMS kernel itself. See the note about
> RTEMS Releases here:
>
> > The RSB found in a release will automatically build and install RTEMS.
> If you do not want a released version of the RSB to build RTEMS add
> --without-rtems to the command line. The development version requires
> adding --with-rtems to build RTEMS. Use this option to create a single
> command to build the tools and RTEMS.
> > The source used in release builds is downloaded from the RTEMS FTP
> server. This ensures the source is always available for a release.
>
> Source:
> https://docs.rtems.org/branches/master/rsb/quick-start.html#building
>
> For future reference: this seems like a question more suitable for the
> rtems-users mailing list, I believe.
>
> Hope that helps!
>
> On Sat, May 12, 2018 at 9:11 AM, Danxue Huang 
> wrote:
> > Hi there,
> >
> > How do I convert a C program to an .exe file? I already got a
> "Makefile", I
> > tried to run "make" but it doesn't work, the output is as below. Thank
> you
> > so much for checking for me!
> >
> > dannie@dannie-VirtualBox
> :~/development/rtems/kernel/rtems/testsuites/samples/hello$
> > make
> > Makefile:14: /Makefile.inc: No such file or directory
> > Makefile:16: /make/leaf.cfg: No such file or directory
> > make: *** No rule to make target '/make/leaf.cfg'.  Stop.
> >
> > Best,
> > Dannie
> >
> > ___
> > devel mailing list
> > devel@rtems.org
> > http://lists.rtems.org/mailman/listinfo/devel
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

[PATCH v2] covoar: fix the extension mismatch in trace file

2018-05-12 Thread thelunatic
- read the trace files with .exe.cov extention
---
 tester/covoar/covoar.cc | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/tester/covoar/covoar.cc b/tester/covoar/covoar.cc
index 5bed98f..f03edc7 100644
--- a/tester/covoar/covoar.cc
+++ b/tester/covoar/covoar.cc
@@ -317,11 +317,7 @@ int main(
 std::cerr << "warning: Unable to read executable: " << argv[i] << 
std::endl;
   } else {
 coverageFileName = argv[i];
-coverageFileName.replace(
-  coverageFileName.length() - executableExtension.size(),
-  executableExtension.size(),
-  coverageExtension
-);
+   coverageFileName.append('.'+coverageExtension);
 
 if (!FileIsReadable( coverageFileName.c_str() )) {
   std::cerr << "warning: Unable to read coverage file: " << 
coverageFileName
-- 
2.14.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: V2 Add DWARF support to the rtemstoolkit and put it to use.

2018-05-12 Thread Chris Johns
On 13/5/18 7:14 am, Vijay Kumar Banerjee wrote:
> 
> On 11 May 2018 at 11:50, Cillian O'Donnell  > wrote:
> 
> At the moment when the tester runs covoar the error messages generated 
> are a
> clear indicator of what is wrong, so task list is dictated by what they're
> saying at the moment. Fixing the mismatch between exe.cov and .cov is the
> next thing. The name is given as an argument to the -exec option of the 
> qemu
> cmd and is picked up from leon3-qemu-cov. Have a look at that and see can
> you fix it.
> 
> 
> The attached diff fixes the mismatch.
> shall we start a new thread for tester support ? 

I did this in the restructure. I planned to fix the extension code so it was
consistent for the executable and coverage files.

Why not change the replace moving it past the '.' in the file name rather than
adding a '.' to the extension?

Chris
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH] covoar: fixing the extension mismatch in trace file

2018-05-12 Thread Chris Johns
Sorry for the post in the other thread. I did not see this one.

On 13/5/18 9:28 am, Joel Sherrill wrote:
> 
> 
> On Sat, May 12, 2018 at 2:42 PM, thelunatic  > wrote:
> 
> ---
> 
> 
> Every patch needs an explanation/log message.  Look back through 
> "git log" for examples.
>  
> 
>  tester/covoar/covoar.cc | 7 ---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/tester/covoar/covoar.cc b/tester/covoar/covoar.cc
> index 5bed98f..95dc990 100644
> --- a/tester/covoar/covoar.cc
> +++ b/tester/covoar/covoar.cc
> @@ -185,7 +185,7 @@ int main(
>    Executables                   executablesToAnalyze;
>    Coverage::ExecutableInfo*     executableInfo = NULL;
>    std::string                   executableExtension = "exe";
> -  std::string                   coverageExtension = "cov";
> +  std::string                   coverageExtension = ".cov";
> 
> 
> Why did this need a "." but the "exe" one didn't? 
>  

Yes I was wondering this and why I made the change to the coverage extension.

> 
>    Coverage::CoverageFormats_t   coverageFormat =
> Coverage::COVERAGE_FORMAT_QEMU;
>    Coverage::CoverageReaderBase* coverageReader = NULL;
>    char*                         executable = NULL;
> @@ -317,11 +317,12 @@ int main(
>          std::cerr << "warning: Unable to read executable: " << argv[i] <<
> std::endl;
>        } else {
>          coverageFileName = argv[i];
> -        coverageFileName.replace(
> +       coverageFileName.append(coverageExtension);
> +     /* coverageFileName.replace(
>            coverageFileName.length() - executableExtension.size(),
>            executableExtension.size(),
>            coverageExtension
> -        );
> +        ); */
> 
> 
>  
> If you are replacing this call, then just delete it -- don't comment it out.
> 

I suggest the replace be changed to move past the '.' in the file name.

I suspect the code here is still fragile because the extensions need to be the
same size.

Chris

> 
>          if (!FileIsReadable( coverageFileName.c_str() )) {
>            std::cerr << "warning: Unable to read coverage file: " <<
> coverageFileName
> -- 
> 2.14.3
> 
> 
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH v2] covoar: fix the extension mismatch in trace file

2018-05-12 Thread Chris Johns
On 13/5/18 3:38 pm, thelunatic wrote:
> - read the trace files with .exe.cov extention
> ---
>  tester/covoar/covoar.cc | 6 +-
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/tester/covoar/covoar.cc b/tester/covoar/covoar.cc
> index 5bed98f..f03edc7 100644
> --- a/tester/covoar/covoar.cc
> +++ b/tester/covoar/covoar.cc
> @@ -317,11 +317,7 @@ int main(
>  std::cerr << "warning: Unable to read executable: " << argv[i] << 
> std::endl;
>} else {
>  coverageFileName = argv[i];
> -coverageFileName.replace(
> -  coverageFileName.length() - executableExtension.size(),
> -  executableExtension.size(),
> -  coverageExtension
> -);
> + coverageFileName.append('.'+coverageExtension);
>  

Please see the other thread.

Chris
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH] covoar: fixing the extension mismatch in trace file

2018-05-12 Thread Vijay Kumar Banerjee
On Sun, 13 May 2018, 10:09 Chris Johns,  wrote:

> Sorry for the post in the other thread. I did not see this one.
>
> On 13/5/18 9:28 am, Joel Sherrill wrote:
> >
> >
> > On Sat, May 12, 2018 at 2:42 PM, thelunatic  > > wrote:
> >
> > ---
> >
> >
> > Every patch needs an explanation/log message.  Look back through
> > "git log" for examples.
> >
> >
> >  tester/covoar/covoar.cc | 7 ---
> >  1 file changed, 4 insertions(+), 3 deletions(-)
> >
> > diff --git a/tester/covoar/covoar.cc b/tester/covoar/covoar.cc
> > index 5bed98f..95dc990 100644
> > --- a/tester/covoar/covoar.cc
> > +++ b/tester/covoar/covoar.cc
> > @@ -185,7 +185,7 @@ int main(
> >Executables   executablesToAnalyze;
> >Coverage::ExecutableInfo* executableInfo = NULL;
> >std::string   executableExtension = "exe";
> > -  std::string   coverageExtension = "cov";
> > +  std::string   coverageExtension = ".cov";
> >
> >
> > Why did this need a "." but the "exe" one didn't?
> >
>
> Yes I was wondering this and why I made the change to the coverage
> extension.
>
> >
> >Coverage::CoverageFormats_t   coverageFormat =
> > Coverage::COVERAGE_FORMAT_QEMU;
> >Coverage::CoverageReaderBase* coverageReader = NULL;
> >char* executable = NULL;
> > @@ -317,11 +317,12 @@ int main(
> >  std::cerr << "warning: Unable to read executable: " <<
> argv[i] <<
> > std::endl;
> >} else {
> >  coverageFileName = argv[i];
> > -coverageFileName.replace(
> > +   coverageFileName.append(coverageExtension);
> > + /* coverageFileName.replace(
> >coverageFileName.length() - executableExtension.size(),
> >executableExtension.size(),
> >coverageExtension
> > -);
> > +); */
> >
> >
> >
> > If you are replacing this call, then just delete it -- don't comment it
> out.
> >
>
> I suggest the replace be changed to move past the '.' in the file name.
>
> I suspect the code here is still fragile because the extensions need to be
> the
> same size.
>
can't this be done by adding '.' in the append as in the v2 of this patch
to keep the extension size same  ?
are you suggesting to use replace instead ?

>
> Chris
>
> >
> >  if (!FileIsReadable( coverageFileName.c_str() )) {
> >std::cerr << "warning: Unable to read coverage file: " <<
> > coverageFileName
> > --
> > 2.14.3
> >
> >
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH] covoar: fixing the extension mismatch in trace file

2018-05-12 Thread Chris Johns
On 13/5/18 4:44 pm, Vijay Kumar Banerjee wrote:
> On Sun, 13 May 2018, 10:09 Chris Johns,  > wrote:
> >
> >        Coverage::CoverageFormats_t   coverageFormat =
> >     Coverage::COVERAGE_FORMAT_QEMU;
> >        Coverage::CoverageReaderBase* coverageReader = NULL;
> >        char*                         executable = NULL;
> >     @@ -317,11 +317,12 @@ int main(
> >              std::cerr << "warning: Unable to read executable: " << 
> argv[i] <<
> >     std::endl;
> >            } else {
> >              coverageFileName = argv[i];
> >     -        coverageFileName.replace(
> >     +       coverageFileName.append(coverageExtension);
> >     +     /* coverageFileName.replace(
> >                coverageFileName.length() - executableExtension.size(),
> >                executableExtension.size(),
> >                coverageExtension
> >     -        );
> >     +        ); */
> >
> >
> >  
> > If you are replacing this call, then just delete it -- don't comment it 
> out.
> >
> 
> I suggest the replace be changed to move past the '.' in the file name.
> 
> I suspect the code here is still fragile because the extensions need to 
> be the
> same size.
> 
> can't this be done by adding '.' in the append as in the v2 of this patch to
> keep the extension size same  ?

It fixes something but what is broken that is being fixed?

> are you suggesting to use replace instead ?

I think it would be better to fix the bug than work around it.

The replace is saying replace from length of the extension back from the end of
the string for the size of the extension with the extension. In other words it
should back up from the end the extension length and replace it. Which length or
size is wrong.

No matter what the current code is fragile because it assumes a few things. The
most robust approach would add code to the rtemstoolkit's rld::path namespace to
return a path with the extension stripped. For example add
'rld::path::strip_extension ()' and then use that to strip coverageFileName and
then add the extension.

I would also review the 'exe' extension usage to make sure it is OK. I have not
done this.

Are you interested in doing this?

Chris
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH] covoar: fixing the extension mismatch in trace file

2018-05-12 Thread Vijay Kumar Banerjee
On 13 May 2018 at 10:50, Chris Johns  wrote:

> On 13/5/18 4:44 pm, Vijay Kumar Banerjee wrote:
> > On Sun, 13 May 2018, 10:09 Chris Johns,  > > wrote:
> > >
> > >Coverage::CoverageFormats_t   coverageFormat =
> > > Coverage::COVERAGE_FORMAT_QEMU;
> > >Coverage::CoverageReaderBase* coverageReader = NULL;
> > >char* executable = NULL;
> > > @@ -317,11 +317,12 @@ int main(
> > >  std::cerr << "warning: Unable to read executable: "
> << argv[i] <<
> > > std::endl;
> > >} else {
> > >  coverageFileName = argv[i];
> > > -coverageFileName.replace(
> > > +   coverageFileName.append(coverageExtension);
> > > + /* coverageFileName.replace(
> > >coverageFileName.length() -
> executableExtension.size(),
> > >executableExtension.size(),
> > >coverageExtension
> > > -);
> > > +); */
> > >
> > >
> > >
> > > If you are replacing this call, then just delete it -- don't
> comment it out.
> > >
> >
> > I suggest the replace be changed to move past the '.' in the file
> name.
> >
> > I suspect the code here is still fragile because the extensions need
> to be the
> > same size.
> >
> > can't this be done by adding '.' in the append as in the v2 of this
> patch to
> > keep the extension size same  ?
>
> It fixes something but what is broken that is being fixed?
>
> the trace files have .exe.cov extensions but the covoar was searching for
.cov extension causing it to return error for not finding the trace file.
Adding the .cov to the coverageFileName to make it .exe.cov seemed like a
quick fix to this .

Do we need the .exe extension there ?

> are you suggesting to use replace instead ?
>
> I think it would be better to fix the bug than work around it.
>
> The replace is saying replace from length of the extension back from the
> end of
> the string for the size of the extension with the extension. In other
> words it
> should back up from the end the extension length and replace it. Which
> length or
> size is wrong.
>
> No matter what the current code is fragile because it assumes a few
> things. The
> most robust approach would add code to the rtemstoolkit's rld::path
> namespace to
> return a path with the extension stripped. For example add
> 'rld::path::strip_extension ()' and then use that to strip
> coverageFileName and
> then add the extension.
>
> I would also review the 'exe' extension usage to make sure it is OK. I
> have not
> done this.
>
> Are you interested in doing this?
>

I can look into this. Any instructions ?

>
> Chris
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel