c++ - Saving and restarting a paused gdb session -


my understanding gdb can monitor complete state of running program. can save gdb session paused @ breakpoint , resume session later?

my first attempt generating core dump in first gdb session paused @ breakpoint , using core dump start second gdb session.

saving core file in gdb

this resulted in following error.

program terminated signal sigtrap, trace/breakpoint trap. 

so breakpoint information inserted program state, interesting. on second attempt did same time added same breakpoint second session in first session.

getting gdb save list of breakpoints?

still, same error.

can save , restart gdb session? if so, how?

i don't think directly relevant i'm getting warning.

warning: core file may not match specified executable file. 

is gdb stating such thing possible in general or gdb believe may have happened in running session? i'm confident same executable produced core dump being run under gdb.

edit: else comes along, question: save process' memory later use? adds mats petersson's answer , links article: http://blogs.msdn.com/b/oldnewthing/archive/2004/04/20/116749.aspx interesting read. linked question has suggestion of wrapping process in vm.

i doubt ever work. handles files , other resources (semaphores, shared memory, serial ports, network connections , lots of other things) program has opened/created lost when save core-file. can inspect it, can't "continue". core-file copy of memory original program using. else "lost" when program terminates. in other words, core-file useful inspect things later on, can't run, step or continue in core-file debug session. "look @ things". , if can't execute, breakpoints won't work either... ;)


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -