Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • C clean-graph-copy
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • clean-and-itasks
  • clean-graph-copy
  • Issues
  • #5

Closed (moved)
(moved)
Open
Created Nov 01, 2018 by Camil Staps@cstapsContributor

Mac symbols_in_program gives unexpected values

I would expect this program to show the symbol values of __Cons and __Nil followed by the same values as collected by read_symbols:

module test

import StdEnv
import symbols_in_program

Start w
# (syms,w) = accFiles (read_symbols "./a.out") w
= (descriptor [1,2,3], descriptor [], {#s \\ s <-: syms | isMember s.symbol_name ["__Cons","__Nil"]})

descriptor :: !a -> Int
descriptor _ = code {
	get_node_arity 0
	pushI 8
	mulI
	pushI 2
	addI
	pushD_a 0
	subI
	pop_a 1
}

This works on 64-bit linux:

(6596068,6596040,{Symbol "__Cons" 6596068,Symbol "__Nil" 6596040})

But not on Mac:

(4444321560,4444321608,{Symbol "__Cons" 4295288632,Symbol "__Nil" 4295288600})

The problem can be overcome by checking the difference between the symbol found for __ARRAY__ and the actual address of __ARRAY__ and adding that offset to each value. But it seems that should be done in symbols_in_program rather than elsewhere; the numbers returned by read_symbols now are meaningless.

Edited Nov 01, 2018 by Camil Staps
Assignee
Assign to
Time tracking