LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 06-02-2014, 11:01 PM   #1
xmllmx
LQ Newbie
 
Registered: May 2014
Posts: 5

Rep: Reputation: Disabled
How to remotely break a running debuggee like `echo g > /proc/sysrq-trigger`?


When debugging an OS kernel with two machines,if the kernel is NT and the debugger is WinDBG, then the human user can press Ctrl+Break on the host machine to enforce the target machine to break into a debugable state.

However, if the kernel is Linux and the debugger is gdb + kgdb, then the human user cannot do the same like the NT user does. The Linux user can only type the following command on the target machine:

`echo g > /proc/sysrq-trigger`

I think it is not convenient, is there a way to enforce the remote target break into a debugable sate?
 
Old 06-05-2014, 01:28 PM   #2
dijetlo
Senior Member
 
Registered: Jan 2009
Location: RHELtopia....
Distribution: Solaris 11.2/Slackware/RHEL/
Posts: 1,491
Blog Entries: 2

Rep: Reputation: Disabled
Quote:
I think it is not convenient, is there a way to enforce the remote target break into a debugable sate?
BAM
Code:
#!/bin/bash
# a script named "BAM" to trigger kernel crashes
#
echo g > /proc/sysrg-trigger
Secure shell to the target machine, move the script into /bin chmod it 777 then type
"#BAM"
You will not be further inconvenienced.
BTW, if you have kgdb installed properly and your kernel correctly configured, you can put a variation of that script on your own machine and do it from there

Last edited by dijetlo; 06-05-2014 at 01:30 PM.
 
  


Reply

Tags
debugging


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
sync; echo 3 > /proc/sys/vm/drop_caches? wstewart90 Linux - Server 6 06-01-2014 12:45 PM
echo 0 /proc/sys/kernel/hung_task_timeout finsh Linux - Server 3 07-18-2013 08:01 AM
missing file??? /proc/sys/kernel/sysrq bad_gui Linux - General 4 08-18-2006 11:37 PM
echo '214748364' > /proc/sys/kernel/shmmax rubendarioportillo SUSE / openSUSE 1 11-03-2005 07:05 PM
echo '214748364' > /proc/sys/kernel/shmmax SwannAnderson Linux - General 2 11-03-2005 03:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 07:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration