Peter-bochs A better bochs for os developer

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
dion
Posts: 1
Joined: Mon Nov 09, 2009 9:43 am

Re: Peter-bochs A better bochs for os developer

Post 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.
User avatar
mcheung63
Member
Member
Posts: 175
Joined: Thu Jun 22, 2006 8:33 am
Location: Hong Kong
Contact:

Re: Peter-bochs A better bochs for os developer

Post 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
User avatar
mcheung63
Member
Member
Posts: 175
Joined: Thu Jun 22, 2006 8:33 am
Location: Hong Kong
Contact:

Re: Peter-bochs A better bochs for os developer

Post by mcheung63 »

Added a history panel on the bottom. you can compare the value of registers of each break.

Image
stlw
Member
Member
Posts: 357
Joined: Fri Apr 04, 2008 6:43 am
Contact:

Re: Peter-bochs A better bochs for os developer

Post 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
User avatar
mcheung63
Member
Member
Posts: 175
Joined: Thu Jun 22, 2006 8:33 am
Location: Hong Kong
Contact:

Re: Peter-bochs A better bochs for os developer

Post by mcheung63 »

thanks :)

I correct it and submit it later. thanks for your effort
User avatar
Owen
Member
Member
Posts: 1700
Joined: Fri Jun 13, 2008 3:21 pm
Location: Cambridge, United Kingdom
Contact:

Re: Peter-bochs A better bochs for os developer

Post by Owen »

Bochs DOES support plugins!
User avatar
mcheung63
Member
Member
Posts: 175
Joined: Thu Jun 22, 2006 8:33 am
Location: Hong Kong
Contact:

Re: Peter-bochs A better bochs for os developer

Post by mcheung63 »

hi owen, where i can find the plugin development guide?
User avatar
Owen
Member
Member
Posts: 1700
Joined: Fri Jun 13, 2008 3:21 pm
Location: Cambridge, United Kingdom
Contact:

Re: Peter-bochs A better bochs for os developer

Post 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.
Post Reply