Bug 426730 - [Memory] Support 16 bit addressable size
Summary: [Memory] Support 16 bit addressable size
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug-dsf-gdb (show other bugs)
Version: 8.2.1   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 8.4.0   Edit
Assignee: Alvaro Sanchez-Leon CLA
QA Contact: Marc Khouzam CLA
URL:
Whiteboard:
Keywords:
: 88054 (view as bug list)
Depends on:
Blocks: 429172
  Show dependency tree
 
Reported: 2014-01-27 11:34 EST by Alvaro Sanchez-Leon CLA
Modified: 2022-06-08 10:55 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alvaro Sanchez-Leon CLA 2014-01-27 11:34:43 EST
DSF-GDB does not currently support (by default) addressable sizes > 1 octet, 
This is fine for a majority of systems, however support for 16 bit of minimum addressable memory is desired.
   The current structure has been thought considering a variable value for addressable size but is currently stopped in few places and therefore has not been tested with this combination.

This bug will keep track of this development, discussions, etc.
Comment 1 Alvaro Sanchez-Leon CLA 2014-02-19 14:06:57 EST
The proposed solution is now available in the following gerrit change:

https://git.eclipse.org/r/#/c/22118/

The solution generically resolves the addressable size from the target system based on the following CLI command towards GDB.

e.g. Example of a target system using 16 bits of addressable memory
p/x (char)-1
$7 = 0xffff  

A simple method is used then to resolve the hex string above to the number of octets. 
similarly for an 8 bit addressable size "0xff" can be resolved to 1 octet.

A new services API for GDB memory has been created to request this value i.e. IGDBMemory2.

The MI interface was adjusted to request / parse addressable units going/coming from -data-read-memory-bytes 

The Memory related classes were updated to use bytes and addressable units according to the context. 

The UI memory renders were updated to operate addresses in addressable units.

Feed back is very welcome !
Comment 2 Marc Khouzam CLA 2014-02-26 11:44:50 EST
Great work Alvaro.  I've pushed your fix to master from Gerrit.

We can now support systems that have addressable sizes different than 1 octet!
Comment 3 Alvaro Sanchez-Leon CLA 2014-02-26 12:47:25 EST
Marc, Thanks a lot for your very valuable input to the implementation
Comment 4 Marc Khouzam CLA 2014-02-26 13:49:22 EST
I noticed that some tests fail after this commit.  The reason is that the command "p/x (char)-1" causes $1 to be used for the result, so return values then start at $2.

I've committed this fix to the tests:
http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=37166d61940835549568f0bbe07a763f056ad331
Comment 5 John Dallaway CLA 2022-06-08 10:55:31 EDT
*** Bug 88054 has been marked as a duplicate of this bug. ***