Category: Debug Method Development

  • debug method development with “ls” command

    $gdb /bin/ls GNU gdb (Debian 7.11.1-2) 7.11.1 Copyright (C) 2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type “show copying” and “show warranty” for details. This GDB was…

  • gdb backtrace for a chromium hangup

    (gdb) bt #0 pthread_cond_timedwait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:238 #1 0x00007f9d69721343 in base::ConditionVariable::TimedWait (this=0x7fffdb12b308, max_time=…) at ../../base/synchronization/condition_variable_posix.cc:102 #2 0x00007f9d696fde2c in base::WaitableEvent::TimedWait (this=0x7f9d705c0540, max_time=…) at ../../base/synchronization/waitable_event_posix.cc:214 #3 0x00007f9d696dcc16 in base::MessagePumpDefault::Run (this=0x7f9d705c0530, delegate=0x7fffdb12b570) at ../../base/message_loop/message_pump_default.cc:56 #4 0x00007f9d696edc51 in base::RunLoop::Run (this=0x7fffdb12b3e0) at ../../base/run_loop.cc:49 #5 0x00007f9d696da157 in base::MessageLoop::Run (this=) at ../../base/message_loop/message_loop.cc:308 #6 0x00007f9d6c310ffc in content::RendererMain (parameters=…) at ../../content/renderer/renderer_main.cc:227 #7 0x00007f9d696a31de in…

  • Project Euler Problem 2, solution internals related using ruby debugger

    $ruby -rdebug euler-two.rb Debug.rb Emacs support available. /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:57: RUBYGEMS_ACTIVATION_MONITOR.enter (rdb:1) r /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:57: RUBYGEMS_ACTIVATION_MONITOR.enter (rdb:1) r /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:57: RUBYGEMS_ACTIVATION_MONITOR.enter (rdb:1) next /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:143: RUBYGEMS_ACTIVATION_MONITOR.exit (rdb:1) next euler-two.rb:3:n1, n2 = 1, 2 (rdb:1) next euler-two.rb:4:sum = 0 (rdb:1) print n1 1nil (rdb:1) print n2 2nil (rdb:1) next euler-two.rb:6:while n2 < 4000000 (rdb:1) print n2 2nil (rdb:1) next euler-two.rb:7:sum +=…

  • Project Euler Problem 3, solution internals using python debugger

    $python -m pdb euler-three.py > /home/jeffrin/beautifulwork/lib/euler-three.py(7)() -> ”’ (Pdb) r 6857 –Return– > /home/jeffrin/beautifulwork/lib/euler-three.py(17)()->None -> print n (Pdb) next –Return– > (1)()->None (Pdb) next The program finished and will be restarted > /home/jeffrin/beautifulwork/lib/euler-three.py(7)() -> ”’ (Pdb) next > /home/jeffrin/beautifulwork/lib/euler-three.py(9)() -> n = 600851475143 (Pdb) next > /home/jeffrin/beautifulwork/lib/euler-three.py(11)() -> i = 2 (Pdb) next > /home/jeffrin/beautifulwork/lib/euler-three.py(12)()…

  • Project Euler Problem 2, solution internals using python debugger

    $python -m pdb project-euler-2.py > /home/jeffrin/beautifulwork/lib/project-euler-2.py(13)() -> ”’ (Pdb) next > /home/jeffrin/beautifulwork/lib/project-euler-2.py(15)() -> cache = {} (Pdb) next > /home/jeffrin/beautifulwork/lib/project-euler-2.py(16)() -> def fib(n): (Pdb) next > /home/jeffrin/beautifulwork/lib/project-euler-2.py(20)() -> n = 0 (Pdb) next > /home/jeffrin/beautifulwork/lib/project-euler-2.py(21)() -> i = 0 (Pdb) next > /home/jeffrin/beautifulwork/lib/project-euler-2.py(22)() -> while fib(i) /home/jeffrin/beautifulwork/lib/project-euler-2.py(23)() -> if not fib(i) % 2: n =…

  • GDB backtrace For chromium hangup

    (gdb) bt #0 pthread_cond_timedwait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:238 #1 0x00007fb512be9443 in ?? () #2 0x00007fb512bc9d0d in ?? () #3 0x00007fb512bacb0f in ?? () #4 0x00007fb512bbc7d1 in ?? () #5 0x00007fb512baa03a in ?? () #6 0x00007fb51537aea8 in ?? () #7 0x00007fb512b7d045 in ?? () #8 0x00007fb512b7de1e in ?? () #9 0x00007fb512b7cc30 in ?? () #10 0x00007fb512569698 in…

  • How to compile a program to use electric fence library for debugging ?

    $cat efence-p1.c #include <stdio.h> #include <stdlib.h> int main() { char *ptr = (char *) malloc(1024); ptr[0] = 0; ptr[1024] = 0; exit(0); } $gcc -g efence-p1.c -lefence $./a.out Electric Fence 2.2 Copyright (C) 1987-1999 Bruce Perens <bruce@perens.com> Segmentation fault $

  • DEBUG Method Development . LOG.0.2

    method to downgrade debian from a unstable tree to stable tree step 1 put the following content in /etc/apt/preferences.d/default Package: * Pin: release a=stable Pin-Priority: 1001 step 2 make your sources.list to stable pointers. step 3 apt-get update apt-get upgrade next do sensibly To Fix Things, work on a stable system and chroot to the…

  • backtrace for iceweasel related hangup

    (gdb) bt #0 0x00007fc68928b99d in pthread_join (threadid=1404900385100136, thread_return=0x0) at pthread_join.c:89 #16 0x00007fc68773d8e8 in XRE_main (argc=, argv=, aAppData=) at nsAppRunner.cpp:3331 #17 0x00000000004024df in main (argc=1, argv=0x7fffaa9352c8) at nsXULStub.cpp:493