debugging - GDB find command error "warning: Unable to access x bytes of target memory at y, halting search" -


i'm trying find current flag count in kmines using gdb. know should memory mappings first avoid non-existent memory locations. ran info proc mappings command see memory segments. picked random memory gap (0xd27000-0x168b000) result , executed find command this: find 0x00d27000, 0x0168b000, 10

but got warning: unable access 1458 bytes of target memory @ 0x168aa4f, halting search. error. although address 0x168aa4f between 0xd27000 , 0x168b000, gdb says can't access it. why happen? can avoid situation? or there way ignore unmapped/unaccessible memory locations?

edit: tried set value of address 0x168aa4f 1 , works, gdb can access address gives error when used find command. why?

i guess have solved own problem, can't believe how simple solution was. thing did decrease 2nd parameter's value one. code should find 0x00d27000, 0x0168afff, 10 because linux allocates memory using maps in [x,y) format, if line in root/proc/pid/maps says this;

01a03000-0222a000 rw-p 

the memory allocated includes 0x01a03000 not 0x0222a000. hope silly mistake of mine helps :d

edit: root of problem algorithm implemented in target.c(gdb's source code mean) algorithm reads , searches memory chunks @ size of 16000 bytes. if last byte of chunk invalid, gdb throw entire chunk trash , won't give proper information invalid byte, reports beginning of current chunk.


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -