Path: utzoo!attcan!uunet!jarthur!bridge2!mips!zaphod.mps.ohio-state.edu!samsung!cs.utexas.edu!rutgers!umn-d-ub!rhealey From: rhealey@umn-d-ub.D.UMN.EDU (Rob Healey) Newsgroups: comp.sys.encore Subject: Re: GNU utils under Umax Message-ID: <3272@umn-d-ub.D.UMN.EDU> Date: 16 Mar 90 19:17:12 GMT References: <37500015@m.cs.uiuc.edu> Reply-To: rhealey@ub.d.umn.edu (Rob Healey) Organization: University of Minnesota, Duluth Lines: 172 In article <37500015@m.cs.uiuc.edu> march@m.cs.uiuc.edu writes: > >I seem to be having problems working with GDB 3.[45] under Umax 4.2 and 4.3. >GDB doesn't always recognize the debugging information produced by >the -g option. My current belief is that COFF is to blame. The solution, >as far as I can see is to install and use all GNU software (gcc, gas and >gnu ld). Can anyone confirm this suspicion? Has anyone succeeded in >getting GDB to interpret debugging information *consistently*? >Any hints or suggestions are welcome. > COFF is not the problem, only FSF's attitude toward it. The code for COFF is a little bit wrong. Apply the below patches to a copy of the most recent GDB3.5 distribution. The patches are a subset of those that add an AT&T UNIX PC definition to GDB. Enjoy! -Rob ------------------------------------------ Snips GDB3.5 patch ------------------ diff -rc2 ../dist2/coffread.c ./coffread.c *** ../dist2/coffread.c Fri Mar 2 21:26:38 1990 --- ./coffread.c Sat Mar 3 13:20:41 1990 *************** *** 865,868 **** --- 865,869 ---- static AUXENT fcn_aux_saved; + int in_source_file = 0; /* a .file is open */ int num_object_files = 0; int next_file_symnum = -1; *************** *** 964,968 **** start_symtab (); } ! num_object_files++; break; --- 965,969 ---- start_symtab (); } ! in_source_file = 1; break; *************** *** 970,984 **** if (cs->c_name[0] == '.') { if (strcmp (cs->c_name, _TEXT) == 0) { ! if (num_object_files == 1) { ! /* last address of startup file */ first_object_file_end = cs->c_value + main_aux.x_scn.x_scnlen; } ! /* for some reason the old code didn't do ! * this if this section entry had ! * main_aux.x_scn.x_nlinno equal to 0 ! */ ! complete_symtab (filestring, cs->c_value, ! main_aux.x_scn.x_scnlen); } /* flush rest of '.' symbols */ --- 971,987 ---- if (cs->c_name[0] == '.') { if (strcmp (cs->c_name, _TEXT) == 0) { ! /* squirrel away last address of startup file */ ! if (num_object_files++ == 0) { first_object_file_end = cs->c_value + main_aux.x_scn.x_scnlen; } ! /* Avoid overwriting the symtab info of files */ ! /* with debugging symbols with that of later */ ! /* files with no symbols. There should only */ ! /* be one .text per .file? */ ! if (in_source_file) ! complete_symtab (filestring, cs->c_value, ! main_aux.x_scn.x_scnlen); ! in_source_file = 0; } /* flush rest of '.' symbols */ *************** *** 985,988 **** --- 988,999 ---- break; } + #ifdef att3b1 + /* Ignore special swbeg and string labels generated by gcc. */ + else if (cs->c_type == T_NULL + && cs->c_name[0] != '\0' && cs->c_name[1] != '\0' + && cs->c_name[2] == '%') { + break; + } + #endif /* fall in for static symbols that don't start with '.' */ case C_EXT: *************** *** 1128,1131 **** --- 1139,1147 ---- case CLIPPERMAGIC: #endif + #ifdef MC68KWRMAGIC + case MC68KWRMAGIC: + case MC68KROMAGIC: + case MC68KPGMAGIC: + #endif return file_hdr->f_nsyms; diff -rc2 ../dist2/default-dep.c ./default-dep.c *** ../dist2/default-dep.c Fri Mar 2 21:26:58 1990 --- ./default-dep.c Fri Mar 2 21:24:38 1990 *************** *** 32,37 **** #include #include - /* #include Can we live without this? */ #ifdef COFF_ENCAPSULATE #include "a.out.encap.h" --- 32,40 ---- #include #include + #ifndef O_RDONLY + #include + #endif + #ifdef COFF_ENCAPSULATE #include "a.out.encap.h" *************** *** 47,50 **** --- 50,59 ---- #include + /* Some machines don't store the u struct at the start of the per-process */ + /* area or the core. U_OFFSET tells how far in it is. */ + #ifndef U_OFFSET + #define U_OFFSET 0 + #endif + extern int errno; *************** *** 111,115 **** struct user u; ! unsigned int offset = (char *) &u.u_ar0 - (char *) &u; offset = ptrace (3, inferior_pid, offset, 0) - KERNEL_U_ADDR; --- 120,124 ---- struct user u; ! unsigned int offset = U_OFFSET + ((char *) &u.u_ar0 - (char *) &u); offset = ptrace (3, inferior_pid, offset, 0) - KERNEL_U_ADDR; *************** *** 137,141 **** struct user u; ! unsigned int offset = (char *) &u.u_ar0 - (char *) &u; offset = ptrace (3, inferior_pid, offset, 0) - KERNEL_U_ADDR; --- 146,150 ---- struct user u; ! unsigned int offset = U_OFFSET + ((char *) &u.u_ar0 - (char *) &u); offset = ptrace (3, inferior_pid, offset, 0) - KERNEL_U_ADDR; *************** *** 409,412 **** --- 418,422 ---- unsigned int reg_offset; + lseek(corechan, U_OFFSET, 0); val = myread (corechan, &u, sizeof u); if (val < 0)