Page 2 of 2

Re: Peter-bochs A better bochs for os developer

Posted: Mon Nov 09, 2009 9:54 am
by dion
would like a opcodes logger command... like one in mame debugger, can shorten a loop.
i was having hard time using bosch, because of limited debugger commands.

Re: Peter-bochs A better bochs for os developer

Posted: Sun Nov 15, 2009 3:27 am
by mcheung63
hi, may I know what is opcode logger? Is that mean you want to display the instruction start from current eip?
If possible, please give me a screendump of name debugger opcode logger, I can't find it.
thanks

Re: Peter-bochs A better bochs for os developer

Posted: Tue Nov 17, 2009 1:59 am
by mcheung63
Added a history panel on the bottom. you can compare the value of registers of each break.

Image

Re: Peter-bochs A better bochs for os developer

Posted: Thu Nov 19, 2009 11:45 am
by stlw
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

Re: Peter-bochs A better bochs for os developer

Posted: Thu Nov 19, 2009 12:19 pm
by mcheung63
thanks :)

I correct it and submit it later. thanks for your effort

Re: Peter-bochs A better bochs for os developer

Posted: Thu Nov 19, 2009 3:57 pm
by Owen
Bochs DOES support plugins!

Re: Peter-bochs A better bochs for os developer

Posted: Fri Nov 20, 2009 3:03 am
by mcheung63
hi owen, where i can find the plugin development guide?

Re: Peter-bochs A better bochs for os developer

Posted: Fri Nov 20, 2009 10:46 am
by Owen
I don't know - I've only used Bochs, never coded for it - but it uses plugins to, for example, select it's UI.