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

--gdb flag does not work #454

Closed
veripoolbot opened this issue Mar 9, 2012 · 5 comments
Closed

--gdb flag does not work #454

veripoolbot opened this issue Mar 9, 2012 · 5 comments
Labels
area: invoking/options Issue involves options passed to Verilator resolution: fixed Closed; fixed

Comments

@veripoolbot
Copy link
Contributor


Author Name: Jeremy Bennett (@jeremybennett)
Original Redmine Issue: 454 from https://www.veripool.org
Original Date: 2012-03-09
Original Assignee: Jeremy Bennett (@jeremybennett)


Although not documented in the main manual, the internals guide notes the use of --gdb to start Verilator tests under the GNU debugger.

The internals document is slightly in error, since the usage is not --gdb, but --gdb , thus giving the user the option of using another debugger (for example ddd).

The other problem is that the invocation of gdb is constructed as:

gdb $VERILATOR_ROOT/verilator_bin_dbg <verilator arg> <verilator arg> ...

GDB does not pass arguments to the inferior (i.e. the program being debugged) in this way, it expects them to be preceded by --args:

gdb $VERILATOR_ROOT/verilator_bin_dbg --args <verilator arg> <verilator arg> ...

This requires a small modification to the verilator PERL script, which in turn requires that any debugger used with the --gdb option to Verilator follow this convention.

I attach a patch against current git HEAD (commit 0ae00fc) for these changes.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2012-03-09T13:28:19Z


Yup, need some more documentation here, thanks for the patch.

The --gdb flag presumes a script which starts gdb. Note --gdb on a test invocation (test_regress/t/t_FOO.pl --gdb) presumes that script "gdbrun" by default.

--args intentionally isn't there because some non-gdb debuggers do not support that switch.

I can put the gdbrun script into the distribution but that doesn't feel right as it has personal preferences and is another layer that people shouldn't have to be burdened with.

My inclination then is to make --gdb behave like --gdbbt without the automatic exit. If VERILATOR_GDB environment variable is set it will override this behavior and allow an arbitrary script to be called (for other debuggers).

Make sense?

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2012-03-09T13:47:22Z


Actually that will make running ddd a pain. I think VERILATOR_GDB should presume gdb-like behavior.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Jeremy Bennett (@jeremybennett)
Original Date: 2012-03-09T15:04:43Z


That all seems reasonable. We have to assume that anyone playing with --gdb is technically reasonably competent, so we really just need to update the documentation to explain how it is supposed to work.

Would you like me to update the documentation?

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2012-03-09T23:38:15Z


Fixed in git towards 3.833.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2012-04-15T20:40:12Z


In 3.833.

@veripoolbot veripoolbot added area: invoking/options Issue involves options passed to Verilator resolution: fixed Closed; fixed labels Dec 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: invoking/options Issue involves options passed to Verilator resolution: fixed Closed; fixed
Projects
None yet
Development

No branches or pull requests

1 participant