mb@ttidca.TTI.COM (Michael Bloom) (09/24/90)
In article <9009220259.AA04317@life.ai.mit.edu> TRANLE@INTELLICORP.COM (Minh Tran-Le) writes: > - changed to produce sdb debugging info instead of dbx debug info. > The debugging info is not very usefull because ibm does not provide an sdb > debugger and the as assembler does not know how to handle dbx .stabs. But at > least it does not break when trying to compile with -g. A possible alternative that WOULD allow debugging if it works on AIX might be to use gas and gdb configured to work with dbx stabs in COFF using the patches available from tut.cis.ohio-state.edu (or osu-cis). If tm-i386gcoff.h is insufficent for aix, try creating a tm- file that #includes tm-i386gcoff.h and uses #undef and #define to define what would need to be different for AIX. With these patches, you get a gas that understands dbx .stab directives and produces coff. The coff symbols produced for .stab directives appear to be ordinary non-debug symbols to a normal COFF loader which will do the right thing with them. The only problem that I can foresee is that the AIX ld might not expect or generate standard COFF line number tables. Can anyone tell me if this is so? If this is the case, the following patch (with BROKEN_LINE_TABLES #defined) should allow gas to emit N_SLINE symbols instead of a line number table at a cost (18 bytes per line number instead of 6) in object file size. *** ../dist/coff-conv.c Sun Sep 23 21:40:04 1990 --- ./coff-conv.c Sun Sep 23 21:42:19 1990 *************** *** 2028,2061 **** --- 2028,2063 ---- SYMENT **sptr; AUXENT **xptr; unsigned int type; int an; { int snum; char sname ; struct syment_pun *punptr = (struct syment_pun *) (*sptr); + #ifndef BROKEN_LINE_TABLES if (type == (unsigned short) N_SLINE) { if (line_scope_change_sym == 0) link_line_nums((*aptr)); else { /* A new line info header is generated whenever an N_SLINE occurs after a symbol that indicated a change of line number scope */ make_line_info(aptr,sptr,xptr,type,an); link_line_nums((*aptr)); line_scope_change_sym = 0; } return; } + #endif /* BROKEN_LINE_TABLES */ (*sptr)->n_zeroes = 0; (*sptr)->_n._n_n._n_offset = 0; set_symbol(*aptr,*sptr); sname = SNAME_OF(type); snum = (*sptr)->n_scnum; if (type == (unsigned int) N_SO