|
List Info
Thread: adding comments/labels?
|
|
| adding comments/labels? |
  United States |
2007-08-29 23:38:47 |
After digging through the documentation some and realizing
how futile
google is when you search for things like 'gdb comments' or
'gdb
labels'/et cetera, I turn to you all ;]
Is there any way to add a label/comment/rename a symbol in
gdb?
specifically what I'd like to do is add symbol resolution to
addresses,
i.e.
call 0x12345678
I disassemble the code at 0x12345678 and see that it just
does:
mov $0x04, %al
sysenter
cmp [...]
and I can say, oh thats a sys_write wrapper, so I'd like to
relabel it as
'sys_write', so now when I run across a call to it i see:
call <sys_write_wrapper>
I'm assuming no such functionality exists, as I can find
nothing about it,
so that said, can anyone direct me to where I should touch
gdb to add such
functionality?
thanks.
|
|
| Re: adding comments/labels? |
  United States |
2007-08-29 16:12:58 |
On Thu, Aug 30, 2007 at 04:38:47AM +0000, jf wrote:
> After digging through the documentation some and
realizing how futile
> google is when you search for things like 'gdb
comments' or 'gdb
> labels'/et cetera, I turn to you all ;]
>
> Is there any way to add a label/comment/rename a symbol
in gdb?
No.
> I'm assuming no such functionality exists, as I can
find nothing about it,
> so that said, can anyone direct me to where I should
touch gdb to add such
> functionality?
Not really. I think you should do it with objcopy, instead.
Haven't
I suggested this to someone else recently on this list... ?
--
Daniel Jacobowitz
CodeSourcery
|
|
| Re: adding comments/labels? |
  United States |
2007-08-29 23:50:40 |
>
> Not really. I think you should do it with objcopy,
instead. Haven't
> I suggested this to someone else recently on this
list... ?
Why would I want to do it with objcopy? I'm reversing a
binary and I'd
like a label so I don't single step into the same function
every time, its
that or try to remember the address of every function I've
looked at.
I'll just have to do it the hardway and cludge through the
source and
figure out where symbol resolution occurs. Thanks for the
typical OSS/FS
help ('no do it my way instead')
|
|
| Re: adding comments/labels? |
  United States |
2007-08-29 16:25:05 |
On Thu, Aug 30, 2007 at 04:50:40AM +0000, jf wrote:
> >
> > Not really. I think you should do it with
objcopy, instead. Haven't
> > I suggested this to someone else recently on this
list... ?
>
> Why would I want to do it with objcopy? I'm reversing a
binary and I'd
> like a label so I don't single step into the same
function every time, its
> that or try to remember the address of every function
I've looked at.
>
> I'll just have to do it the hardway and cludge through
the source and
> figure out where symbol resolution occurs. Thanks for
the typical OSS/FS
> help ('no do it my way instead')
If you're going to be insulting when offered advice, please
don't
expect to get help again.
I recommended using objcopy because objcopy supports
modifying symbol
tables and GDB does not. You can write a GDB macro to use
objcopy to
add the symbol, replace the original binary, and reload it
into GDB.
It'll be about five lines. This will be about a million
times easier
than trying to add a new GDB command to modify the symbol
table.
--
Daniel Jacobowitz
CodeSourcery
|
|
| Re: adding comments/labels? |
  United States |
2007-08-29 16:30:17 |
> I'll just have to do it the hardway and cludge through
the source and
> figure out where symbol resolution occurs. Thanks for
the typical OSS/FS
> help ('no do it my way instead')
I think you are being unfair to Daniel. He's one of the very
few that
are constantly helping people using & modifying GDB. He
just gave
you the solution which he believes is going to help you
most. It's
too bad it's not the answer you were hoping for.
As far as your specific question goes: Name resolution is
performed
in symtab.c (all the "lookup_..." routines).
You'll probably benefit
from reading the "internals" documentation section
on symbols.
--
Joel
|
|
| Re: adding comments/labels? |
  Germany |
2007-08-30 09:28:07 |
On Thu, Aug 30, 2007 at 04:38:47AM +0000, jf wrote:
> Is there any way to add a label/comment/rename a symbol
in gdb?
Perhaps you'd want to look at IDA Pro?
With kind regards,
--
Baurzhan Ismagulov
http://www.kz-easy.com/
|
|
[1-6]
|
|
|
about | contact Other archives ( Real Estate discussion Medical topics )
|