Re: wrapping diassembled code

From: Paul Pluzhnikov (ppluzhnikov_at_earthlink.net)
Date: 04/28/03


Date: Mon, 28 Apr 2003 15:05:25 GMT

Allan Adler <ara@nestle.ai.mit.edu> writes:

> Paul Pluzhnikov <ppluzhnikov@earthlink.net> kindly pointed out the

[Please use "emacs/GNUS" 'F' key for followups. This inserts a
'References:' field into your message, which then allows threaded
newsreaders (e.g. GNUS) to associate your article with its thread,
and makes it easy to see if anybody followed up on your message.]

> On the other hand, I think there is also
> something missing from the output of
> objdump -dr y.o

Indeed. What is missing is the info about any data costants (and
string constants) used, just as you discovered.

You never actually posted your original error.c, and the little
test case I've made didn't include any data references ...

> I placed
> .LC0:
> .string "line %d: %s\n"
> at the beginning.

And referenced it in the assembly as "pushl $.LC0" ?

> The resulting file will compile with the others and produce
> an executable. When it is given erroneous input, it doesn't crash but it
> doesn't behave correctly either. Instead it gives error messages that don't
> derive from the program. E.g. "input not syncrhonized", "Identifier removed",

I assure you that these messages *do* derive from the program,
just a different place in it. You can do:

  strings -a a.out | grep 'Identifier removed'

to confirm that.

> and "Unknown error 256", at various times. So I don't seem to be able to guess
> correctly how to insert this format string, even when I know it has to be
> there.

Well, how did you insert it?

[I suggest you abandon the whole 'error.c' idea, and start with a
trivial main.c, which can then be posted/discussed in its entirety.
Once you know how to do an equivalent main.s, error.s would become
easier].

Cheers,

-- 
In order to understand recursion you must first understand recursion.


Relevant Pages

  • Re: HOW TO CHANGE DRIVE ADDRESS IN MACRO
    ... Note that, as written, you code line is not correct (you are missing quote marks around some of your String constants), so I patched it the best I could, but I **think** you are missing a backslash between the "\TRANSFERS" and "VIREMENTS RECORD\" parts. ... they are on different drives like Y:, Z: etc because we working on ... Sub SAV() ...
    (microsoft.public.excel.programming)
  • Re: _rtld_global_ro@GLIBC_PRIVATE
    ... The fact that you are missing it implies that your /lib/libc.so.6 ... botched glibc upgrade results in a system that must be re-installed ... In order to understand recursion you must first understand recursion. ...
    (comp.os.linux.development.apps)
  • Re: I thought I understood sizeof().
    ... Hard to tell what you are missing without knowing what you expected ... DS> 'char *', ... Run this with a heap checker, ... In order to understand recursion you must first understand recursion. ...
    (comp.unix.programmer)
  • Re: Pointer to member as method parameter
    ... > bool Object::CallSetup ... Missing: ... your code compiles fine with g++ 2.95.3 and 4.0.0. ... In order to understand recursion you must first understand recursion. ...
    (comp.os.linux.development.apps)
  • RE: Simple Recursive Generator Question
    ... but one of the things you're missing is ... The generator saves you having to pass the "index" param recursively. ... > Changing yield to print, shows that the recursion works correctly. ...
    (comp.lang.python)