This is the mail archive of the gdb@sources.redhat.com 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: GDB does not returns


Hi All,

Hi Alain,

Here is the program I am using.

/*----------------------------------------------------
 * eCos 'Hello world' example
 * --------------------------------------------------*/

#include <stdio.h>
//#include "library_example.h"

int main(int argc, char* argv[])
{
    int i;


for (i=0; i<10; i++) { printf("Hello world!\n\r"); } return 0; }

I guess you're doing something like:


target remote xxx:yyy
load
continue


try:

target remote xxx:yyy
load
break _exit
continue

The startup code typically calls _exit after main returns.


Perhaphs, for embedded targets, GDB should automatically set a breakpoint on _exit.

Andrew

I am using GDB  mipsel-elf-gdb.exe build GNU gdb 20030516.
My problem is that when I run the above program in command line it prints
Hello world
and is not returning to GDB.

One of the ecos GUY says that if we put a break point at exit it is possible
to exit the program.
What command we have use to put a break
point at exit or what settings I have to make to get back to gdb prompt?.

Please let me know.
Jose







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