Hi, today I tried to merge your patch to Bochs tree ... with no success.
1. It even doesn't compile.
+ void bx_dbg_search_memory_command(bx_address from, bx_address length, bx_address value) {
+ Bit8u tempBuffer[length];
there is no such way of allocating variable length buffer in C++ - it is not Java
Also I doubt if anybody interested in looking for number in memory.
2. 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.
3. Please rename your 'super breakpoint' to register breakpoint and write some sort of usage docs for this new feature.
4. I am agains copy-paste switches like:
+ switch(reg) {
+ case 0:
+ reg_val = BX_CPU(dbg_cpu)->get_reg32(BX_32BIT_REG_EAX);
+ break;
+ case 1:
+ reg_val = BX_CPU(dbg_cpu)->get_reg32(BX_32BIT_REG_ECX);
+ break;
+ case 2:
+ reg_val = BX_CPU(dbg_cpu)->get_reg32(BX_32BIT_REG_EDX);
+ break;
+ case 3:
+ reg_val = BX_CPU(dbg_cpu)->get_reg32(BX_32BIT_REG_EBX);
+ break;
+ case 4:
+ reg_val = BX_CPU(dbg_cpu)->get_reg32(BX_32BIT_REG_ESP);
+ break;
+ case 5:
+ reg_val = BX_CPU(dbg_cpu)->get_reg32(BX_32BIT_REG_EBP);
+ break;
+ case 6:
+ reg_val = BX_CPU(dbg_cpu)->get_reg32(BX_32BIT_REG_ESI);
+ break;
+ case 7:
+ reg_val = BX_CPU(dbg_cpu)->get_reg32(BX_32BIT_REG_EDI);
+ break;
+ }
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.
5. Please do not include automatically generated files (lexer.c, parser.c and parser.h) in your patch !!!
6. 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