[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]![]() |
![]() |
![]() |
|||||||||||||||||||||||||
|
|||||||||||||||||||||||||||
![]() |
![]() |
![]() |
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 ---
- To: sslug@sslug
- Subject: Returværdier fra call i gdb (newbie?)
- From: gnalle <sslug@sslug>
- Date: Mon, 24 May 1999 14:04:11 +0200
- Organization: RUC
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 ---
![]() |
![]() |
![]() |
||||||||||||
|
||||||||||||||
![]() | ||||||||||||||
|
||||||||||||||
![]() |
![]() |
![]() |