Hi Jan, On Sat, 28 Jul 2012, Jan Kratochvil wrote: > 7.4.1 is too old. Here is a patch against a fresh checkout from the git mirror. > Primarily linux_nat_find_memory_regions is now reworked and renamed as > linux_find_memory_regions as GDB can now gcore also from remotely run process > via gdbserver. The testcase should be verified it also works with gdbserver > afterwards, see gdb/testsuite/boards/native-gdbserver.exp. I only tested the added test case: make -C gdb/testsuite/ check RUNTESTFLAGS="gdb.base/gcore-relro.exp" make -C gdb/testsuite/ check RUNTESTFLAGS="--target_board=native-gdbserver gdb.base/gcore-relro.exp" > Also there should be descriptive comments before each modified function. > I can write those otherwise. I'm not sure what kind you expect, so I'll let you write them. :-) > Here is missing a check: > if (separate_debug_objfile_backlink != NULL) > continue; > as separate debug info files (in /usr/lib/debug, sometimes with .debug > extension) are irrelevant for gcore. Should be good now. > Therefore if "Anonymous:" entry is not present at all (=not supported by > Linux kernel on that host) we must write out very every area as we have > no way to verify for swap-cached pages (having Anonymous > 0). > > Sure if "Anonymous:" is present and it is > 0 it also must be written > out. Ditto. > You can reproduce the "Anonymous:" problem with > http://people.redhat.com/jkratoch/relroswap.c > although it is not suitable for GDB testsuite as it needs to do huge memory > allocations to swap out (+swap in) the testcase pages. > (If you have a better idea how to make "Anonymous:" entry non-zero it is sure > welcome. I have tried madvise (MADV_DONTNEED) but it does not work.) Starting the test makes my desktop unusable (no SSD for swap yet), so I cowardly gave up. > > +set testfile "gcore-relro" > > Is hould use 'standard_testfile' like other testcases recently modified > by Tom Tromey. I hope that's ok now. Cheers, Jean-Marc -- saffroy@gmail.com