Giter VIP home page Giter VIP logo

Comments (27)

aquynh avatar aquynh commented on May 18, 2024

On Wed, Dec 18, 2013 at 10:51 PM, Markus Elfring
[email protected]:

I have looked at a few source files for your current software. I have
noticed that some checks for return codes are missing.

Would you like to add more error handling for return values from functions
like the following?

  • mallochttp://pubs.opengroup.org/onlinepubs/9699919799/functions/malloc.html=>
    MCOperand_CreateReghttps://github.com/aquynh/capstone/blob/39da42692de1431814fb0202907d5b48a74f3b14/MCInst.c#L153
  • strduphttp://pubs.opengroup.org/onlinepubs/9699919799/functions/strdup.html=>
    Mips_printInsthttps://github.com/aquynh/capstone/blob/24ca24c5dbad62c4cd4809e6020ade877afc28fd/arch/Mips/MipsInstPrinter.c#L154

definitely yes, these issues should be addressed. please send patch, or
pull request.

thanks.

Reply to this email directly or view it on GitHubhttps://github.com//issues/42
.

from capstone.

elfring avatar elfring commented on May 18, 2024

Are you interested to apply aspect-oriented software development?
How do you think about to encapsulate error detection and corresponding exception handling as a reusable aspect in your software?

from capstone.

aquynh avatar aquynh commented on May 18, 2024

On Wed, Dec 18, 2013 at 10:54 PM, Markus Elfring
[email protected]:

Are you interested to apply aspect-oriented software developmenthttp://aspectc.org/
?
How do you think about to encapsulate error detection and corresponding
exception handling as a reusable aspecthttp://en.wikipedia.org/wiki/Aspect_%28computer_programming%29in your software?

Please could you elaborate on what you want to implement with this Aspect
approach?

I prefer to keep it simple, since this issue is simple, anyway.

Thanks.

from capstone.

elfring avatar elfring commented on May 18, 2024

Would you like to read any of the linked information sources?

from capstone.

aquynh avatar aquynh commented on May 18, 2024

On Wed, Dec 18, 2013 at 11:42 PM, Markus Elfring
[email protected]:

Would you like to read any of the linked information sources?

i took a look, but not really experienced about this AOP stuff. perhaps it
is easier if you can go ahead to implement your solution, as clean as
possible, then i can comment on the code?

thanks.

from capstone.

aquynh avatar aquynh commented on May 18, 2024

Markus, if you do this, please work on the "next" branch, where the next
version is based on.

See https://github.com/aquynh/capstone/wiki/ChangeLog

Thanks.

On Thu, Dec 19, 2013 at 10:51 PM, Nguyen Anh Quynh [email protected] wrote:

On Wed, Dec 18, 2013 at 11:42 PM, Markus Elfring <[email protected]

wrote:

Would you like to read any of the linked information sources?

i took a look, but not really experienced about this AOP stuff. perhaps it
is easier if you can go ahead to implement your solution, as clean as
possible, then i can comment on the code?

thanks.

from capstone.

elfring avatar elfring commented on May 18, 2024

Are you willing to cooperate with another software development tool which can scan through your source files where specific adjustments (advice) should be applied automatically?

from capstone.

aquynh avatar aquynh commented on May 18, 2024

On Fri, Dec 20, 2013 at 12:50 AM, Markus Elfring
[email protected]:

Are you willing to cooperate with another software development tool which
can scan through your source files where specific adjustments should be
applied automatically?

yes you make me curious. if the generated code is clean enough, then we can
accept it, with some modifications.

thanks.


Reply to this email directly or view it on GitHubhttps://github.com//issues/42#issuecomment-30944933
.

from capstone.

elfring avatar elfring commented on May 18, 2024

A traditional approach for adding error detection is the specification of some checks in the source code manually. Are you willing to delegate such a source file maintenance task to an evolving software development tool like "AspectC++"?

from capstone.

aquynh avatar aquynh commented on May 18, 2024

On Fri, Dec 20, 2013 at 1:00 AM, Markus Elfring [email protected]:

A traditional approach for adding error detection is the specification of
some checks in the source code manually. Are you willing to delegate such a
source file maintenance task to an evolving software development tool like
"AspectC++"?

yes, lets see how that goes. i hope the resulted code is clean enough.
otherwise, i prefer manual code.

thanks.

from capstone.

elfring avatar elfring commented on May 18, 2024

How do you think about to introduce also a higher level build tool like CMake or Autotools for your software?

from capstone.

radare avatar radare commented on May 18, 2024

If you just need a configure script for handwritten makefiles you can use ACR.

http://github.com/radare/acr

I dont think cmake or autotools is necessary for this project. Building a single library file is an easy task and we dont need higher abstractions.

But we will need to fix the makefiles because right now you have to make clean in otder to build without issues..

On 22 Dec 2013, at 10:18, Markus Elfring [email protected] wrote:

How do you think about to introduce also a higher level build tool like CMake or Autotools?


Reply to this email directly or view it on GitHub.

from capstone.

elfring avatar elfring commented on May 18, 2024

I am a bit more concerned about a consistent handling for library portability. I am also curious which "make file" will be a really good base for the concrete reuse of AspectC++ here.

from capstone.

aquynh avatar aquynh commented on May 18, 2024

On Sun, Dec 22, 2013 at 5:27 PM, radare [email protected] wrote:

If you just need a configure script for handwritten makefiles you can use
ACR.

http://github.com/radare/acr

