Menu

#453 super breakpoint

open
nobody
Debugger (24)
5
2012-10-15
2009-08-23
Peter
No

patch the bochs20090818, added sbreak command to the debugger
http://code.google.com/p/peter-bochs/wiki/peterBochDebugger

Discussion

  • Peter

    Peter - 2009-08-23
     
  • Peter

    Peter - 2009-10-29

    hello ??

     
  • Stanislav Shwartsman

    The patch lacks x86-64 support.
    I probably could try to add it myself but we are busy with cleaning bugs and preparing for next 2.4.2 release.

    Stanislav

     
  • Peter

    Peter - 2009-11-10

    thank you so much, I hope I can give some help on enhancing the debug command.

     
  • Stanislav Shwartsman

    Hi, today I tried to merge your patch ... with no success.

    1. It even doesn't compile.

    2. void bx_dbg_search_memory_command(bx_address from, bx_address length, bx_address value) {

    3. Bit8u tempBuffer[length];

    there is no such way of allocating variable length buffer in C++ - it is not Java :(

    Also I double if anybody interested in looking for number in memory.

    1. bx_dbg_gdt_command is perfect copy-paste of existsing "info gdt" command bx_dbg_info_gdt_command. Don't see any reason of adding it.

    2. Please rename your 'super breakpoint' to register breakpoint and write some sort of usage docs for this new feature.

    3. I am agains copy-paste switches like:

    4. switch(reg) {

    5. case 0:
    6. reg_val = BX_CPU(dbg_cpu)->get_reg32(BX_32BIT_REG_EAX);
    7. break;
    8. case 1:
    9. reg_val = BX_CPU(dbg_cpu)->get_reg32(BX_32BIT_REG_ECX);
    10. break;
    11. case 2:
    12. reg_val = BX_CPU(dbg_cpu)->get_reg32(BX_32BIT_REG_EDX);
    13. break;
    14. case 3:
    15. reg_val = BX_CPU(dbg_cpu)->get_reg32(BX_32BIT_REG_EBX);
    16. break;
    17. case 4:
    18. reg_val = BX_CPU(dbg_cpu)->get_reg32(BX_32BIT_REG_ESP);
    19. break;
    20. case 5:
    21. reg_val = BX_CPU(dbg_cpu)->get_reg32(BX_32BIT_REG_EBP);
    22. break;
    23. case 6:
    24. reg_val = BX_CPU(dbg_cpu)->get_reg32(BX_32BIT_REG_ESI);
    25. break;
    26. case 7:
    27. reg_val = BX_CPU(dbg_cpu)->get_reg32(BX_32BIT_REG_EDI);
    28. break;
    29. }

    especially when you already have

    typedef enum {
    BX_DBG_REG32_EAX,
    BX_DBG_REG32_ECX,
    BX_DBG_REG32_EDX,
    BX_DBG_REG32_EBX,
    BX_DBG_REG32_ESP,
    BX_DBG_REG32_EBP,
    BX_DBG_REG32_ESI,
    BX_DBG_REG32_EDI,
    BX_DBG_REG32_R8,
    BX_DBG_REG32_R9,
    BX_DBG_REG32_R10,
    BX_DBG_REG32_R11,
    BX_DBG_REG32_R12,
    BX_DBG_REG32_R13,
    BX_DBG_REG32_R14,
    BX_DBG_REG32_R15
    } Regs32;

    defined in debug.h.

    You could see that your switch could be replaced by single line

    • reg_val = BX_CPU(dbg_cpu)->get_reg32(reg);

    The same in other places.

    1. Please do not include automatically generated files (lexer.c, parser.c and parser.h) in your patch !!!

    2. Please do not mix between 'range watchpoints' and 'register breakpoints' in one 'super breakpoints' name. They are not the same. In fact 'range watchpoints' should be extension of existing now 'watchpoints' but I can't do it now - GUI debugger is too dirty and uses watchpoints in dirty way which must be cleaned up first.

    I hope you could prepare better cleaner patch.

    Thanks,
    Stanislav

     
  • Konrad Grochowski

    • void bx_dbg_search_memory_command(bx_address from, bx_address length,
      bx_address value) {
    • Bit8u tempBuffer[length];

    it is in standard (C99 I believe) but as far as I know only gcc supports it (MSVC reports this as an error)

     
  • Peter

    Peter - 2010-01-26

    Ihank hcorg, I tested in fedora 10 gcc only.

     

Log in to post a comment.