gcl-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Gcl-devel] HEAD Maxima and HEAD trad GCL


From: Mike Thomas
Subject: RE: [Gcl-devel] HEAD Maxima and HEAD trad GCL
Date: Fri, 9 Jan 2004 10:28:36 +1000

Hi Camm.

| > The function name
| GET-DFUN-CONSTRUCTORWRAPPER1WRAPPER0ACCESSOR-TYPE seems to
| > be a bogus overwriting of several names in pcl_dfun - something is going
| > badly wrong with string handling?
|
| GCL strings are not null terminated.  The length is rather given by
| the fillp argument.  This is OK.

Good: I was a bit suspicious about the way those pathnames are being doubled
up in the Maxima defsystem.lisp.

| > Keep in mind when reflecting on this that on Windows, uninitialised
| > variables do not get automatically set to 0, they are set to whatever is
| > sitting in memory when they are instantiated.
| >
|
| Nor in Linux.

I have been worried for two years that we might be working at crossed
purposes over issues like this one.  Is it an Intel architecture thing or
simply an OS design decision?

| ==================================================================
| ==========
| > address@hidden /c/cvs/head/gcl/pcl
| > $ fgrep -r -i GET-DFUN-CONSTRUCTORWRAPPER1WRAPPER0ACCESSOR-TYPE *.c
| >
| > address@hidden /c/cvs/head/gcl/pcl
| > $ fgrep -r -i GET-DFUN-CONSTRUCTOR *.c
| > pcl_dfun.c:/*   function definition for GET-DFUN-CONSTRUCTOR    */
| > pcl_dfun.c:static void LnkT189(){ call_or_link(VV[189],(void **)(void
| > *)&Lnk189)
| > ;} /* GET-DFUN-CONSTRUCTOR */
| >
|
| OK, I need just a few more lines of context here.  On my system,
| GET-DFUN-Constructor is compiled as L2 (pcl_dfun.c):
|
| /*    function definition for GET-DFUN-CONSTRUCTOR    */
|
| static void L2()
| {register object *base=vs_base;

Same here - please find attached the C file from which this extract comes:

/*      function definition for GET-DFUN-CONSTRUCTOR    */

static void L2()
{register object *base=vs_base;


|
|
| >
| ==================================================================
| ==========
| >
| >
| >
| > | Lastly, if you could please break at fasload,
| > | conditionalize this to when the pcl file you found is being loaded,
| > | then break at call_init, and report back to me the init_address.
| >
| > init_address is 0 see below:
| >
| >
| ==================================================================
| ==========
| > Loading binary of PCL_DFUN...
| >
| > Breakpoint 1, fasload (faslfile=0x1024cfc0) at sfasl.c:178
| > 178         int init_address=0;
| > (gdb) p faslfile->s
| > $11 = {t = 13 '\r', flag = 0 '\0', s = 0 '\0', m = 0 '\0', s_dbind =
| > 0x5412b0,
| >   s_sfdef = 0,
| >   st_self = 0x103b5a2c "c:/cvs/head/gcl/unixport/../pcl/pcl_dfun.o",
| >   st_fillp = 42, s_gfdef = 0x2a, s_plist = 0xd, s_hpack = 0x5412b0,
| >   s_stype = 0, s_mflag = 0}
| > (gdb) break call_init
| > Breakpoint 2 at 0x418fa3: file cmpaux.c, line 315.
| > (gdb) c
| > Continuing.
| >
| > Breakpoint 2, call_init (init_address=0, memory=0x102d6294,
| >     fasl_vec=0x10112ab8, fptr=0) at cmpaux.c:315
| > 315       check_type(fasl_vec,t_vector);
| > (gdb)
|
|


| OK I also need at this point:
|
| p memory->cfd
|
|
| The idea is that the bytes you printed above with 'p/x *(int
| *)fun->address@hidden' (would be better next time as (char *),
| btw). should match up to relocation the codes found in your objdump,
| and the sum of memory->cfd.cfd_start + the offset in your dump file
| should be fun->cf.cf_self.  This does not look like it is matching up,
| but I need the info above to be sure.

OK redoing that dump at the call_or_link call with (char *):

(gdb) b funlink.c:71
Breakpoint 4 at 0x4314a4: file funlink.c, line 71.
(gdb) cond 1 fun->cf.cf_self == 0x1030c130
No breakpoint number 1.
(gdb) cond 4 fun->cf.cf_self == 0x1030c130
(gdb) r
Starting program: c:\cvs\head\gcl\pcl/../unixport/saved_gcl.exe
        0x005407A0 BSS start in memory.
        0x004e0000 BSS offset in saved executable.
        0x00113710 BSS size in bytes.
        0x00113710 bytes read.
        0x10100000 Heap start in memory.
        0x00400000 Heap offset in executable.
        0x000e0000 Heap size in bytes.
        0x10100000 file base.
GCL (GNU Common Lisp)  (2.7.0) Mon Jan  5 18:01:01 EAST 2004
Licensed under GNU Library General Public License

...
blah blah
...

