Getting emacs realgud:pry to work - emacs

Need some help getting realgud to play nice with pry-remote.
This is a sample ruby file (x.rb)
require 'pry-remote'
class Foo
def initialize(x, y)
binding.remote_pry
puts "hello"
end
end
Foo.new(1,3)
In a shell buffer:
bash: ruby x.rb
[pry-remote] Waiting for client on druby://127.0.0.1:9876
# check that I have a listening process
bash: ss -nlt
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 128 127.0.0.1:9876 *:*
In emacs:
M-x realgud:pry
pry-remote ; enter this at the prompt
This is what I see in emacs;
File Edit Options Buffers Tools Inf-Ruby Debugger Help
32: end
33:
34: return_value
35: end
=>[0G[1] pry(#<PryNav::Tracer>)>
-=--:**--F1 *pry +No filename+ shell* Bot L53 (Comint:r
stop unless RUBY_VERSION == '1.9.2'
return_value = nil
command = catch(:breakout_nav) do # Coordinates w$
return_value = yield
=> {} # Nothing thrown == no navigational command
end
-=--:%%--F1 tracer.rb 24% L21 (Ruby ShortKeys) ---
My question is: why am I seeing the breakpoint in tracer.rb? How do I get the breakpoint
to be in my source file?
Hitting 'n' twice in the source window causes the shell buffer to echo the following, but there
is no change in the source window itself.
=>[0G[1] pry(#<PryNav::Tracer>)> next 1
next 1
Also, the 'u' and 'd' keystrokes yield
Command down is not implemented for this debugger
Command up is not implemented for this debugger

Related

WinDBG Conditional Breakpoint on NtCreateFile

Debugging Windows 10 with WinDBG, I have attached to the OS through a COM tunnel.
I am in a running process and would like to break when it tries to open a specific file called "MyFile".
What I have done is add a breakpoint on ntdll!NtCreateFile and when it breaks I use the following command to check the filename:
dt _OBJECT_PROPERTIES #r8
Which gives me :
+ 0x10 ObjectName : 0xADDRESS_OF_STRING C:/Folder/NotMyFile
The problem being that this function is called quite a lot of times so my debugging is too slow. Is there a way I can automate this using the conditional breakpoint of WinDBG?
!process 0 0 YourProcessName
Example
kd> !process 0 0 calc.exe
PROCESS 85c9ed40 SessionId: 1 Cid: 0ae8 Peb: 7ffdd000 ParentCid: 075c
DirBase: 7e248560 ObjectTable: e44da728 HandleCount: 71.
Image: calc.exe
grab the EPROCESS Address from this
and set a process specific breakpoint like
bp /p 85c9ed40 nt!NtCreateFile
this should drastically cutdown the hits and would only break when NtCreateFile is being invoked under your process
go for conditionals only if your process opens many files or opens this specific several times otherwise you wont need any conditionals

`ls` command not working as expected in windbg

I'm debugging a piece of code and I got it to break at an exception. I have the relevant source and symbol paths set up, but when I use ls, it doesn't show or list the current source file, even when it highlights the line in the open source file I'm interested in when I select the correct stack frame.
Why is that? What am I not understanding? What is meant by 'current source file'?
When you are on an address where source file is not available (like _dbgbreakpoint on ntdll) issuing ls will emit the message "No current source file":
0:000> ln #eip
(7c90120e) ntdll!DbgBreakPoint | (7c901212) ntdll!DbgUserBreakPoint
Exact matches:
ntdll!DbgBreakPoint = <no type information>
0:000> ls
No current source file
ls by itself requires a preloaded source file using lsf or you need to set the .srcpath.
This loaded source file remains loaded until you remove it or another source file is loaded automatically by an event (i.e. if you do .restart and break on _dbgbreak and do a ls, it will show the stale source file that was loaded with lsf earlier):
0:000> .restart
ntdll!DbgBreakPoint:
7c90120e cc int 3
0:000> ls
77: PAttributeHeader psecondheader = NULL ;
78: PAttributeHeader pthirdheader = NULL;
79: PFileInfoAttributeRecord pfinforecord = NULL;
80:
81: memset(&dump,0,sizeof(dump));
82: fopen_s( &fp,"\\\\.\\PHYSICALDRIVE0", "rb" );
Using lsa . (notice the .) instead of ls, it loads the source for the current address.
The current line is denoted by > in the paste below .
Notice ls fails due to no pre loaded source file whereas lsa . gives you the source line.
0:000> g wmain
00401000 55 push ebp
0:000> ls
No current source file
0:000> lsa .
67: }FileInfoAttributeRecord,*PFileInfoAttributeRecord;
68:
69:
70: int _tmain(int argc, _TCHAR* argv[])
> 71: {

Unbound variable error in slimv with mit-scheme

After trying to start swank server from vim (or after executing the command
scheme --load /usr/share/emacs/site-lisp/slime/contrib/swank-mit-scheme.scm
from terminal prompt) I get the following error:
Image saved on Tuesday November 8, 2011 at 10:40:30 PM
Release 9.1.1 || Microcode 15.3 || Runtime 15.7
SF 4.41 || LIAR/i386 4.118 || Edwin 3.116
;Loading "/usr/share/emacs/site-lisp/slime/contrib/swank-mit-scheme.scm"...
;Unbound variable: o
;To continue, call RESTART with an option number:
; (RESTART 3) => Specify a value to use instead of o.
; (RESTART 2) => Define o to a given value.
; (RESTART 1) => Return to read-eval-print level 1.
It seems that the error is caused by the line:
(define-generic inspect (o))
Any ideas what can I do?
Try to run swank-mit-scheme.scm embedded in Slimv. It is slightly modified: it loads options and runs swank server in an infinite loop.

supervisorctl ERROR (abnormal termination)

When I run sudo supervisorctl start stage then I get ERROR (abnormal termination). Will you please take look?
Here is my file /etc/supervisord.conf. Am i missing something? thanks
[unix_http_server]
file=/tmp/supervisor.sock ; (the path to the socket file)
[supervisord]
logfile=/tmp/supervisord.log ; (main log file;default $CWD/supervisord.log)
logfile_maxbytes=50MB ; (max main logfile bytes b4 rotation;default 50MB)
logfile_backups=10 ; (num of main logfile rotation backups;default 10)
loglevel=info ; (log level;default info; others: debug,warn,trace)
pidfile=/tmp/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
nodaemon=false ; (start in foreground if true;default false)
minfds=1024 ; (min. avail startup file descriptors;default 1024)
minprocs=200 ; (min. avail process descriptors;default 200)
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
[supervisorctl]
serverurl=unix:///tmp/supervisor.sock ; use a unix:// URL for a unix socket
[program:stage]
command=/home/me/envs/project/bin/python /home/me/webapps/project/manage.py run_gunicorn -b 127.0.0.1:8002 --log-file=/tmp/stage_gunicorn.log
directory=/home/me/webapps/project/
user=www-data
autostart=true
autorestart=true
stdout_logfile=/tmp/stage_supervisord.log
redirect_stderr=true
I meet the same problem as yours. As Martijn Pieters saying, it doesn't mean that something goes wrong with your supervisorctl. It just tells you that the program didn't work. You can find some error details in the log.
It indicated error so find it using below command :
supervisorctl tail <APP_NAME>
This error is occurring due to the underlying stage application is not running properly. To fix the error, you can simply go to your console and run the command that you are passing. In your case:
It is
/home/me/envs/project/bin/python /home/me/webapps/project/manage.py run_gunicorn -b 127.0.0.1:8002 --log-file=/tmp/stage_gunicorn.log
It will show you the error that need to be fixed
It means that your APP is wrong.
Go and check [program:stage] section, path or something is not c
Just edit the log level to trace then restart supervisord and see what happened from the supervisor log.
[supervisord]
loglevel=trace
sudo systemctl restart supervisord.service
tail -f /path/to/supervisord.log
When the problem has been resolved, modify the loglevel to info.

SBCL error with cl-smtp

This is a recent error that I can't find any documentation for. It might not be cl-smtp specific, but it occurs each time I attempt to evaluate
(cl-smtp:send-email "localhost" "source#email.com" "test#email.com" "TEST" "Testing email from Common Lisp")
from the REPL. The error output is
debugger invoked on a SB-INT:SIMPLE-PROGRAM-ERROR in thread #<THREAD
"initial thread" RUNNING
{AAE38D1}>:
invalid keyword argument: :SERVE-EVENTS (valid keys are :AUTO-CLOSE, :INPUT,
:OUTPUT, :ELEMENT-TYPE, :EXTERNAL-FORMAT, :BUFFERING, :TIMEOUT).
Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.
restarts (invokable by number or by possibly-abbreviated name):
0: [ABORT] Exit debugger, returning to top level.
(SB-PCL::CHECK-APPLICABLE-KEYWORDS
0
(:AUTO-CLOSE :INPUT :OUTPUT :ELEMENT-TYPE :EXTERNAL-FORMAT :BUFFERING
:TIMEOUT)
-303677905
10)
0] 0
I'm running Debian 6 with postfix and SBCL 1.0.40, and cl-smtp installed via quicklisp. Sending email through the telnet interface with the same source, server, target, subject and body (whether from the same unix user or with root) works fine. This setup also works fine (even from the REPL) on other machines that run the same software stack.
Can anyone see what I'm doing wrong?
That particular error is not coming from cl-smtp. Miscellany googling suggests that it's an internal API mimatch. Looking at the available flags, it seems as if it's a socket error( input, output, buffering, timeout).
SBCL 40 is almost a year old, SBCL 51 is fresh off the presses... I suggest upgrading!