Hi Dan,

Does the following not work?

If you would like to have the simulator wait for gdb to attach before
executing you just need to change a line in src/sim/system.cc:
int rgdb_wait = -1;
to rgdb_wait = 0 (If you only have one cpu or the cupid for the one you
want to wait for it to attach to).

Jack

Jack Harvard


On Wed, Feb 5, 2014 at 10:16 PM, Walters, Dan <[email protected]> wrote:

>
>
> What is the recommended way to attach a remote GDB to Gem5 in order to
> debug the program being run in simulation, particularly when the simulated
> program finishes execution very quickly?
>
>
>
> I've read through http://www.m5sim.org/Debugger_Based_Debugging and was
> able to get it working with an example program (hello-world in an infinite
> loop),  but the program that I actually want to debug does *not* have an
> infinite loop, so it finishes executing in the simulation before I have a
> chance to connect the remote debugger.
>
>
>
> I've tried using gem5.debug with the  -debug-break cmdline option, but
> since that causes gem5 itself to hit a breakpoint, the remote GDB's attempt
> to connect times-out.  I've tried various experiments with trying to resume
> gem5 at the same time as telling the remote GDB to connect, but the race
> condition is too tight so I never get the simulated program to break before
> finishing execution... there must be a better way.
>
>
>
> Has anyone else done something like this with any success?  I'd appreciate
> any ideas.
>
> BTW, I'm using gem5-stable to simulate an ARM platform in SE mode.
>
>
>
> Also, this same question was asked on the gem5 Q&A website a couple weeks
> ago (http://qa.gem5.org/351/gdb-debugging-in-syscall-mode ), but it
> hasn't gotten much attention...  it seems like all questions to the mailing
> list in general get more attention... should I avoid the Q&A site?
>
>
>
> Thanks,
>
> Dan
>
>
>
>
>
>
>
> _______________________________________________
> gem5-users mailing list
> [email protected]
> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
>
_______________________________________________
gem5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Reply via email to