On Thu, Apr 26, 2012 at 3:27 PM, Philippe Waroquiers
<philippe.waroqui...@skynet.be> wrote:
> On Thu, 2012-04-26 at 14:17 -0400, Matt Broadstone wrote:
>
>> and then:
>>   (gdb) target remote | /usr/local/bin/vgdb
>>   | /usr/local/bin/vgdb: Undefined error: 0
> You must have a version of gdb recent enough (I believe >= 6.5)
> otherwise GDB does not understand the "|" target.
>
> Two alternatives:
>  * compile + install a recent GDB
>    (there is a kind of "magic" security signing which is needed).
>  * alternatively:
>      valgrind --vgdb-error=0 prog
>      # and then in another shell, run:
>      vgdb --port=1234
>      # in a third shell:
>      gdb prog
>      (gdb) target remote :1234
>
>    (NB: with this technique, there is no security: anybody which
>     have access to your system can connect to the vgdb port nr).
>
> Philippe
>

Okay, I was able to get that working. Here is the result of
disassembling that instruction:

Program received signal SIGILL, Illegal instruction.
warning: Error 268435459 getting port names from mach_port_names
[Switching to process 4359 thread 0x0]
0x0000000003a36b8c in __abort ()
(gdb) disas
Dump of assembler code for function __abort:
0x0000000003a36aab <__abort+0>: push   %rbp
0x0000000003a36aac <__abort+1>: mov    %rsp,%rbp
0x0000000003a36aaf <__abort+4>: push   %rbx
0x0000000003a36ab0 <__abort+5>: sub    $0x18,%rsp
0x0000000003a36ab4 <__abort+9>: cmpq   $0x0,0x9cf6c(%rip)        #
0x3ad3a28 <gCRAnnotations+8>
0x0000000003a36abc <__abort+17>:        jne    0x3a36acc <__abort+33>
0x0000000003a36abe <__abort+19>:        lea    0x6f2b3(%rip),%rax        #
0x3aa5d78 <__rcsid_37+80>
0x0000000003a36ac5 <__abort+26>:        mov    %rax,0x9cf5c(%rip)        #
0x3ad3a28 <gCRAnnotations+8>
0x0000000003a36acc <__abort+33>:        movq   $0x0,-0x18(%rbp)
0x0000000003a36ad4 <__abort+41>:        movl   $0x0,-0xc(%rbp)
0x0000000003a36adb <__abort+48>:        movl   $0xffffffff,-0x10(%rbp)
0x0000000003a36ae2 <__abort+55>:        mov    $0x6,%edi
0x0000000003a36ae7 <__abort+60>:        lea    -0x18(%rbp),%rsi
0x0000000003a36aeb <__abort+64>:        xor    %edx,%edx
0x0000000003a36aed <__abort+66>:        callq  0x3a97c1c <sigaction>
0x0000000003a36af2 <__abort+71>:        andb   $0xdf,-0x10(%rbp)
0x0000000003a36af6 <__abort+75>:        lea    0xa34b3(%rip),%rax        #
0x3ad9fb0 <__is_threaded>
0x0000000003a36afd <__abort+82>:        cmpl   $0x0,(%rax)
0x0000000003a36b00 <__abort+85>:        lea    -0x10(%rbp),%rbx
0x0000000003a36b04 <__abort+89>:        je     0x3a36b4c <__abort+161>
0x0000000003a36b06 <__abort+91>:        movl   $0xffffffff,-0x1c(%rbp)
0x0000000003a36b0d <__abort+98>:        lea    -0x1c(%rbp),%rsi
0x0000000003a36b11 <__abort+102>:       mov    $0x3,%edi
0x0000000003a36b16 <__abort+107>:       xor    %edx,%edx
0x0000000003a36b18 <__abort+109>:       callq  0x3a9c772 <dyld_stub_sigprocmask>
0x0000000003a36b1d <__abort+114>:       mov    $0x1,%edi
0x0000000003a36b22 <__abort+119>:       xor    %al,%al
0x0000000003a36b24 <__abort+121>:       callq  0x3a42e3b 
<__pthread_workqueue_setkill>
0x0000000003a36b29 <__abort+126>:       mov    $0x3,%edi
0x0000000003a36b2e <__abort+131>:       mov    %rbx,%rsi
0x0000000003a36b31 <__abort+134>:       xor    %edx,%edx
0x0000000003a36b33 <__abort+136>:       callq  0x3a42ca7 <pthread_sigmask>
0x0000000003a36b38 <__abort+141>:       callq  0x3a97540 <pthread_self>
0x0000000003a36b3d <__abort+146>:       mov    $0x6,%esi
0x0000000003a36b42 <__abort+151>:       mov    %rax,%rdi
0x0000000003a36b45 <__abort+154>:       callq  0x3a45773 <pthread_kill>
0x0000000003a36b4a <__abort+159>:       jmp    0x3a36b6c <__abort+193>
0x0000000003a36b4c <__abort+161>:       mov    $0x3,%edi
0x0000000003a36b51 <__abort+166>:       xor    %edx,%edx
0x0000000003a36b53 <__abort+168>:       mov    %rbx,%rsi
0x0000000003a36b56 <__abort+171>:       callq  0x3a9c772 <dyld_stub_sigprocmask>
0x0000000003a36b5b <__abort+176>:       callq  0x3a9c4f0 <dyld_stub_getpid>
0x0000000003a36b60 <__abort+181>:       mov    $0x6,%esi
0x0000000003a36b65 <__abort+186>:       mov    %eax,%edi
0x0000000003a36b67 <__abort+188>:       callq  0x3a9c54a <dyld_stub_kill>
0x0000000003a36b6c <__abort+193>:       mov    $0x2710,%edi
0x0000000003a36b71 <__abort+198>:       callq  0x3a36c43 <usleep$NOCANCEL>
0x0000000003a36b76 <__abort+203>:       movl   $0xffffffe7,-0x10(%rbp)
0x0000000003a36b7d <__abort+210>:       mov    $0x3,%edi
0x0000000003a36b82 <__abort+215>:       xor    %edx,%edx
0x0000000003a36b84 <__abort+217>:       mov    %rbx,%rsi
0x0000000003a36b87 <__abort+220>:       callq  0x3a9c772 <dyld_stub_sigprocmask>
0x0000000003a36b8c <__abort+225>:       ud2a
End of assembler dump.
(gdb)

Matt

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to