-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(gimli::write::ConvertError)InvalidAttributeValue while gimli::write::Dwarf::from() conversion #482
Comments
Unfortunately it's a bit hard to work out the cause of the Your convert_address function is fine. It won't be the cause of the Edit: I didn't realise you were doing this on an object file. The above comment only applies for executables. |
Sure, thanks. This is the file I'm working with : object-file. Can you please have a look at it? What I intend to do is : read an executable or relocatable ELF object file, modify some debugging information and then create a new executable or relocatable ELF object file with this modified debugging information. I tried working on an executable (reading it and then re-creating it), but it didn't work (there were many sections/symbols/data missing in the output file and couldn't produce an executable output file). So, I moved on to work on a relocatable object file, re-creating it and then linking it with the compiler again to make an executable file. In this case, I'm getting an error - InvalidAttributeValue. I'm currently using Thanks for pointing me to |
Correct,
I updated
|
Thanks @philipc ! I think I initially uploaded the wrong file. Sorry for that. The correct file with which I'm getting an |
Ok okay, yeah I am getting the |
It's the |
Thank you @philipc for looking into it! After disabling GNU location views while compiling, it worked! |
Hi @philipc ! |
Probably the problem is that gimli doesn't support writing |
That's only working by chance. gimli needs to generate a new |
Ah, okay. But, then in this case, even after explicit type casting |
Oh, I see. There is no field for |
At a guess, it works because it can still find the address from the symbol table.
Yes gimli should produce the section. Write support is still an incomplete feature. See #390. |
Okay, I'm confused, I wonder why gdb is not able to use the
Okay, thanks! I would like to contribute to this. Can you please suggest a starting point? |
I haven't looked at the gdb source, but my expectation is that it has two code paths:
Great! I am currently working on #479. |
Okay, got it. Thanks!
Sounds good, will start working on it!
👍 |
Hi @philipc ! |
I had initially thought that we could simply copy the information from the For now, it might be simpler to add a new By the way, what error were you seeing without |
Yes, I think we can check whether the
Sure, the tuple seems to be better instead of a struct and will write the code inside
No, there was no error due to missing |
Yes, but the complicated part is that you may need to interpret the
Yes.
I did some work on this today in #479, and I think
I think it's close enough to done that if you want to try it out and see if it works for what you want to do then that would be useful. It's not really at a point where having another contributor would help progress it though. |
Okay, I see. Maybe I could work on this sometime later, after getting more clarity.
Got it, thanks! I would try it out and see if it handles the memory address so that there would be no need for explicit type casting in the gdb session. |
Hello, I just happened to come across this post, and I was wondering how do you actually disable GNU location views? using |
Hi @jjang3, I think you can use this option to disable it. |
I am using Dwarf::from() to convert a readable Dwarf instance to a writable one using convert_address() function as follows:-
And I'm getting an InvalidAttributeValue error on the Dwarf::from line.
As mentioned in Dwarf::from()'s documentation,
I'm simply returning Address::Constant(addr) in convert_address function.
Could someone please clarify the changes to be done for relocatable addresses in convert_address function? (Is convert_address the cause for this error?)
Thanks
The text was updated successfully, but these errors were encountered: