Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* placing a breakpoint at a physical address on x86 with gdb
@ 2007-01-12 11:42 Mathieu Lacage
  2007-01-12 12:48 ` Mathieu Lacage
  0 siblings, 1 reply; 10+ messages in thread
From: Mathieu Lacage @ 2007-01-12 11:42 UTC (permalink / raw)
  To: gdb

hi,

I would like to place a breakpoint at a physical address only within a
single process: the idea is that I would like to be able to place a
single breakpoint to catch every call to a given function which could be
mapped at different virtual addresses within a single process.

As far as I can tell, x86 debug registers are of no help since they are
specified to interpret the breakpoint address before any virtual to
physical address translation happens. So, I would need to place multiple
local breakpoints, one for each address at which my function is mapped. 

Another way would be to map my function multiple times in memory but
manage to mark each mapping to shared the same underlying physical
memory and then insert an int3 breakpoint in the underlying physical
memory. However, I do not see any way to do this with the existing mmap
syscall: its MAP_PRIVATE flag will make each mapping independent of the
others (which is not what I want) while its MAP_SHARED will potentially
modify the underlying file when I insert the int3.

Yet another alternative would be to create a shared memory segment with
shm_open, copy the code of my function in there, create multiple memory
mappings with mmap (MAP_SHARED) on that shared memory segment and insert
an int3 in the shared memory segment whenever needed.

Is there anyone who could think of other, simpler, alternatives ?

Mathieu
-- 


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2007-01-12 23:26 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-12 11:42 placing a breakpoint at a physical address on x86 with gdb Mathieu Lacage
2007-01-12 12:48 ` Mathieu Lacage
2007-01-12 13:46   ` help string for "break" command Mathieu Lacage
2007-01-12 13:49     ` Daniel Jacobowitz
2007-01-12 14:20       ` Mathieu Lacage
2007-01-12 14:26         ` Daniel Jacobowitz
2007-01-12 14:27         ` Bob Rossi
2007-01-12 14:34           ` Mathieu Lacage
2007-01-12 18:11       ` mathieu lacage
2007-01-12 23:26         ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox