This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Cross debugger


On Jun 16, 2011, at 7:53 AM, Chris Sutcliffe wrote:

> On 15 June 2011 22:53, Joel Brobecker wrote:
>> What I don't understand is why you created a cross compiler/debugger,
>> while it seems to me you could have just created a native x64 MinGW
>> toolset.  That's what we do at AdaCore: We use cygwin as the build
>> environment, but then build a MinGW toolset by configuring with
>> --build=x86_64-pc-mingw32. As far as I know, the gdbserver will
>> be automatically built.
> 
> Good point, for some reason I was thinking that since gdb would be
> running withing the Cygwin environment I would need the
> '--host=i686-pc-cygwin'.  If I build a native x64 MinGW gdb will it
> understand Cygwin paths correctly?
> 
>>> (gdb) start
>> [...]
>>> Don't know how to run.  Try "help target".
>> 
>> And that's also expected, since you have a cross-debugger. So the
>> debugger is expecting you to connect to the target where the process
>> is running.
> 
> Ah, I didn't realize a cross-debugger could only be used to connect to
> running process.

More precisely, it can attach to an already running process, or you can start a new one on the command line.  Either way, though, by the time gdb connects to gdbserver, the process already exists.  If you started it on the command line, it's on the first instruction (typically some sort of startup library code, well before "main").  So either way, you get things going by "continue".

	paul


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]