Message-ID: From: "Andris Pavenis" To: Hans-Peter Fischer , djgpp AT delorie DOT com Date: Thu, 4 Feb 1999 13:06:19 +0200 MIME-Version: 1.0 Content-type: Multipart/Mixed; boundary=Message-Boundary-14780 Subject: Re: RHIDE bug CC: Robert Hoehne In-reply-to: <36B8B232.7460F686@heidenheim.com> X-mailer: Pegasus Mail for Win32 (v3.01d) Reply-To: djgpp AT delorie DOT com --Message-Boundary-14780 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body On 3 Feb 99, at 21:31, Hans-Peter Fischer wrote: > Make a directory for a new project, e. g. "test", start rhide in it and > type the following little programme: > > int main() > { > return chdir("\\"); > } > > Save the file as "test.c" and click "Run". The programme will build and > run o. k. > Now click "Build all" and you will get the message: "Could not find the > source file 'test.c'...". Exit rhide and look into C:\ and you will find > two new files in it: "test.gpr" and "test.gdt". If you start rhide again > from the proper project directory the programme will build correctly > again. > > The result of this seems to be that you cannot debug programmes in rhide > that change directories. Entering the path to the source file under > Options - Directories does not help. > > Is this known? > Here is my patch. It seems to solve problem for DJGPP at least for me but I haven't tested it very carefully yet (and for Linux version at all). Perhaps after some testing I'll make my binaries of patched rhide-1.4.7 for DJGPP available (including this fix). Andris --Message-Boundary-14780 Content-type: text/plain; charset=US-ASCII Content-disposition: inline Content-description: Attachment information. The following section of this message contains a file attachment prepared for transmission using the Internet MIME message format. If you are using Pegasus Mail, or any another MIME-compliant system, you should be able to save it or view it from within your mailer. If you cannot, please ask your system administrator for assistance. ---- File information ----------- File: rh147-19990204.diff Date: 4 Feb 1999, 12:58 Size: 2574 bytes. Type: Text --Message-Boundary-14780 Content-type: Application/Octet-stream; name="rh147-19990204.diff"; type=Text Content-disposition: attachment; filename="rh147-19990204.diff" --- librhgdb/gdbcontr.c~ Wed Jun 24 09:58:56 1998 +++ librhgdb/gdbcontr.c Thu Feb 4 12:34:06 1999 @@ -9,6 +9,10 @@ #include #include +#ifdef __DJGPP__ +#include +#endif + #define TBREAK win31?"thbreak":"tbreak" int debugger_started = 0; @@ -27,8 +31,28 @@ int force_disassembler_window = 0; + +#ifdef __DJGPP__ +int rhide_curr_disk; +int user_curr_disk=-1; +#endif +char *rhide_curr_dir=0; +char *user_curr_dir=0; + + void Command(char *x,int call_hook) { + if (!in_command) + { +#ifdef __DJGPP__ + rhide_curr_disk = getdisk(); + if (user_curr_disk>=0) setdisk (user_curr_disk); +#endif + if (rhide_curr_dir) free (rhide_curr_dir); + rhide_curr_dir = getcwd (0,1024); + if (user_curr_dir) chdir (user_curr_dir); + } + in_command++; reset_gdb_output(); reset_gdb_error(); @@ -48,6 +72,18 @@ debugger_started = inferior_pid; if (in_command == 1 && call_hook && post_command_hook) post_command_hook(); in_command--; + + if (!in_command) + { +#ifdef __DJGPP__ + user_curr_disk = getdisk(); + setdisk (rhide_curr_disk); +#endif + if (user_curr_dir) free (user_curr_dir); + user_curr_dir = getcwd (0,1024); + if (rhide_curr_dir) chdir (rhide_curr_dir); + } + if (!in_command && call_reset) { call_reset = 0; @@ -55,6 +91,7 @@ ResetDebugger(); in_command--; } + } static void set_source_directories(char **SrcDirs,int count) --- idegcc.cc~ Mon Oct 12 22:03:40 1998 +++ idegcc.cc Thu Feb 4 12:48:10 1999 @@ -48,6 +48,7 @@ #include #ifdef __DJGPP__ #include +#include #endif #ifdef INTERNAL_DEBUGGER @@ -913,7 +914,10 @@ Boolean RunMainTarget() { - char *spec,*cmd; +#ifdef __DJGPP__ + int rhide_disk; +#endif + char *spec,*cmd,*rhide_cwd; Boolean redir_stdout = False,redir_stderr = False; #ifdef INTERNAL_DEBUGGER if (BreakPointCount() > 0) @@ -933,7 +937,16 @@ string_cat(spec," $(PROG_ARGS)"); cmd = BuildCompiler(project,spec); string_free(spec); +#ifdef __DJGPP__ + rhide_disk=getdisk(); +#endif + rhide_cwd=getcwd(0,1024); exit_code = RunProgram(cmd,redir_stderr,redir_stdout,True); +#ifdef __DJGPP__ + setdisk(rhide_disk); +#endif + chdir(rhide_cwd); + string_free(rhide_cwd); string_free(cmd); messageBox(mfInformation|mfOKButton, _("Program exit code: %d (0x%04x)"),exit_code,exit_code); --Message-Boundary-14780--