[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Returværdier fra call i gdb (newbie?)



Jeg bruger gdb i xemacs og har nogle problemer med call. Jeg vil gerne
midt i programmet kunne hente en funktionsværdi med call. Men det går
ikke så godt, og jeg har lidt problemer med infoteksten. Jeg har
forfattet to testprogrammer uden det store resultat

Er det mig der ikke er så klog og/eller hvad er det der er galt?

*********** Program 1

double svar(int i){return 10^-6 * sin(x);};

int main{int antalarg, char *arg[]){
   for(;;);
 };

Jeg stopper programmet med gdb i for-løkken og skriver

call svar(1)

gdb svarer

writing register orig_eax (#10): Input/output error.
warning: Unable to restore previously selected frame.

********** Program 2

class minklasse{
   double svar(int i){return 10^-6 * sin(x);};
   minklasse(){;};
};

> int main(int antalarg, char *arg[]){
>  minklasse a;
>  for(;;);
> };
> 
> Når jeg stopper sker følgende:
> 
> Program received signal SIGTSTP, Stopped (user).
> 0x80582a0 in main (antalarg=15, arg=0xbffffcc4) at test.C:10
> 10       for(;;);
> (gdb) call a.svar(1)
> call a.svar(1)
> Argument list of svar mismatch with component in the structure.
> (gdb) call a.svar(t)
> call a.svar(t)
> Argument list of svar mismatch with component in the structure.
> (gdb) call cout << a.svar(t)
> call cout << a.svar(t)
> Argument list of svar mismatch with component in the structure.
--- Begin Message ---
Jeg bruger gdb i xemacs og har nogle problemer med call. Jeg vil gerne
midt i programmet kunne hente en funktionsværdi med call. Men det går
ikke så godt, og jeg har lidt problemer med infoteksten. Jeg har
forfattet to testprogrammer uden det store resultat

Er det mig der ikke er så klog eller hva er det der er galt?

*********** Program 1

double svar(int i){return 10^-6 * sin(x);};

int main{int antalarg, char *arg[]){ 
   for(;;); 
 };

Jeg stopper programmet med gdb i for-løkken og skriver

call svar(1)

gdb svarer

writing register orig_eax (#10): Input/output error.
warning: Unable to restore previously selected frame.

********** Program 2

class minklasse{
   double svar(int i){return 10^-6 * sin(x);};
   minklasse(){;};
};

int main(int antalarg, char *arg[]){
 minklasse a;
 for(;;);
};

Når jeg stopper sker følgende:

Program received signal SIGTSTP, Stopped (user).
0x80582a0 in main (antalarg=15, arg=0xbffffcc4) at test.C:10
10	 for(;;);
(gdb) call a.svar(1)
call a.svar(1)
Argument list of svar mismatch with component in the structure.
(gdb) call a.svar(t)
call a.svar(t)
Argument list of svar mismatch with component in the structure.
(gdb) call cout << a.svar(t)
call cout << a.svar(t)
Argument list of svar mismatch with component in the structure.

--- End Message ---


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:07 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *