Author Topic: Is it possible to debugging executables not compiled with code::blocks ?  (Read 25531 times)

Offline advance-software

  • Multiple posting newcomer
  • *
  • Posts: 21
Hi,
 
    I'd like to debug firefox (compiled using script/makefile voodoo) on Linux using code::blocks as the debugging environment as you have one of the best Linux debugging environments I've seen so far. Is this possible ?

Couldn't immediately spot how to open an executable as a project for debugging. Sorry if I've missed something obvious.

Thanks for all the hard work - loving CB.

Best regards,
Steve.

Offline golgepapaz

  • Multiple posting newcomer
  • *
  • Posts: 44
Debug -> Attach Process should do the trick.

Offline advance-software

  • Multiple posting newcomer
  • *
  • Posts: 21
> Debug -> Attach Process should do the trick.

If it was already running, that'd work. Not much good if you want to step through the initialization code though.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
If you have makefiles, you might be able to create an empty custom makefile project, add all sources and headers to the project and run it through C::B.
You have to correct the settings in the projects properties, especially the project settings, to make it a custom makefile project and in the build target tab, so it uses the correct folders and executable.
Somewhere in the forum or the wiki(?), there is a more exact desciption, if I remember correctly, but I do not have the time to search it at the moment.

Offline advance-software

  • Multiple posting newcomer
  • *
  • Posts: 21
hey jens - it's all complex python make weirdness. not expecting your stuff to interact with the build process. that can be done from the command line.

I just want to be able to use your interface to debug an existing compiled binary (with debug info) - as can be done in eclipse for example.

prefer your interface to eclipse, hence the request.

a big thank you for all your work on this project. this isn't urgent. can use ddd for now, but it would be nice & would extend the appeal/power of cb imo.

if I'm understanding you, perhaps this can be done by configuring a null custom compile somehow then specify the precompiled exe as the target.

project -> import -> [binary]  would be an  intuitive interface to this.
« Last Edit: June 15, 2013, 05:34:47 pm by advance-software »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Two options:

1. make a dummy-empty-project, where you setup you executable paths and then disable the option "Settings -> Debugger -> auto build project if it is not up to data"
2. setup a custom makefile project
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline advance-software

  • Multiple posting newcomer
  • *
  • Posts: 21
Re: Is it possible to debug executables not compiled with code::blocks ?
« Reply #6 on: June 17, 2013, 08:38:40 pm »
Appreciated & will try that.

The point however stands that an [import project -> binary] UI option to automate this task would improve codeblocks as the procedure would be more intuitive.

Yes, I know everyone is busy & no, I don't have time to implement this right now either.  Just sayin'.

Once again, thanks for being awesome. Totally understand if this is prioritized way down the list.

Cheers.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
I don't think it is even on the priority list (at least in mine), because C::B is not a debugger frontend, but a IDE.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline advance-software

  • Multiple posting newcomer
  • *
  • Posts: 21
Re: Is it possible to debug executables not compiled with code::blocks ?
« Reply #8 on: June 17, 2013, 09:35:45 pm »
I hear you but you have pretty much all the components in place to do this, so why not. makes it a more useful product.

other usability feedback:

ctrl-h is search & replace in visual studio & gedit. you currently have it set to hide tabs. only just figured out what was going on.

search & replace dialog goes after one operation. I often go search search search to find what I'm looking for so having to pop up the dialog then move it out of the way after each operation is cumbersome.

just a little constructive critique. hope you don't mind.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
search & replace dialog goes after one operation. I often go search search search to find what I'm looking for so having to pop up the dialog then move it out of the way after each operation is cumbersome.

isn't it normal behaviour to use first search and then F3 for future search (at least in the regedit on windows ;) ). The open "search dialog" takes only space (like in notepad++) from the editor....

ctrl-h is search & replace in visual studio & gedit. you currently have it set to hide tabs. only just figured out what was going on.

i personally like "R" because of "Replace"... H makes no sense for me.... But you can it change easily in Settings->Editor->Keyboard Shortcuts->Search->Replace

greetings
« Last Edit: June 17, 2013, 10:15:52 pm by BlueHazzard »

Offline advance-software

  • Multiple posting newcomer
  • *
  • Posts: 21
Re: Is it possible to debuggexecutables not compiled with code::blocks ?
« Reply #10 on: June 17, 2013, 11:55:57 pm »
> i personally like "R" because of "Replace"... H makes no sense for me.... But you can it change easily in Settings->Editor->Keyboard Shortcuts->Search->Replace

Agree R makes more sense but got this on autopilot. "VS mode" keyboard shortcuts would be nice as an option.

Couldn't spot Settings->Editor->Keyboard Shortcuts . Must be blind. Running Jens latest build.

> isn't it normal behaviour to use first search and then F3 for future search
dunno. that'll do. cheers. an icon on the toolbar for this would be nice. again, visual studio has a text edit on the toolbar you can drop quick searches into. not saying you should replicate everything they do, but that's a nice timesaver.

greetings.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
again, visual studio has a text edit on the toolbar you can drop quick searches into. not saying you should replicate everything they do, but that's a nice timesaver.

its called incremental search in c::b (see picture).

Couldn't spot Settings->Editor->Keyboard Shortcuts . Must be blind. Running Jens latest build.

again, see image.

greetings

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Is it possible to debuggexecutables not compiled with code::blocks ?
« Reply #12 on: June 18, 2013, 12:43:21 am »
Couldn't spot Settings->Editor->Keyboard Shortcuts . Must be blind. Running Jens latest build.
Make sure you have the contrib-plugins package installed.
Needed for keyboard-shortcuts and IncSearch.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Is it possible to debug executables not compiled with code::blocks ?
« Reply #13 on: June 18, 2013, 01:23:45 am »
I hear you but you have pretty much all the components in place to do this, so why not. makes it a more useful product.
Won't happen if you don't provide working and tested patch or this feature happens to be useful for my daily work in the future.
Unfortunately adding every randomly proposed feature is not the best option for long term maintainability

Jens: do you still think it is a good idea to have ctrl-h bound by default? (I think we had argument about this in the past, if I'm wrong I apologise)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Is it possible to debug executables not compiled with code::blocks ?
« Reply #14 on: June 18, 2013, 06:22:41 am »
Jens: do you still think it is a good idea to have ctrl-h bound by default? (I think we had argument about this in the past, if I'm wrong I apologise)

It's correct, we discussed this already.
To be honest, I don't care about MS (and others) defaukt shortcuts very much.
Another thing are more commonly used things like Ctrl+C, Ctrl+S, Ctrl+f etc.

I'm not against changing this in general, but I'm always against changing how things work silently, because it can break other users workflow, if we change shortcuts.
Won't happen [...] [until] this feature happens to be useful for my daily work in the future.