Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DWARF4 base type entry encodings to symtabAPI::typeScalar #1059

Merged
merged 6 commits into from
Jun 26, 2021
Merged

Add DWARF4 base type entry encodings to symtabAPI::typeScalar #1059

merged 6 commits into from
Jun 26, 2021

Conversation

hainest
Copy link
Contributor

@hainest hainest commented Jun 22, 2021

These properties are needed for doing ABI analysis in Smeagle.

ping @vsoch

@hainest hainest added enhancement Symtab This issue is directly related to SymtabAPI labels Jun 22, 2021
@hainest hainest self-assigned this Jun 22, 2021
bool is_string;

// Detailed properties
bool is_address;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about some kind of boolean for is_null, would that be useful?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was looking at this, and I think we can add it here. DWARF treats 'void' separately from the base_type attributes handled here, but I think we can lump them together. I was going to chat with @sashanicolas first before adding it.

@hainest
Copy link
Contributor Author

hainest commented Jun 22, 2021

https://bottle.cs.wisc.edu/search?dyninst_branch=PR1059

No new regressions. I want to modify an existing test to explicitly check for the properties here (insofar as C will let us) before merging.

@hainest
Copy link
Contributor Author

hainest commented Jun 22, 2021

@sashanicolas Sorry to press, but we need these changes before we can move forward with Smeagle. Could you take a look as soon as you get a chance?

@vsoch
Copy link
Contributor

vsoch commented Jun 22, 2021

Thank you @sashanicolas ! +1 what @hainest said. Smeeeeagle needs to parse the preccccious (but he's really using dyninst under the hood 😆 )

Copy link
Contributor

@sashanicolas sashanicolas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@hainest
Copy link
Contributor Author

hainest commented Jun 26, 2021

@hainest hainest merged commit 091cf61 into dyninst:master Jun 26, 2021
@hainest hainest deleted the improve_symtab_type_scalar branch June 26, 2021 03:10
@vsoch
Copy link
Contributor

vsoch commented Jun 26, 2021

Woohoo! Will this be in a release soon (how does the release schedule work for Dyninst?)

@hainest
Copy link
Contributor Author

hainest commented Jun 26, 2021

@vsoch We don't have a fixed release schedule, but we try to do at least two point releases per year. We do patch releases as necessary. We just did one of those a couple weeks ago, so it might be a while before we do another one (unless there's a pressing reason). For now, I would recommend updating Dyninst in the dev container to the current HEAD with these changes.

@vsoch
Copy link
Contributor

vsoch commented Jun 26, 2021

Gotcha. Autamus (our current development base) only builds from releases so what I'll do is create the same container manually from dyninst master, and then we can use that (and update it) as long as we need. I have it building now, and I can add the Dockerfile and updates to the repo the next time I need to make changes!

@vsoch
Copy link
Contributor

vsoch commented Jun 26, 2021

@vsoch
Copy link
Contributor

vsoch commented Jun 26, 2021

If anyone wants / needs the Dockefile, here you go! It installs dyninst via spack, and I've found this much easier than trying to get it to work locally.

# Build stage with Spack pre-installed and ready to be used
# docker build -f Dockerfile.dyninst -t ghcr.io/autamus/dyninst:05-25-master .
FROM spack/ubuntu-bionic:latest as builder

RUN git clone https://github.com/autamus/registry && \
    cd registry && \
    mv spack/d/dyninst /opt/spack/var/spack/repos/builtin/packages/dyninst

# Install OS packages needed to build the software
RUN apt-get -yqq update && apt-get -yqq upgrade \
 && apt-get -yqq install python3-boto3 \
 && rm -rf /var/lib/apt/lists/*

# What we want to install and how we want to install it
# is specified in a manifest file (spack.yaml)
RUN mkdir /opt/spack-environment \
&&  (echo "spack:" \
&&   echo "  specs:" \
&&   echo "  - dyninst@master" \
&&   echo "  view: /opt/view" \
&&   echo "  packages:" \
&&   echo "    all:" \
&&   echo "      target:" \
&&   echo "      - x86_64" \
&&   echo "  config:" \
&&   echo "    compiler:" \
&&   echo "      target: x86_64" \
&&   echo "    install_missing_compilers: true" \
&&   echo "    install_tree: /opt/software" \
&&   echo "  mirrors:" \
&&   echo "    autamus: s3://autamus-cache" \
&&   echo "  concretization: together") > /opt/spack-environment/spack.yaml

# Install the software, remove unnecessary deps
RUN cd /opt/spack-environment && spack env activate . && curl http://s3.amazonaws.com/autamus-cache/build_cache/_pgp/FFEB24B0A9D81F6D5597F9900B59588C86C41BE7.pub > key.pub && spack gpg trust key.pub && spack install --fail-fast --monitor --monitor-save-local --monitor-tags autamus; stat=$?; cd ~/.spack/reports/monitor/; tar -czvf monitor.tar.gz *; curl -F "upload=@monitor.tar.gz" http://localhost:4500/upload; exit $stat && spack gc -y; 

# Strip all the binaries
RUN find -L /opt/view/* -type f -exec readlink -f '{}' \; | \
    xargs file -i | \
    grep 'charset=binary' | \
    grep 'x-executable\|x-archive\|x-sharedlib' | \
    awk -F: '{print $1}' | xargs strip -s

# Modifications to the environment that are necessary to run
RUN cd /opt/spack-environment && \
    spack env activate --sh -d . >> /etc/profile.d/z10_spack_environment.sh

# Bare OS image to run the installed executables
FROM ubuntu:18.04

ENV PATH=/opt/view/bin:/opt/spack/bin:$PATH

COPY --from=builder /opt/spack-environment /opt/spack-environment
COPY --from=builder /opt/software /opt/software
COPY --from=builder /opt/view /opt/view
COPY --from=builder /etc/profile.d/z10_spack_environment.sh /etc/profile.d/z10_spack_environment.sh

ENTRYPOINT ["/bin/bash", "--rcfile", "/etc/profile", "-l", "-c"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Symtab This issue is directly related to SymtabAPI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants