On 10/09/2014 11:17 AM, joaoandrefe...@sapo.pt wrote: > Hello all, > > I'm trying to use KGDB for some days now, and since I'm still getting > some errors that need to be fixed (working on it), I think that for > now it's better to ask here if what I'm trying to achieve is > theoretically possible with KGDB. I'm trying to do some kind of fault > injection, and so what I'm planning to do is: > > 1. Interrupt whatever is running in the OS (this, of course, includes > the OS itself);
This is something you don't necessarily need kgdb/kdb for. You might consider using a kprobe with a hardware break point, assuming you are on an architecture that has support, else you can strategically select your point of entry. > > 2. Be able to call some kind of service routine to handle the > interruption (an interrupt handler, I guess). This interrupt handler > would inject a fault (e. g. bit-flip a breakpoint register, or the > stack of the process that was interrupted, etc, i.e. something > "critical" for the OS); > > 3. Resume OS execution and be able to access the context of the > process interrupted (i. e., > https://www.princeton.edu/~achaney/tmve/wiki100k/docs/Context_switch.html); > > I know that it seems that some of these requirements are present in > KGDB, at least after reading the manual and some tutorials. But can > someone confirm or deny that the above is indeed possible with KGDB? > If the answer is positive, in a conceptual, general way, how would I > achieve that? > KGDB assumes there is an external agent talking to your running system. It would seem you want to scramble some kernel memory on demand, and there is certainly more than one way to achieve that. Certainly you can write a loadable kernel module or use a kprobe. It almost seems like you are looking for the ability to inject a few commands to the kernel debugger and continue. The kgdb test suite actually does do that because it pretends to be an I/O module (not unlike your serial port or keyboard). This also requires you to create a kernel module however. If you are looking for some kind of generic support to inject a command I had contemplated doing a few times, but have never really found a case that required it. Cheers, Jason. ------------------------------------------------------------------------------ Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk _______________________________________________ Kgdb-bugreport mailing list Kgdb-bugreport@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kgdb-bugreport