I dont think cmake or autotools is necessary for this project. Building a
single library file is an easy task and we dont need higher abstractions.

But we will need to fix the makefiles because right now you have to make
clean in otder to build without issues..

agreed on avoiding autotools, but perhaps CMake is good, because we also
want to support MS Visual Studio: CMake can generate VS project easily.

thanks.

from capstone.

elfring avatar elfring commented on May 18, 2024

I guess that the discussion for the build system selection should be continued with an other issue.

from capstone.

radare avatar radare commented on May 18, 2024

Cmake is an awful project, lot of issues for crosscompiling. It's bloated and adds another dependency to the build, because not everyone have cmake installed. (Not to mention its c++)

The only good thing i see in cmake is that allows to create visual studio projects, but, as long as C support in visual studio is a pure crap I would suggest using ming32 builds for the windows users and im not sure if maintaining a handcrafted visual studio project file would be too much work.. But cs is a very simple project, so the build shouldnt be complex.

On 22 Dec 2013, at 12:30, Markus Elfring [email protected] wrote:

I guess that the discussion for the build system selection should be continued with an other issue.


Reply to this email directly or view it on GitHub.

from capstone.

aquynh avatar aquynh commented on May 18, 2024

On Sun, Dec 22, 2013 at 9:00 PM, radare [email protected] wrote:

Cmake is an awful project, lot of issues for crosscompiling. It's bloated
and adds another dependency to the build, because not everyone have cmake
installed. (Not to mention its c++)

The only good thing i see in cmake is that allows to create visual studio
projects, but, as long as C support in visual studio is a pure crap I would
suggest using ming32 builds for the windows users and im not sure if
maintaining a handcrafted visual studio project file would be too much
work.. But cs is a very simple project, so the build shouldnt be complex.

agreed, but in the worst case we can maintain CMake & Makefile in parallel.
i think it is not bad if CMake can create VS project for us, so it is more
consistent & better managed in the same code base.

anyway, this is not a top priority at the moment.

thanks.

On 22 Dec 2013, at 12:30, Markus Elfring [email protected]
wrote:

I guess that the discussion for the build system selection should be
continued with an other issue.

Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHubhttps://github.com//issues/42#issuecomment-31086948
.

from capstone.

elfring avatar elfring commented on May 18, 2024

The document "AC++ Compiler Manual 1.7" contains the following information.
5.2.7 Support for Plain C Code Currently ac++ generates C++ code, which cannot be compiled by a C compiler.

Is this detail compatible with your software configuration?

from capstone.

aquynh avatar aquynh commented on May 18, 2024

On Mon, Dec 23, 2013 at 12:31 AM, Markus Elfring
[email protected]:

The document "AC++ Compiler Manual 1.7"http://aspectc.org/fileadmin/documentation/ac-compilerman.pdfcontains the following information.
5.2.7 Support for Plain C Code
Currently ac++ generates C++ code, which cannot be compiled by a C
compiler.

Is this detail compatible with your software configuration?

Capstone is in pure C, and there is absolutely no C++ at all.

Thanks.


Reply to this email directly or view it on GitHubhttps://github.com//issues/42#issuecomment-31090490
.

from capstone.

elfring avatar elfring commented on May 18, 2024

How do you generally think about to cooperate with source code transformations where the target can eventually contain C++ constructs?

from capstone.

aquynh avatar aquynh commented on May 18, 2024

no, Capstone would never get C++ code, and that is one of the key "feature"
of this project.

thanks.

On Mon, Dec 23, 2013 at 12:44 AM, Markus Elfring
[email protected]:

How do you generally think about to cooperate with source code
transformations where the target can eventually contain C++ constructs?


Reply to this email directly or view it on GitHubhttps://github.com//issues/42#issuecomment-31090756
.

from capstone.

wargio avatar wargio commented on May 18, 2024

may i suggest to use assert or something that calls that?

from capstone.

elfring avatar elfring commented on May 18, 2024

I do not like the macro "assert" here because return value checking will be omitted again if the preprocessor symbol "NDEBUG" would be defined.

from capstone.

aquynh avatar aquynh commented on May 18, 2024

On Oct 11, 2014 2:55 AM, "Markus Elfring" [email protected] wrote:

I do not like macro "assert" here because return value checking will be
omitted again if the preprocessor symbol "NDEBUG" would be defined.

The only nice way to get rid of this issue is to remove all the dynamic
malloc in the middle of the code & replace them with equiv code using
static memory. if anybody wants to fix this, just find all the remaining
code and fix them.

Thanks

from capstone.

wargio avatar wargio commented on May 18, 2024

then why not using the stack directly? for Mips_printInst should work fine.
For MCOperand_CreateReg not.

[edit] i haven't seen the aquynh answer... on the "next" branch it's fixed!

from capstone.

aquynh avatar aquynh commented on May 18, 2024

On Tue, Oct 14, 2014 at 4:00 AM, Giovanni [email protected] wrote:

then why not using the stack directly? for Mips_printInst should work fine.

yes, please feel free to fix it, then make a Pull-Request.

For MCOperand_CreateReg not.

make sure you are using the latest code (from the "next" branch), since
MCOperand_CreateReg is gone, and all the related code switched away from
heap memory long ago.

thanks.

from capstone.

kabeor avatar kabeor commented on May 18, 2024

Close this issue for now because of legacy, we are preparing to release Capstone 5.0, plz feel free to open a new issue if that still has this issue.
thx :)

from capstone.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.