Hi,

I am using gdb 4.15.1 under DEC Unix 4.0 F: I would like to patch a library binary 
with a string. If the operation works well with an int, it fails with a string. For 
instance, if foo is a char[4], I get the following:

     (gdb) set write on
     (gdb) file myLib.so
     (gdb) set foo = *"ab"
     evaluation of this expression requires the program to have a function "malloc".
     (gdb)

gdb requires a malloc function inside a (running) program in order to allocate my 
string. But I am only trying to patch a shared library binary !

I could only find the following work-around :
     (gdb) set foo[0] = 'a'
     (gdb) set foo[1] = 'b'
     (gdb) set foo[2] = '\0'

But, this work-around is not very efficient if my string is, let's say, 64 bytes long. 
Isn't there a more simple solution or a gdb functionality I have missed ?

Thank you in advance.

Best regards,

Michel Simatic
e-mail: [EMAIL PROTECTED]

Reply via email to