can't do minimal debugging without -g

From: Claude Scarpelli <claude_at_genoscope.cns.fr>
Date: Wed, 01 Mar 2000 15:09:01 +0100

I'd like to do some minimal debugging on a program compiled without -g
option that cores dump.

This is something I'm unable to do on Tru64 (dbx or ladebug), while I
used to do this on Solaris.

Here is an example (Tru64 4.0E,
                    dbx version 3.11.10,
                    ladebug 4.0.-43)

etna$ cat c.c
int
main(int argc, char **argv){
  abort();
}
etna$

etna$ make c CFLAGS=-O
cc -O c.c -o c
etna$
etna$ ./c
IOT/Abort trap (core dumped)
etna$ ladebug ./c core
Welcome to the Ladebug Debugger Version 4.0-43
------------------
object file name: ./c
core file name: core
Reading symbolic information ...done
Core file produced from executable c
Thread terminated at PC 0x3ff800ecdd8 by signal IOT
(ladebug)
(ladebug) where
>0 0x3ff800ecdd8 in __kill(0x3ff800e042c, 0x3ffc0085c98, 0x0, 0xffffffff00000000, 0x3ff80176dd8, 0x14002ba90) DebugInformationStrippedFromFile296
#1 0x3ff8019e680 in UnknownProcedure17FromFile12(0x0, 0xffffffff00000000, 0x3ff80176dd8, 0x14002ba90, 0x3ff80114bcc, 0x6) DebugInformationStrippedFromFile12
#2 0x3ff80114bc8 in __tis_raise(0x3ff80176dd8, 0x14002ba90, 0x3ff80114bcc, 0x6, 0x3ff8016060c, 0x140014fe0) DebugInformationStrippedFromFile740
#3 0x3ff80160608 in raise(0x3ff80114bcc, 0x6, 0x3ff8016060c, 0x140014fe0, 0x3ff80176e04, 0x0) DebugInformationStrippedFromFile439
#4 0x3ff80176e00 in abort(0x120001138, 0x0, 0x0, 0x0, 0xfffffc0000000000, 0x14) DebugInformationStrippedFromFile326
#5 0x120001134 in main(0x0, 0x0, 0xfffffc0000000000, 0x14, 0x1200010cc, 0x0) DebugInformationStrippedFromFile1
(ladebug)


I was expecting to find argc as first argument of main(). Its value
should be 1. Second argument should be *argv. Its value *should not*
be 0 ! Third argument should be *envp, but it seems it is not a valid
address :

(ladebug) 0xfffffc0000000000/X
0xfffffc0000000000: Failed to read data.
(ladebug)


Did I miss something ?

Solaris example:

(dbx) where
=>[1] _kill(0x0, 0x6, 0xef723100, 0x0, 0xffffffff, 0x0), at 0xef70820c
  [2] abort(0xef723100, 0xef728ecc, 0xef725550, 0x2, 0xef723100, 0xef698cf0), at 0xef6ba5c8
  [3] main(0x1, 0xeffffbd4, 0xeffffbdc, 0x20800, 0x0, 0x0), at 0x108fc
(dbx) examine 0xeffffbd4/X
dbx: warning: unknown language, 'ansic' assumed
0xeffffbd4: 0xeffffcc0
(dbx) examine 0xeffffcc0/s
0xeffffcc0: "./c"
(dbx)


argv[0] successfully printed.



-- 
------------------------------------------------------------------------------
Claude Scarpelli                            | Defenestrate: to exit a window
Centre National de Séquençage - GENOSCOPE   | onscreen. (Time International
2, rue Gaston Crémieux, F-91000 EVRY FRANCE | Vol 146, No. 20, Nov 13, 1995)
Received on Wed Mar 01 2000 - 14:09:49 NZDT

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:40 NZDT