Breakpoint 4, call_or_link (sym=0x1022c3a8, link=0x1031d57c) at funlink.c:71
71                  ( *(void (*)()) (fun->cf.cf_self)) ();
(gdb) p fun->cf.cf_name->st
$18 = {t = 8 '\b', flag = 0 '\0', s = 0 '\0', m = 0 '\0', st_displaced =
0x0,
  st_hasfillp = 4784, st_adjustable = 84,
  st_self = 0x103ce800 "GET-DFUN-CONSTRUCTORWRAPPER1WRAPPER0ACCESSOR-TYPE",
  st_fillp = 20, st_dim = 270352720}



(gdb) p/x *(char *)fun->address@hidden
$20 = {0x55, 0x57, 0x56, 0x53, 0x83, 0xec, 0x1c, 0x8b, 0x35, 0xa0, 0xb,
0x5b,
  0x0, 0x8b, 0xd, 0x10, 0xf4, 0x8b, 0x29, 0x10, 0x46, 0x18, 0x3b, 0xd, 0xd0,
  0x7d, 0x5a, 0x0, 0x89, 0x74, 0x24, 0x18, 0x89, 0x44, 0x24, 0x14, 0xf,
0x83,
  0x6b, 0x4, 0x0, 0x0, 0x89, 0xc8, 0x29, 0xf0, 0xc1, 0xf8, 0x2, 0x85, 0xc0,
  0xf, 0x8e, 0x46, 0x4, 0x0, 0x0, 0x83, 0xc6, 0x4, 0x8b, 0x54, 0x24, 0x18,
  0x39, 0xf1, 0x8b, 0x2a, 0x89, 0x35, 0xa0, 0xb, 0x5b, 0x0, 0xc7, 0x1, 0xb0,
  0x12, 0x54, 0x0, 0x89, 0xcb, 0xf, 0x87, 0x4, 0x4, 0x0, 0x0, 0x8b, 0x44,
  0x24, 0x14, 0xa3, 0x10, 0x78, 0x5a, 0x0, 0xa1, 0xa8, 0xcd, 0x31, 0x10,
0x8b,
  0x4c, 0x24, 0x18, 0x81, 0x78, 0x4, 0xb0, 0x12, 0x54, 0x0, 0x8b, 0x79, 0x4,
  0x74, 0x30, 0x8b, 0x1d, 0xac, 0xcd, 0x31, 0x10, 0x81, 0xfb, 0xb0, 0x12,
  0x54, 0x0, 0x74, 0x22, 0x83, 0xec, 0x8, 0xff, 0x73, 0x8, 0x55, 0xe8, 0x60,
  0xc3, 0x14, 0xf0, 0x83, 0xc4, 0x10, 0x85, 0xc0, 0xf, 0x85, 0x3e, 0x3, 0x0,
  0x0, 0x8b, 0x5b, 0x4, 0x81, 0xfb, 0xb0, 0x12, 0x54, 0x0, 0x75, 0xde, 0xa1,
  0xa0, 0xcd, 0x31, 0x10, 0x8b, 0x40, 0x4, 0x3d, 0xb0, 0x12, 0x54, 0x0,
0x74,
  0x19, 0x8d, 0x76, 0x0, 0x8b, 0x50, 0x8, 0x3b, 0x6a, 0x8, 0xf, 0x84, 0x0,
  0x3, 0x0, 0x0, 0x8b, 0x40, 0x4, 0x3d...}
(gdb)



Loading binary of PCL_DFUN...

Breakpoint 5, fasload (faslfile=0x1024cfc0) at sfasl.c:178
178         int init_address=0;
(gdb) p faslfile->s
$21 = {t = 13 '\r', flag = 0 '\0', s = 0 '\0', m = 0 '\0', s_dbind =
0x5412b0,
  s_sfdef = 0,
  st_self = 0x103b5a2c "c:/cvs/head/gcl/unixport/../pcl/pcl_dfun.o",
  st_fillp = 42, s_gfdef = 0x2a, s_plist = 0xd, s_hpack = 0x5412b0,
  s_stype = 0, s_mflag = 0}
(gdb) break call_init
Breakpoint 6 at 0x418fa3: file cmpaux.c, line 315.
(gdb) c
Continuing.

Breakpoint 6, call_init (init_address=0, memory=0x102d6294,
    fasl_vec=0x10112ab8, fptr=0) at cmpaux.c:315
315       check_type(fasl_vec,t_vector);
(gdb) p init_address
$22 = 0
(gdb) p memory->cfd
$23 = {t = 27 '\e', flag = 0 '\0', s = 0 '\0', m = 0 '\0',
  cfd_start = 0x1030c000 "\2038\030h\220-1\020F--\020=\203-\034+\215v",
  cfd_size = 71920, cfd_fillp = 0, cfd_self = 0x0}


And, If I understand you correctly, now dumping at memory->cfd.cfd_start +
0x130 which is the offset for L2:


(gdb) p memory->cfd.cfd_start + 0x130
$25 = 0x1030c130 "UWVS\2038\034\2135a\v["
(gdb) p/x *(char *)address@hidden
$26 = {0x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 0xf, 0x84, 0x0,
  0x3, 0x0, 0x0, 0x8b, 0x40, 0x4, 0x3d...}
(gdb)


Which seems to match up OK?

Cheers

Mike Thomas.

Attachment: pcl_dfun.c
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]