New in development

  • boxmein
    29th Aug 2013 Former Staff 0 Permalink
    @china-richway2 (View Post)
    Erm, if you have a debugger (OllyDbg, gdb) you'd need to learn to use it. Sadly I can't teach you. :o
  • MiningMarsh
    30th Aug 2013 Member 0 Permalink

    True warriors use printf debugging.

     

    Quickly sticking in some printfs with some important info can be lifesaving (though it's probably because I am too lazy to learn to use a gdb).

  • china-richway2
    30th Aug 2013 Member 0 Permalink

    @boxmein (View Post)

    I have OllyDbg(EDIT: Also WinDbg) but I usually uses it for disassembling. So I can't watch the varibles :D

     

    EDIT: I just tried to compile a debug version but it says 'Can't find pthreadGC2.dll' Can anyone help?

    Edited once by china-richway2. Last: 30th Aug 2013
  • mniip
    30th Aug 2013 Developer 0 Permalink
    @MiningMarsh (View Post)
    printf works when the bugged code isn't called thousands of times per seconds, and the program doesn't SEGV.

    for the first problem, i just raise(SIGUSR1) in erroneous place, and use gdb to look at the variables. Same with second, gdb, wait for SIGSEGV, and explore stack and variables; i figured out #127 that way
  • china-richway2
    30th Aug 2013 Member 0 Permalink

    @mniip (View Post)

    It says that GDB runs under Unix. But I have Windows. Could you tell me how to use Ollydbg to read/write variables and see the stack?

  • boxmein
    30th Aug 2013 Former Staff 0 Permalink
    @china-richway2 (View Post)
    You can use Cheat Engine to write variables (but you need to know memory locations)
  • mniip
    31st Aug 2013 Developer 1 Permalink
    @boxmein (View Post)
    cheatengine is for entirely different purpose, i mean, you can debug with it, but on low-level assembly level.
    @china-richway2 (View Post)
    i think you can mingw-get gdb EDIT:mingw-get install gdb and you will have mingw version of gdb on your MSYS
    Edited once by mniip. Last: 2nd Sep 2013
  • china-richway2
    2nd Sep 2013 Member 0 Permalink

    @mniip (View Post)

    It says 'command not found'. Weird, it works with the turtorial

  • mniip
    2nd Sep 2013 Developer 0 Permalink
    @china-richway2 (View Post)
    you're using git bash, not cmd, are you
    EDIT: oh wait, yes, read my edit on the above post
    Edited once by mniip. Last: 2nd Sep 2013