X Tutup
The Wayback Machine - https://web.archive.org/web/20200915031005/https://github.com/cs01/gdbgui/pull/296
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

Ensure "--args" is last argument of gdb command #296

Merged
merged 5 commits into from Dec 20, 2019
Merged

Conversation

@jhgoebbert
Copy link
Contributor

jhgoebbert commented Oct 5, 2019

To debug an application+command line arguments "--args" is used as last command line argument of gdbgui. Everything after "--args" must be passed then to gdb also as LAST command line argument.
This was not the case, but it is now ensured. By default gdb is now used in any case with "--args".

  • I tested the code with gdb 8.3
  • I removed the deepcopy() as it is IMHO not required.
@cs01
Copy link
Owner

cs01 commented Oct 7, 2019

Thanks, looks good to me. I fixed the missing import that caused the build to fail, but otherwise am leaving unchanged.

@cs01
Copy link
Owner

cs01 commented Oct 7, 2019

I did some testing and found it didn't work if --args wasn't passed, at least in gdb 8.1.

Test plan for my changes:

Run the following and after each, confirm "Load Binary" still works (if the mi2 interpreter flag isn't passed to gdb, this isn't apparent until the binary is loaded).

  • python -m gdbgui
  • python -m gdbgui -n
  • python -m gdbgui -n --args /home/csmith/git/gdbgui/examples/c/hello_c.a asdf

Can anyone confirm this fixes their issues? cc @zhidvegi, @sammcdsam

fixes #272

jhgoebbert and others added 4 commits Oct 5, 2019
To debug an application+command line arguments "--args" is used as last command line argument of gdbgui.
Everything after "--args" must be passed then to gdb also as LAST command line argument.
This was not the case, but it is now ensured. By default gdb is now used in any case with "--args".
@cs01 cs01 force-pushed the jhgoebbert:master branch from fe657e6 to f025d5a Oct 8, 2019
@cs01
Copy link
Owner

cs01 commented Oct 24, 2019

I'll leave this open a couple more days if anyone wants to test it before I merge it to master.

@cs01 cs01 merged commit d292f2f into cs01:master Dec 20, 2019
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
cs01 added a commit that referenced this pull request Jul 14, 2020
* Ensure "--args" is last argument of gdb command

To debug an application+command line arguments "--args" is used as last command line argument of gdbgui.
Everything after "--args" must be passed then to gdb also as LAST command line argument.
This was not the case, but it is now ensured. By default gdb is now used in any case with "--args".

* fix formatting

* only pass args when they are present

* add unit tests

* add additional test case

Co-authored-by: Chad Smith <chad@grassfedcode.com>
cs01 added a commit that referenced this pull request Jul 14, 2020
* Ensure "--args" is last argument of gdb command

To debug an application+command line arguments "--args" is used as last command line argument of gdbgui.
Everything after "--args" must be passed then to gdb also as LAST command line argument.
This was not the case, but it is now ensured. By default gdb is now used in any case with "--args".

* fix formatting

* only pass args when they are present

* add unit tests

* add additional test case

Co-authored-by: Chad Smith <chad@grassfedcode.com>
cs01 added a commit that referenced this pull request Jul 18, 2020
* Ensure "--args" is last argument of gdb command

To debug an application+command line arguments "--args" is used as last command line argument of gdbgui.
Everything after "--args" must be passed then to gdb also as LAST command line argument.
This was not the case, but it is now ensured. By default gdb is now used in any case with "--args".

* fix formatting

* only pass args when they are present

* add unit tests

* add additional test case

Co-authored-by: Chad Smith <chad@grassfedcode.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.
X Tutup