Skip to content

Ability to execute in parallel (GDB) #29

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

Merged
merged 1 commit into from
Sep 16, 2024

Conversation

Vipul-Cariappa
Copy link
Contributor

Fixes #27

Test with

// main.c

#include<unistd.h>

int main() {
    sleep(5); // sleep for 5 secs
    return 1;
}

Previously it would take ~11 secs. Now it takes ~6 secs.

Copy link
Contributor Author

@Vipul-Cariappa Vipul-Cariappa left a comment

Choose a reason for hiding this comment

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

I have left few queries above. Please have a look at it.

Comment on lines +39 to +42
# make sure all output is flushed
# time.sleep(.005)
self.base_gdb_instance.send((("",), {"timeout_sec": 60}))
raw_result += self.base_gdb_instance.recv()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do we need this?
I observed that we do not have this in the run_single_special_command function.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this is a remaining of the previous efforts to capture GDB response where we listened for stdout output. I think this is no longer needed since we are using the other approach based on the IoManager.

Comment on lines +101 to +104
try:
parsed_dict = json.loads(processed_output)
except json.JSONDecodeError:
parsed_dict = processed_output
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This change is related to the JSONDecodeError we were talking about.
Without this change, I am getting the JSON error.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe there are certain cases where the processed_output is not in the correct format and json.loads fails to parse it.

Copy link
Collaborator

@mvassilev mvassilev left a comment

Choose a reason for hiding this comment

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

LGTM

@vgvassilev vgvassilev merged commit 32547b6 into compiler-research:main Sep 16, 2024
@Vipul-Cariappa Vipul-Cariappa deleted the multi-process branch September 16, 2024 13:22
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.

Feature Request: Parallel Execution of GDB commands
3 participants