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 under argc] ctrl-c leads to terminate, not interrupt #49

Closed
jminh opened this issue Nov 5, 2022 · 1 comment
Closed

[gdb under argc] ctrl-c leads to terminate, not interrupt #49

jminh opened this issue Nov 5, 2022 · 1 comment

Comments

@jminh
Copy link

jminh commented Nov 5, 2022

In gdb the default behavior of ctrl-c is to interrupt the process. For example:

  (gdb) c
  Continuing.
  ^C
  Thread 1 "main" received signal SIGINT, Interrupt.
  0x00002aaab428480d in nanosleep () from /lib64/libc.so.6
  (gdb)

But if run gdb from argc, ctrl-c would terminate the gdb debug process.

# @cmd debug
debug () {
  gdb -p `pgrep main` \
     -ex 'c'
  #exec gdb -p `pgrep main` \
  #   -ex 'c'
}
argc debug
 # in gdb 
 # ctrl-c would terminate the debug process.

Its exit code is 130 and the output is like:

  ^C
  
  Thread 1 "main" received signal SIGINT, Interrupt.
  [Switching to Thread 0x2aaaaab30640 (LWP 177491)]
  0x00002aaab5bfa80d in nanosleep () from /lib64/libc.so.6
  (130)

Is there any solution or workaround to not terminate the gdb?

@sigoden
Copy link
Owner

sigoden commented Nov 13, 2022

argc is now just a command line argument parsing tool. The task runner related functions were moved into runme.

sigoden/runme#2 fixed this issue.

@sigoden sigoden closed this as completed Nov 15, 2022
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

No branches or pull requests

2 participants