[Lazarus] [patch] Debugger: CPU registers: resetting display formats on every restart of the application

Martin lazarus at mfriebe.de
Mon Dec 19 03:09:07 CET 2011


On 18/12/2011 12:20, Bernd wrote:
> This one has annoyed me a lot during the last few days while debugging
> some assembly code: The display of the cpu registers always reverted
> to rdDefault (which is decimal for the registers I was interested in)
> every time I restarted my application, it was so annoying and time
> consuming setting them back to hex (each of them individually!) on
> every restart that I started using kdbg instead of Lazarus.
>
> The attached small patch for gdbmidebugger.pp would solve this problem
> once and for all. It will prevent the re-initialization of the
> FFormats array if it is already initialized (if it already has the
> correct size).
>
> Would this patch qualify for inclusion?
>
Well thanks at first for your work.
The patch is almost ok.

The patch should check that the new list has the same registers in the 
same order.
I don't know all the condition under which the list can change at all, 
maybe if a 32bit exe is loaded on a 64 bit arch? And I don't know if 
ever there is a case where the count remains but not the names.

2 possibilities:
1) when you check the count, check the names as well
2) temporary keep the old names and formats in local vars; set the new 
list; search each new name in the old list and copy the format if found

The location of your patch is acceptable. i.e. the work currently needs 
be done in the procedure, that you picked.

Ideally, but that does not matter for your patch, the location should 
move. the whole current register display stuff is not ideal (I just went 
for a quick solution back then)

If ever the formats should be stored in the ide config (or project 
settings), then they must move. More info on request








More information about the Lazarus mailing list