Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coverage #303

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Coverage #303

wants to merge 9 commits into from

Conversation

svkf
Copy link

@svkf svkf commented Oct 18, 2017

add extra_file support for code coverage and save_temps
merge split dwarf into that setup
should be backward compatible
added tests for various combinations of the extra files

svkf added 5 commits October 17, 2017 08:58
and a few log messages
reowkr the -pipe in conjunction with -save-temps
though need to get rid of all using namespace std is better
but for another commit
@@ -55,7 +55,7 @@ if test "$GCC" = yes; then
-Wshadow -Wpointer-arith $cast_align -Wwrite-strings \
-Waggregate-return -Wstrict-prototypes -Wmissing-prototypes \
-Wnested-externs $CFLAGS"
CXXFLAGS=" -g -W -Wall -Wpointer-arith $cast_align $wshadow -Wwrite-strings $CXXFLAGS"
CXXFLAGS=" -std=gnu++11 -g -W -Wall -Wpointer-arith $cast_align $wshadow -Wwrite-strings $CXXFLAGS"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is okay, but I would prefer a minimum level of this, while allowing higher standards if the compiler supports it... (I'm working on cmake which handles this easier than autotools this so don't worry about it)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah just the code get so much nicer ... for the for () loops
I can rewrite it the old way ... and remove if you want

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I'm saying that if C++14 is available I want to use that instead of C++11.

I'm not sure how far back we want to support C++ standards, maybe the next release should require C++11, and C++17 for the one after that?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My vote would be c++ 14 for the next release, and 17 after that. For what it's worth, I've seen several areas of code that could profit from string_view in C++ 17.

daemon/main.cpp Outdated
@@ -602,7 +602,7 @@ bool Daemon::setup_listen_fds()

myaddr.sun_family = AF_UNIX;

mode_t old_umask = -1U;
mode_t old_umask = (mode_t)-1U;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

odn't use C style cases - I think you want static_cast here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, personally I jut hate the extra typing :)


// we could ignore this, except the silly gcc-4.8 thing with tthe caret fails the tests due
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tthe - fix the typo in this comment


// we could ignore this, except the silly gcc-4.8 thing with tthe caret fails the tests due
// to having -pipe and -save-temps=obj
for (std::list<string>::const_iterator it = list.begin();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why didn't you use auto here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just copied the line below it ...
was sort of last minute, I didn't have this fix in my original since I don't use 4.8 normally but it happened to be on the box I was using

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

problem was the test failed since it got some stderr and the 4.8 thing
but didn't actually error (even with -Werror), normally for my setup it just kept going ...
gcc: warning: -pipe ignored because -save-temps specified
I was looking at the fix in my setup to just clean it up but figured its so rarely used ... I didn't care (till the test failed)

@HenryMiller1
Copy link
Collaborator

It looks good on first glance. I see some minor style issues. I'll need to look at it a little longer, but thanks for the work.

I'll want @johnmiked15 to look at it too to make sure I'm not missing something, if he is still around

@HenryMiller1
Copy link
Collaborator

This fixes #187

@svkf
Copy link
Author

svkf commented Oct 18, 2017

one issue is the API
the 38 is for all extra_files but then there is an implicit API on the enum/string too
so technically on any new extra_files you would have to raise the number even though the messaging stayed the same
if you don't a new client (-fxxxx) would ask for 38 and if old server (38 but not with new enum) it would fail to get that data
or a old client may use some -fxxx and the remote would look for it (38 with new enum) and send back
but the client wouldn't actually be expecting it since it wouldn't loop through that next one ...

not sure how to handle that .. (just bump API on new enum?) and ensure checked in minVersion?
which is consistent
could not use enum and tack extra bytes for each enum ... but then that would be more code each change which I don't like

and static cast on broken mode_t for mac/c++ vs C-cast
@HenryMiller1
Copy link
Collaborator

Would it be possible to send to the remote a list of files to send back? Then the version 38 clients are compatible with new file types. Otherwise just put a comment by the enum that you need to update the protocol version when the enum changes.

@svkf
Copy link
Author

svkf commented Oct 18, 2017

unfortunately that doesn't help
(new client, old server)
you send a,b,c it only can send back a,b
so it would say pass ... but wouldn't actually work the way you want
the scheduler needs to know which guy to pick for what you want
I could add to the scheduler message GetCSMsg() (in 38) the max enum, then it can use that plus the API#
then its just automatic and no updates needed

(I did something myself adding a custom/API version so that if I added messages on my own I don't pollute the API space on new update from git
(ie naming users, user stats etc.)

client/arg.cpp Outdated
@@ -720,6 +726,23 @@ bool analyse_argv(const char * const *argv, CompileJob &job, bool icerun, list<s

job.setFlags(args);
job.setOutputFile(ofile);
if (seen_split_dwarf) {
// need to do after the output file is set */
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the c style comment end - this is a C++ comment

tests/test.sh Outdated
abort_tests
fi
fi
# note thiese differ a bit based on the args passed to compiler
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spelling - thiese-> these

services/job.h Outdated

void setExtraOutputFile(uint32_t index, const std::string &file)
{
//printf("setExtraOutputFile[%d] = %s\n", index, file.c_str());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dead code, please remove, or use the standard logging means to log this

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will do these, just been away

Copy link
Collaborator

@HenryMiller1 HenryMiller1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 comments need tweaking. Since nobody else has look at this in a week I'll merge as soon as they are fixed unless someone sees something wrong I don't.

@dantje
Copy link
Contributor

dantje commented Jan 20, 2018

I tried to rebase these commits against master in (https://github.com/dantje/icecream/commits/coverage) and got this to compile and at least it claims to transmit gcno files.

@jdrouhard jdrouhard removed their assignment Mar 5, 2018
@deriamis deriamis self-assigned this Jun 12, 2022
@deriamis
Copy link

I'm going to look into this during the next week or so and see if I can revive it. At this point (years later), I think we should just go for C++17, so I'll see if I can go in that direction - though I would like to keep GNU extensions out of it if I can.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants