Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/misson20000/cxxfilt-rb

Ruby gem to demangle C++ symbols
https://github.com/misson20000/cxxfilt-rb

Last synced: 14 days ago
JSON representation

Ruby gem to demangle C++ symbols

Awesome Lists containing this project

README

        

# CXXFilt

This is a Ruby gem for demangling C++ symbols. It works the same way as the `c++filt` program from GNU binutils does. It even links with `libiberty` and uses the same demangling routines as `c++filt`.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'cxxfilt'
```

And then execute:

$ bundle

Or install it yourself as:

$ gem install cxxfilt

## Usage

Get a list of the available demanglers:

```
2.4.1 :001 > require "cxxfilt"
=> true
2.4.1 :002 > CXXFilt::demanglers
=> [
#,
#,
#,
#,
#,
#,
#,
#,
#,
#,
#]
```

Demangle a symbol with the `auto` demangler:

```
2.4.1 :003 > CXXFilt::demangle("_Z1hic")
=> "h(int, char)"
2.4.1 :004 > CXXFilt::auto.demangle("_Z1hic")
=> "h(int, char)"
2.4.1 :005 > CXXFilt::demanglers[1].demangle("_Z1hic")
=> "h(int, char)"
```

## Development

After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).

## Contributing

Bug reports and pull requests are welcome on GitHub at [https://github.com/misson20000/cxxfilt-rb].