List Info

Thread: how to align breakpoint address




how to align breakpoint address
user name
2007-07-13 03:40:25
Hello,

Following is a question when porting GDB.
 
If user set breakpoint at invalid address such as 0x1001, I
would align it 
to 0x1000 in function target_breakpoint_from_pc.
But, after this breakpoint, step will not work. 

It seems that there is something wrong in function
bpstat_stop_status ():

        if (b->loc->address != bp_addr)         /*
address doesn't match 
*/
          continue;

b->loc->address is 0x1001, while bp_addr is 0x1000,
but 
b->loc->placed_address is 0x1000.
I think b->loc->placed_address should be used to
compare with bp_addr.

Anyone can tell me the truth? Or how to align a breakpoint
address?

Thanks.

              Ligang

Re: how to align breakpoint address
user name
2007-07-13 19:54:53
You could try adding an `adjust_breakpoint_address' method
for your
port.  See frv_adjust_breakpoint_address() in frv-tdep.c for
an
example.

That said, it's probably better to assume that the GDB user
knows
what he (or she) is doing and allow the breakpoint to be
placed at
the user specified location.  Most breakpoints are placed
using symbolic
addresses, so this is usually not a problem.

Kevin

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )